Tomohiro Tanaka created SPARK-40804:
---------------------------------------
Summary: Missing handling a catalog name in destination tables in
`RenameTableExec`
Key: SPARK-40804
URL: https://issues.apache.org/jira/browse/SPARK-40804
Project: Spark
Issue Type: Bug
Components: SQL
Affects Versions: 3.2.2, 3.3.0, 3.1.3
Environment: This depends on Spark versions, since the version in
which ALTER TABLE RENAME TO is added.
Reporter: Tomohiro Tanaka
Fix For: 3.2.2, 3.3.0, 3.1.3
Currently `RenameTableExec` only handles an empty namespace for destination
tables as the following current spec:
(3.3.0 is picked up)
[https://github.com/apache/spark/blob/v3.3.0/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/RenameTableExec.scala#L48]
{code:java}
# L48
val qualifiedNewIdent = if (newIdent.namespace.isEmpty) {
Identifier.of(oldIdent.namespace, newIdent.name)
} else newIdent{code}
This part doesn't handle the case where a destination table is specified
catalog.db.table. For example, Apache Iceberg is expected to handle the
destination table as catalog.db.table in the document;
[https://iceberg.apache.org/docs/latest/spark-ddl/#alter-table--rename-to|https://iceberg.apache.org/docs/latest/spark-ddl/#alter-table--rename-to.]
If catalog.db.table is passed to "ALTER TABLE <src> RENAME TO <dst>" query,
there's a difference of handling namespaces between source and destination
tables. Specifically, source tables can be correctly handled as *[db]* for its
namespace, but destination tables is handled as *[catalog, db]* for its
namespace.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]