apache / apache/iceberg

`spark.sql.catalog.spark_catalog.default-namespace` has no effect with SparkSessionCatalog

Open
#14,424 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
9.2k
Forks
3.5k
Avg merge
2d 11h
Merged PRs (30d)
132

Description

### Apache Iceberg version

1.9.1

### Query engine

Spark

### Please describe the bug 🐞

As discussed on [Slack](https://apache-iceberg.slack.com/archives/C025PH0G1D4/p1761315026299809), the default database/namespace in the spark session catalog implementation is hard-coded to `default`, meaning that `spark.sql.catalog.spark_catalog.default-namespace` has no effect.

As a workaround, I've figured out that `spark.sql.catalog.spark_catalog.defaultDatabase` works, however we should either fix the misleading documentation, or see if we can get the config to work.

### Willingness to contribute

- [ ] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time

Contributor guide

Open the contributing guide

Research direction

The issue names SparkSessionCatalog and the spark.sql.catalog.spark_catalog.default-namespace setting, but no files or tests. Start by locating the catalog configuration handling and comparing it with the documented setting and the defaultDatabase workaround. Done means the setting takes effect, or the documentation clearly identifies the supported configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spark
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.