Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-51219][SQL] Fix
ShowTablesExec.isTempView
to work with non-`…
…V2SessionCatalog` catalogs ### What changes were proposed in this pull request? When non buildin catalog is configured (for example, `org.apache.spark.sql.delta.catalog.DeltaCatalog`) and there is a temp table in catalog, running catalog listTable will fail: ```scala spark.conf.set("spark.sql.catalog.spark_catalog", "org.apache.spark.sql.delta.catalog.DeltaCatalog") spark.range(0,2).createOrReplaceTempView("abc") spark.catalog.listTables().show() // org.apache.spark.sql.catalyst.parser.ParseException: // [PARSE_EMPTY_STATEMENT] Syntax error, unexpected empty statement. SQLSTATE: 42617 (line 1, pos 0) // // == SQL == // // ^^^ ``` If default `V2SessionCatalog` catalog is in use, or there are no temp tables, the same command run without issues. This behavior is due to `ShowTablesExec. isTempView ` method, where only for `V2SessionCatalog` catalogs dedicated `isTempView` is executed. This PR fixes that, by using `session.sessionState.catalog.isTempView` instead. ### Why are the changes needed? To avoid unnecessary fails when a non-buildin v2 catalog is in use. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New unit tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#49959 from ostronaut/features/fix-ShowTablesExec-isTempView. Authored-by: Dima <dimanowq@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information