You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/10/15 14:53:00 UTC
[jira] [Assigned] (SPARK-40804) Missing handling a catalog name in destination tables in `RenameTableExec`
[ https://issues.apache.org/jira/browse/SPARK-40804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-40804:
------------------------------------
Assignee: (was: Apache Spark)
> 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.1.3, 3.3.0, 3.2.2
> Environment: This depends on Spark versions, since the version in which ALTER TABLE RENAME TO is added.
> Reporter: Tomohiro Tanaka
> Priority: Blocker
> Fix For: 3.1.3, 3.3.0, 3.2.2
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org