The default catalog is named sail
With no catalog configured, the current catalog is named sail, not spark_catalog. Avoid hard-coding spark_catalog in three-part table names.
Check targets:
pysail==0.7.3 with pyspark-client==4.1.3The Python assertions below check this behavior. Details attributed to external documentation are outside those assertions. Newer releases may behave differently.
Run the check
Follow the test setup, then run from the repository root (sail-examples/). The harness applies the configuration declared in this check.
Sail
uv run pytest 'tests/test_facts.py::test_fact[default-catalog-name[sail]]'Apache Spark (requires Java 17)
uv run pytest 'tests/test_facts.py::test_fact[default-catalog-name[spark]]'Python code
default-catalog-name.py17 lines
FACT = {
"id": "default-catalog-name",
"title": "The default catalog is named sail",
"category": "configure",
"core": True,
"text": """With no catalog configured, the current catalog is named `sail`, not `spark_catalog`.
Avoid hard-coding `spark_catalog` in three-part table names.""",
"engines": ["sail", "spark"],
"order": 3,
}
def check(spark, engine):
current = spark.catalog.currentCatalog()
expected = "sail" if engine == "sail" else "spark_catalog"
assert current == expected, f"expected {expected!r}, got {current!r}"
return {"current_catalog": current}