sunny1154 opened a new issue, #11741:
URL: https://github.com/apache/iceberg/issues/11741
### Apache Iceberg version
1.5.0
### Query engine
Spark
### Please describe the bug 🐞
Hi,
I am observing issues when working with rest based catalog.
my spark session has default catalog defined which is based of REST based
catalog.
SparkSession.catalog api fails to work with rest based catalog.
tested with Spark 3.4.
${SPARK_HOME}/bin/spark-shell --master local[*] \
--driver-memory 2g \
--conf
spark.hadoop.fs.s3a.aws.credentials.provider=org.apache.hadoop.fs.s3a.TemporaryAWSCredentialsProvider
\
--conf spark.sql.catalog.iceberg.uri=https://xx.xxx.xxxx.domain.com \
--conf spark.sql.warehouse.dir=$SQL_WAREHOUSE_DIR \
--conf spark.sql.defaultCatalog=iceberg \
--conf spark.sql.catalog.iceberg=org.apache.iceberg.spark.SparkCatalog \
--conf
spark.sql.catalog.iceberg.catalog-impl=org.apache.iceberg.rest.RESTCatalog \
scala> spark.catalog.currentCatalog
res1: String = iceberg
scala> spark.sql("select * from restDb.restTable").show
+---+----------+
| id| data|
+---+----------+
| 1|some_value|
+---+----------+
scala> spark.catalog.tableExists("restDb.restTable")
**res3: Boolean = true**
scala> spark.catalog.tableExists("restDb", "restTable")
**res4: Boolean = false**
other API also fail like
spark.catalog.getTable("restDb", "restTable")
-- fails with database not found
spark.catalog.getTable("restDb.restTable")
-- returns table object
spark.catalog.tableExists("restDb", "restTable")
-- return false (even though table exists)
spark.catalog.tableExists("restDb.restTable")
-- return true (if table exists and registered with rest catalog)
spark.catalog.listColumns("restDb", "restTable")
-- fails with database not found
spark.catalog.listColumns("restDb.restTable")
-- return list of columns
### 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]