You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2023/12/05 15:25:58 UTC
(incubator-paimon) branch release-0.6 updated (e80c859bb -> eca1c8efa)
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a change to branch release-0.6
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
from e80c859bb [core] Introduce scan.file-creation-time-millis (#2452)
new 9d29eceef [spark] move spark.sql classes to paimon package (#2456)
new eca1c8efa [doc] Document available flink procedures (#2455)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docs/content/engines/flink.md | 185 +++++++++++++++++++++
docs/content/maintenance/manage-snapshots.md | 2 +-
.../flink/procedure/DropPartitionProcedure.java | 3 +
.../shim/PaimonCreateTableAsSelectStrategy.scala | 4 +-
.../procedure/RemoveOrphanFilesProcedure.java | 4 +-
.../analysis/AssignmentAlignmentHelper.scala | 5 +-
.../spark}/catalyst/analysis/PaimonAnalysis.scala | 8 +-
.../catalyst/analysis/PaimonDeleteTable.scala | 2 +-
.../spark}/catalyst/analysis/PaimonMergeInto.scala | 4 +-
.../analysis/PaimonMergeIntoResolver.scala | 6 +-
.../analysis/PaimonProcedureResolver.scala | 53 ++++--
.../spark}/catalyst/analysis/PaimonRelation.scala | 3 +-
.../catalyst/analysis/PaimonUpdateTable.scala | 2 +-
.../spark}/catalyst/analysis/RowLevelHelper.scala | 2 +-
.../spark}/catalyst/analysis/RowLevelOp.scala | 2 +-
.../analysis/expressions/ExpressionHelper.scala | 2 +-
.../catalyst/plans/logical/PaimonCallCommand.scala | 3 +-
.../plans/logical/PaimonCallStatement.scala | 3 +-
.../plans/logical/PaimonTableValuedFunctions.scala | 3 +-
.../spark/commands/MergeIntoPaimonTable.scala | 2 +-
.../spark/commands/UpdatePaimonTableCommand.scala | 2 +-
.../spark}/execution/PaimonCallExec.scala | 2 +-
.../spark}/execution/PaimonStrategy.scala | 7 +-
.../extensions/PaimonSparkSessionExtensions.scala | 8 +-
.../catalyst/analysis/PaimonCoerceArguments.scala | 61 -------
.../extensions/PaimonSqlExtensionsAstBuilder.scala | 5 +-
.../connector/catalog/PaimonLookupCatalog.scala | 7 +-
...tegyHelper.scala => PaimonStrategyHelper.scala} | 2 +-
.../shim/PaimonCreateTableAsSelectStrategy.scala | 4 +-
.../spark/extensions/CallStatementParserTest.java | 9 +-
.../procedure/RemoveOrphanFilesProcedureTest.scala | 8 +-
.../paimon/spark/sql/DeleteFromTableTest.scala | 2 +-
.../apache/paimon/spark/sql/UpdateTableTest.scala | 2 +-
33 files changed, 291 insertions(+), 126 deletions(-)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/AssignmentAlignmentHelper.scala (97%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/PaimonAnalysis.scala (90%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/PaimonDeleteTable.scala (96%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/PaimonMergeInto.scala (97%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/PaimonMergeIntoResolver.scala (95%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/PaimonProcedureResolver.scala (80%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/PaimonRelation.scala (93%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/PaimonUpdateTable.scala (97%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/RowLevelHelper.scala (98%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/RowLevelOp.scala (96%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/analysis/expressions/ExpressionHelper.scala (98%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/plans/logical/PaimonCallCommand.scala (92%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/plans/logical/PaimonCallStatement.scala (91%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/catalyst/plans/logical/PaimonTableValuedFunctions.scala (96%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/execution/PaimonCallExec.scala (97%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/{spark/sql => paimon/spark}/execution/PaimonStrategy.scala (90%)
delete mode 100644 paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonCoerceArguments.scala
copy paimon-common/src/test/resources/codesplit/groups/expected/IfInWhile.txt => paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/connector/catalog/PaimonLookupCatalog.scala (89%)
rename paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/{StrategyHelper.scala => PaimonStrategyHelper.scala} (98%)
(incubator-paimon) 02/02: [doc] Document available flink procedures (#2455)
Posted by lz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch release-0.6
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
commit eca1c8efabb93bfdcf12df96dcca0fe26027054b
Author: yuzelin <33...@users.noreply.github.com>
AuthorDate: Tue Dec 5 20:53:18 2023 +0800
[doc] Document available flink procedures (#2455)
---
docs/content/engines/flink.md | 185 +++++++++++++++++++++
docs/content/maintenance/manage-snapshots.md | 2 +-
.../flink/procedure/DropPartitionProcedure.java | 3 +
.../procedure/RemoveOrphanFilesProcedure.java | 4 +-
.../procedure/RemoveOrphanFilesProcedureTest.scala | 8 +-
5 files changed, 195 insertions(+), 7 deletions(-)
diff --git a/docs/content/engines/flink.md b/docs/content/engines/flink.md
index 7250b8bb5..7175269ab 100644
--- a/docs/content/engines/flink.md
+++ b/docs/content/engines/flink.md
@@ -319,3 +319,188 @@ SELECT * FROM T;
SET 'paimon.*.default.T.scan.timestamp-millis' = '1697018249000';
SELECT * FROM T;
```
+
+## Procedures
+
+Flink 1.18 and later versions support [Call Statements](https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql/call/),
+which make it easier to manipulate data and metadata of Paimon table by writing SQLs instead of submitting Flink jobs.
+All available procedures are listed below. Note that when you call a procedure, you must pass all parameters in order,
+and if you don't want to pass some parameters, you must use `''` as placeholder. For example, if you want to compact
+table `default.t` with parallelism 4, but you don't want to specify partitions and sort strategy, the call statement
+should be \
+`CALL sys.compact('default.t', '', '', '', 'sink.parallelism=4')`.
+
+Specify partitions: we use string to represent partition filter. "," means "AND" and ";" means "OR". For example, if you want
+to specify two partitions date=01 and date=02, you need to write 'date=01;date=02'; If you want to specify one partition
+with date=01 and day=01, you need to write 'date=01,day=01'.
+
+table options syntax: we use string to represent table options. The format is 'key1=value1,key2=value2...'.
+
+<table class="table table-bordered">
+ <thead>
+ <tr>
+ <th class="text-left" style="width: 4%">Procedure Name</th>
+ <th class="text-left" style="width: 4%">Usage</th>
+ <th class="text-left" style="width: 20%">Explaination</th>
+ <th class="text-left" style="width: 4%">Example</th>
+ </tr>
+ </thead>
+ <tbody style="font-size: 11px; ">
+ <tr>
+ <td>compact</td>
+ <td>
+ CALL [catalog.]sys.compact('identifier') <br/><br/>
+ CALL [catalog.]sys.compact('identifier', 'partitions') <br/><br/>
+ CALL [catalog.]sys.compact('identifier', 'partitions', 'order_strategy', 'order_columns', 'table_options')
+ </td>
+ <td>
+ TO compact a table. Arguments:
+ <li>identifier: the target table identifier. Cannot be empty.</li>
+ <li>partitions: partition filter.</li>
+ <li>order_strategy: 'order' or 'zorder' or 'none'. Left empty for 'none'.</li>
+ <li>order_columns: the columns need to be sort. Left empty if 'order_strategy' is 'none'.</li>
+ <li>table_options: additional dynamic options of the table.</li>
+ </td>
+ <td>
+ CALL sys.compact('default.T', 'p=0', 'zorder', 'a,b', 'sink.parallelism=4')
+ </td>
+ </tr>
+ <tr>
+ <td>compact_database</td>
+ <td>
+ CALL [catalog.]sys.compact_database() <br/><br/>
+ CALL [catalog.]sys.compact_database('includingDatabases') <br/><br/>
+ CALL [catalog.]sys.compact_database('includingDatabases', 'mode') <br/><br/>
+ CALL [catalog.]sys.compact_database('includingDatabases', 'mode', 'includingTables') <br/><br/>
+ CALL [catalog.]sys.compact_database('includingDatabases', 'mode', 'includingTables', 'excludingTables') <br/><br/>
+ CALL [catalog.]sys.compact_database('includingDatabases', 'mode', 'includingTables', 'excludingTables', 'tableOptions')
+ </td>
+ <td>
+ To compact databases. Arguments:
+ <li>includingDatabases: to specify databases. You can use regular expression.</li>
+ <li>mode: compact mode. "divided": start a sink for each table, detecting the new table requires restarting the job;
+ "combined" (default): start a single combined sink for all tables, the new table will be automatically detected.
+ </li>
+ <li>includingTables: to specify tables. You can use regular expression.</li>
+ <li>excludingTables: to specify tables that are not compacted. You can use regular expression.</li>
+ <li>tableOptions: additional dynamic options of the table.</li>
+ </td>
+ <td>
+ CALL sys.compact_database('db1|db2', 'combined', 'table_.*', 'ignore', 'sink.parallelism=4')
+ </td>
+ </tr>
+ <tr>
+ <td>create_tag</td>
+ <td>
+ CALL [catalog.]sys.create_tag('identifier', 'tagName', snapshotId)
+ </td>
+ <td>
+ To create a tag based on given snapshot. Arguments:
+ <li>identifier: the target table identifier. Cannot be empty.</li>
+ <li>tagName: name of the new tag.</li>
+ <li>snapshotId (Long): id of the snapshot which the new tag is based on.</li>
+ </td>
+ <td>
+ CALL sys.create_tag('default.T', 'my_tag', 10)
+ </td>
+ </tr>
+ <tr>
+ <td>delete_tag</td>
+ <td>
+ CALL [catalog.]sys.delete_tag('identifier', 'tagName')
+ </td>
+ <td>
+ To delete a tag. Arguments:
+ <li>identifier: the target table identifier. Cannot be empty.</li>
+ <li>tagName: name of the tag to be deleted.</li>
+ </td>
+ <td>
+ CALL sys.delete_tag('default.T', 'my_tag')
+ </td>
+ </tr>
+ <tr>
+ <td>merge_into</td>
+ <td>
+ -- when matched then upsert<br/>
+ CALL [catalog.]sys.merge_into('identifier','targetAlias',<br/>
+ 'sourceSqls','sourceTable','mergeCondition',<br/>
+ 'matchedUpsertCondition','matchedUpsertSetting')<br/><br/>
+ -- when matched then upsert; when not matched then insert<br/>
+ CALL [catalog.]sys.merge_into('identifier','targetAlias',<br/>
+ 'sourceSqls','sourceTable','mergeCondition',<br/>
+ 'matchedUpsertCondition','matchedUpsertSetting',<br/>
+ 'notMatchedInsertCondition','notMatchedInsertValues')<br/><br/>
+ -- when matched then delete<br/>
+ CALL [catalog].sys.merge_into('identifier','targetAlias',<br/>
+ 'sourceSqls','sourceTable','mergeCondition',<br/>
+ 'matchedDeleteCondition')<br/><br/>
+ -- when matched then upsert + delete;<br/>
+ -- when not matched then insert<br/>
+ CALL [catalog].sys.merge_into('identifier','targetAlias',<br/>
+ 'sourceSqls','sourceTable','mergeCondition',<br/>
+ 'matchedUpsertCondition','matchedUpsertSetting',<br/>
+ 'notMatchedInsertCondition','notMatchedInsertValues',<br/>
+ 'matchedDeleteCondition')<br/><br/>
+ </td>
+ <td>
+ To perform "MERGE INTO" syntax. See <a href="/how-to/writing-tables#merging-into-table">merge_into action</a> for
+ details of arguments.
+ </td>
+ <td>
+ -- for matched order rows,<br/>
+ -- increase the price,<br/>
+ -- and if there is no match,<br/>
+ -- insert the order from<br/>
+ -- the source table<br/>
+ CALL sys.merge_into('default.T', '', '', 'default.S', 'T.id=S.order_id', '', 'price=T.price+20', '', '*')
+ </td>
+ </tr>
+ <tr>
+ <td>remove_orphan_files</td>
+ <td>
+ CALL [catalog.]sys.remove_orphan_files('identifier')<br/><br/>
+ CALL [catalog.]sys.remove_orphan_files('identifier', 'olderThan')
+ </td>
+ <td>
+ To remove the orphan data files and metadata files. Arguments:
+ <li>identifier: the target table identifier. Cannot be empty.</li>
+ <li>olderThan: to avoid deleting newly written files, this procedure only
+ deletes orphan files older than 1 day by default. This argument can modify the interval.
+ </li>
+ </td>
+ <td>CALL remove_orphan_files('default.T', '2023-10-31 12:00:00')</td>
+ </tr>
+ <tr>
+ <td>reset_consumer</td>
+ <td>
+ -- reset the new next snapshot id in the consumer<br/>
+ CALL [catalog.]sys.reset_consumer('identifier', 'consumerId', nextSnapshotId)<br/><br/>
+ -- delete consumer<br/>
+ CALL [catalog.]sys.reset_consumer('identifier', 'consumerId')
+ </td>
+ <td>
+ To reset or delete consumer. Arguments:
+ <li>identifier: the target table identifier. Cannot be empty.</li>
+ <li>consumerId: consumer to be reset or deleted.</li>
+ <li>nextSnapshotId (Long): the new next snapshot id of the consumer.</li>
+ </td>
+ <td>CALL sys.reset_consumer('default.T', 'myid', 10)</td>
+ </tr>
+ <tr>
+ <td>rollback_to</td>
+ <td>
+ -- rollback to a snapshot<br/>
+ CALL sys.rollback_to('identifier', snapshotId)<br/><br/>
+ -- rollback to a tag<br/>
+ CALL sys.rollback_to('identifier', 'tagName')
+ </td>
+ <td>
+ To rollback to a specific version of target table. Argument:
+ <li>identifier: the target table identifier. Cannot be empty.</li>
+ <li>snapshotId (Long): id of the snapshot that will roll back to.</li>
+ <li>tagName: name of the tag that will roll back to.</li>
+ </td>
+ <td>CALL sys.rollback_to('default.T', 10)</td>
+ </tr>
+ </tbody>
+</table>
diff --git a/docs/content/maintenance/manage-snapshots.md b/docs/content/maintenance/manage-snapshots.md
index a72c89f99..312259c7a 100644
--- a/docs/content/maintenance/manage-snapshots.md
+++ b/docs/content/maintenance/manage-snapshots.md
@@ -325,7 +325,7 @@ To avoid deleting files that are newly added by other writing jobs, this action
{{< tab "Spark" >}}
```sql
-CALL sys.remove_orphan_files(table => "tableId", [older_then => "2023-10-31 12:00:00"])
+CALL sys.remove_orphan_files(table => "tableId", [older_than => "2023-10-31 12:00:00"])
```
{{< /tab >}}
diff --git a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/DropPartitionProcedure.java b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/DropPartitionProcedure.java
index 0db9eb7a4..4903d6838 100644
--- a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/DropPartitionProcedure.java
+++ b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/DropPartitionProcedure.java
@@ -37,7 +37,10 @@ import static org.apache.paimon.utils.Preconditions.checkArgument;
* <pre><code>
* CALL sys.drop_partition('tableId', 'partition1', 'partition2', ...)
* </code></pre>
+ *
+ * @deprecated use ALTER TABLE DROP PARTITION
*/
+@Deprecated
public class DropPartitionProcedure extends ProcedureBase {
public static final String IDENTIFIER = "drop_partition";
diff --git a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedure.java b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedure.java
index c5d5ff23e..c0639ba44 100644
--- a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedure.java
+++ b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedure.java
@@ -37,7 +37,7 @@ import static org.apache.spark.sql.types.DataTypes.StringType;
* Remove orphan files procedure. Usage:
*
* <pre><code>
- * CALL sys.remove_orphan_files(table => 'tableId', [older_then => '2023-10-31 12:00:00'])
+ * CALL sys.remove_orphan_files(table => 'tableId', [older_than => '2023-10-31 12:00:00'])
* </code></pre>
*/
public class RemoveOrphanFilesProcedure extends BaseProcedure {
@@ -45,7 +45,7 @@ public class RemoveOrphanFilesProcedure extends BaseProcedure {
private static final ProcedureParameter[] PARAMETERS =
new ProcedureParameter[] {
ProcedureParameter.required("table", StringType),
- ProcedureParameter.optional("older_then", StringType)
+ ProcedureParameter.optional("older_than", StringType)
};
private static final StructType OUTPUT_TYPE =
diff --git a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedureTest.scala b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedureTest.scala
index 5f8a58e78..4764daa6f 100644
--- a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedureTest.scala
+++ b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/RemoveOrphanFilesProcedureTest.scala
@@ -51,22 +51,22 @@ class RemoveOrphanFilesProcedureTest extends PaimonSparkTestBase {
checkAnswer(spark.sql(s"CALL sys.remove_orphan_files(table => 'T')"), Row("Deleted=0") :: Nil)
val orphanFile2ModTime = fileIO.getFileStatus(orphanFile2).getModificationTime
- val older_then1 = DateTimeUtils.formatLocalDateTime(
+ val older_than1 = DateTimeUtils.formatLocalDateTime(
DateTimeUtils.toLocalDateTime(
orphanFile2ModTime -
TimeUnit.SECONDS.toMillis(1)),
3)
checkAnswer(
- spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_then => '$older_then1')"),
+ spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_than => '$older_than1')"),
Row("Deleted=1") :: Nil)
- val older_then2 = DateTimeUtils.formatLocalDateTime(
+ val older_than2 = DateTimeUtils.formatLocalDateTime(
DateTimeUtils.toLocalDateTime(System.currentTimeMillis()),
3)
checkAnswer(
- spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_then => '$older_then2')"),
+ spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_than => '$older_than2')"),
Row("Deleted=1") :: Nil)
}
}
(incubator-paimon) 01/02: [spark] move spark.sql classes to paimon package (#2456)
Posted by lz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch release-0.6
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
commit 9d29eceef8f124de471ea256d47030cd128545d8
Author: Yann Byron <bi...@gmail.com>
AuthorDate: Tue Dec 5 19:28:24 2023 +0800
[spark] move spark.sql classes to paimon package (#2456)
---
.../shim/PaimonCreateTableAsSelectStrategy.scala | 4 +-
.../analysis/AssignmentAlignmentHelper.scala | 5 +-
.../spark}/catalyst/analysis/PaimonAnalysis.scala | 8 +--
.../catalyst/analysis/PaimonDeleteTable.scala | 2 +-
.../spark}/catalyst/analysis/PaimonMergeInto.scala | 4 +-
.../analysis/PaimonMergeIntoResolver.scala | 6 ++-
.../analysis/PaimonProcedureResolver.scala | 53 ++++++++++++++-----
.../spark}/catalyst/analysis/PaimonRelation.scala | 3 +-
.../catalyst/analysis/PaimonUpdateTable.scala | 2 +-
.../spark}/catalyst/analysis/RowLevelHelper.scala | 2 +-
.../spark}/catalyst/analysis/RowLevelOp.scala | 2 +-
.../analysis/expressions/ExpressionHelper.scala | 2 +-
.../catalyst/plans/logical/PaimonCallCommand.scala | 3 +-
.../plans/logical/PaimonCallStatement.scala | 3 +-
.../plans/logical/PaimonTableValuedFunctions.scala | 3 +-
.../spark/commands/MergeIntoPaimonTable.scala | 2 +-
.../spark/commands/UpdatePaimonTableCommand.scala | 2 +-
.../spark}/execution/PaimonCallExec.scala | 2 +-
.../spark}/execution/PaimonStrategy.scala | 7 ++-
.../extensions/PaimonSparkSessionExtensions.scala | 8 +--
.../catalyst/analysis/PaimonCoerceArguments.scala | 61 ----------------------
.../extensions/PaimonSqlExtensionsAstBuilder.scala | 5 +-
.../catalog/PaimonLookupCatalog.scala} | 20 +------
...tegyHelper.scala => PaimonStrategyHelper.scala} | 2 +-
.../shim/PaimonCreateTableAsSelectStrategy.scala | 4 +-
.../spark/extensions/CallStatementParserTest.java | 9 ++--
.../paimon/spark/sql/DeleteFromTableTest.scala | 2 +-
.../apache/paimon/spark/sql/UpdateTableTest.scala | 2 +-
28 files changed, 96 insertions(+), 132 deletions(-)
diff --git a/paimon-spark/paimon-spark-3.3/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala b/paimon-spark/paimon-spark-3.3/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala
index 6573c13e7..21404fb3f 100644
--- a/paimon-spark/paimon-spark-3.3/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala
+++ b/paimon-spark/paimon-spark-3.3/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala
@@ -24,7 +24,7 @@ import org.apache.spark.sql.{SparkSession, Strategy}
import org.apache.spark.sql.catalyst.analysis.ResolvedDBObjectName
import org.apache.spark.sql.catalyst.plans.logical.{CreateTableAsSelect, LogicalPlan, TableSpec}
import org.apache.spark.sql.connector.catalog.StagingTableCatalog
-import org.apache.spark.sql.execution.{SparkPlan, StrategyHelper}
+import org.apache.spark.sql.execution.{PaimonStrategyHelper, SparkPlan}
import org.apache.spark.sql.execution.datasources.v2.CreateTableAsSelectExec
import org.apache.spark.sql.util.CaseInsensitiveStringMap
@@ -32,7 +32,7 @@ import scala.collection.JavaConverters._
case class PaimonCreateTableAsSelectStrategy(spark: SparkSession)
extends Strategy
- with StrategyHelper {
+ with PaimonStrategyHelper {
import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/AssignmentAlignmentHelper.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/AssignmentAlignmentHelper.scala
similarity index 97%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/AssignmentAlignmentHelper.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/AssignmentAlignmentHelper.scala
index 334362302..7338f4ba5 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/AssignmentAlignmentHelper.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/AssignmentAlignmentHelper.scala
@@ -15,10 +15,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
+
+import org.apache.paimon.spark.catalyst.analysis.expressions.ExpressionHelper
import org.apache.spark.sql.catalyst.SQLConfHelper
-import org.apache.spark.sql.catalyst.analysis.expressions.ExpressionHelper
import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, CreateNamedStruct, Expression, GetStructField, Literal, NamedExpression}
import org.apache.spark.sql.catalyst.plans.logical.Assignment
import org.apache.spark.sql.types.StructType
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonAnalysis.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonAnalysis.scala
similarity index 90%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonAnalysis.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonAnalysis.scala
index 377539b0a..a1cd1a8e0 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonAnalysis.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonAnalysis.scala
@@ -15,15 +15,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.spark.SparkTable
+import org.apache.paimon.spark.catalyst.plans.logical.{PaimonTableValuedFunctions, PaimonTableValueFunction}
import org.apache.paimon.spark.commands.{PaimonDynamicPartitionOverwriteCommand, PaimonTruncateTableCommand}
import org.apache.paimon.table.FileStoreTable
+import PaimonRelation.isPaimonTable
import org.apache.spark.sql.SparkSession
-import org.apache.spark.sql.catalyst.analysis.PaimonRelation.isPaimonTable
-import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, MergeIntoTable, OverwritePartitionsDynamic, PaimonTableValuedFunctions, PaimonTableValueFunction, TruncatePartition, TruncateTable}
+import org.apache.spark.sql.catalyst.analysis.ResolvedPartitionSpec
+import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, MergeIntoTable, OverwritePartitionsDynamic, TruncatePartition, TruncateTable}
import org.apache.spark.sql.catalyst.rules.Rule
import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonDeleteTable.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonDeleteTable.scala
similarity index 96%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonDeleteTable.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonDeleteTable.scala
index 7b2175ec7..1e58395ce 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonDeleteTable.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonDeleteTable.scala
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.spark.commands.DeleteFromPaimonTableCommand
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonMergeInto.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonMergeInto.scala
similarity index 97%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonMergeInto.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonMergeInto.scala
index b1c945663..958f2e8c6 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonMergeInto.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonMergeInto.scala
@@ -15,14 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.CoreOptions
import org.apache.paimon.spark.SparkTable
+import org.apache.paimon.spark.catalyst.analysis.expressions.ExpressionHelper
import org.apache.paimon.spark.commands.MergeIntoPaimonTable
import org.apache.spark.sql.SparkSession
-import org.apache.spark.sql.catalyst.analysis.expressions.ExpressionHelper
import org.apache.spark.sql.catalyst.expressions.{AttributeReference, AttributeSet, Expression, SubqueryExpression}
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.catalyst.rules.Rule
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonMergeIntoResolver.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonMergeIntoResolver.scala
similarity index 95%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonMergeIntoResolver.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonMergeIntoResolver.scala
index 366146c7a..e6f7379e6 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonMergeIntoResolver.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonMergeIntoResolver.scala
@@ -15,10 +15,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
+
+import org.apache.paimon.spark.catalyst.analysis.expressions.ExpressionHelper
import org.apache.spark.sql.SparkSession
-import org.apache.spark.sql.catalyst.analysis.expressions.ExpressionHelper
+import org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute
import org.apache.spark.sql.catalyst.plans.logical.{Assignment, DeleteAction, InsertAction, InsertStarAction, LogicalPlan, MergeAction, MergeIntoTable, UpdateAction, UpdateStarAction}
/** Resolve all the expressions for MergeInto. */
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonProcedureResolver.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonProcedureResolver.scala
similarity index 80%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonProcedureResolver.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonProcedureResolver.scala
index 844b43c1e..44b4c3e93 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonProcedureResolver.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonProcedureResolver.scala
@@ -15,16 +15,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.spark.catalog.ProcedureCatalog
+import org.apache.paimon.spark.catalyst.plans.logical.{PaimonCallArgument, PaimonCallCommand, PaimonCallStatement, PaimonNamedArgument, PaimonPositionalArgument}
import org.apache.paimon.spark.procedure.ProcedureParameter
-import org.apache.spark.sql.{AnalysisException, SparkSession}
-import org.apache.spark.sql.catalyst.expressions.{Expression, Literal}
-import org.apache.spark.sql.catalyst.plans.logical._
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.expressions.{Cast, Expression, Literal}
+import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
import org.apache.spark.sql.catalyst.rules.Rule
-import org.apache.spark.sql.connector.catalog.{CatalogManager, CatalogPlugin, LookupCatalog}
+import org.apache.spark.sql.connector.catalog.{CatalogPlugin, PaimonLookupCatalog}
import java.util.Locale
@@ -42,9 +43,9 @@ import java.util.Locale
*/
case class PaimonProcedureResolver(sparkSession: SparkSession)
extends Rule[LogicalPlan]
- with LookupCatalog {
+ with PaimonLookupCatalog {
- protected lazy val catalogManager: CatalogManager = sparkSession.sessionState.catalogManager
+ protected lazy val catalogManager = sparkSession.sessionState.catalogManager
override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperators {
case PaimonCallStatement(CatalogAndIdentifier(catalog, identifier), arguments) =>
@@ -56,6 +57,30 @@ case class PaimonProcedureResolver(sparkSession: SparkSession)
PaimonCallCommand(
procedure,
args = buildArgumentExpressions(normalizedParameters, normalizedArguments))
+
+ case call @ PaimonCallCommand(procedure, arguments) if call.resolved =>
+ val parameters = procedure.parameters
+ val newArguments = arguments.zipWithIndex.map {
+ case (argument, index) =>
+ val parameter = parameters(index)
+ val parameterType = parameter.dataType
+ val argumentType = argument.dataType
+ if (parameterType != argumentType && !Cast.canUpCast(argumentType, parameterType)) {
+ throw new RuntimeException(
+ s"Cannot cast $argumentType to $parameterType of ${parameter.name}.")
+ }
+ if (parameterType != argumentType) {
+ Cast(argument, parameterType)
+ } else {
+ argument
+ }
+ }
+
+ if (newArguments != arguments) {
+ call.copy(args = newArguments)
+ } else {
+ call
+ }
}
/**
@@ -88,12 +113,12 @@ case class PaimonProcedureResolver(sparkSession: SparkSession)
case (name, matchingParams) if matchingParams.length > 1 => name
}
if (duplicateParamNames.nonEmpty) {
- throw new AnalysisException(
+ throw new RuntimeException(
s"Parameter names ${duplicateParamNames.mkString("[", ",", "]")} are duplicated.")
}
parameters.sliding(2).foreach {
case Seq(previousParam, currentParam) if !previousParam.required && currentParam.required =>
- throw new AnalysisException(
+ throw new RuntimeException(
s"Optional parameters should be after required ones but $currentParam is after $previousParam.")
case _ =>
}
@@ -133,7 +158,7 @@ case class PaimonProcedureResolver(sparkSession: SparkSession)
case parameter if !nameToArgumentMap.contains(parameter.name) => parameter.name
}
if (missingParamNames.nonEmpty) {
- throw new AnalysisException(
+ throw new RuntimeException(
s"Required parameters ${missingParamNames.mkString("[", ",", "]")} is missed.")
}
val argumentExpressions = new Array[Expression](parameters.size)
@@ -169,7 +194,7 @@ case class PaimonProcedureResolver(sparkSession: SparkSession)
val isPositionalArgument = arguments.exists(_.isInstanceOf[PaimonPositionalArgument])
if (isNamedArgument && isPositionalArgument) {
- throw new AnalysisException("Cannot mix named and positional arguments.")
+ throw new RuntimeException("Cannot mix named and positional arguments.")
}
if (isNamedArgument) {
@@ -180,13 +205,13 @@ case class PaimonProcedureResolver(sparkSession: SparkSession)
case (name, _) if !nameToPositionMap.contains(name) => s"Argument $name is unknown."
}
if (validationErrors.nonEmpty) {
- throw new AnalysisException(
+ throw new RuntimeException(
s"Builds name to argument map ${validationErrors.mkString(", ")} error.")
}
namedArguments.map(arg => arg.name -> arg).toMap
} else {
if (arguments.size > parameters.size) {
- throw new AnalysisException("Too many arguments for procedure")
+ throw new RuntimeException("Too many arguments for procedure")
}
arguments.zipWithIndex.map {
case (argument, position) =>
@@ -207,7 +232,7 @@ case class PaimonProcedureResolver(sparkSession: SparkSession)
case procedureCatalog: ProcedureCatalog =>
procedureCatalog
case _ =>
- throw new AnalysisException(s"${catalogPlugin.name} is not a ProcedureCatalog.")
+ throw new RuntimeException(s"${catalogPlugin.name} is not a ProcedureCatalog.")
}
}
}
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonRelation.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonRelation.scala
similarity index 93%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonRelation.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonRelation.scala
index 040a1aac5..dcf29a2ff 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonRelation.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonRelation.scala
@@ -15,11 +15,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.spark.SparkTable
import org.apache.spark.internal.Logging
+import org.apache.spark.sql.catalyst.analysis.{EliminateSubqueryAliases, ResolvedTable}
import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonUpdateTable.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonUpdateTable.scala
similarity index 97%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonUpdateTable.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonUpdateTable.scala
index df4bcf59a..2ad965375 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonUpdateTable.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonUpdateTable.scala
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.CoreOptions
import org.apache.paimon.spark.commands.UpdatePaimonTableCommand
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/RowLevelHelper.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/RowLevelHelper.scala
similarity index 98%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/RowLevelHelper.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/RowLevelHelper.scala
index 2f5b6574c..522d67ccc 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/RowLevelHelper.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/RowLevelHelper.scala
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.CoreOptions.MERGE_ENGINE
import org.apache.paimon.options.Options
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/RowLevelOp.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/RowLevelOp.scala
similarity index 96%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/RowLevelOp.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/RowLevelOp.scala
index 0c5179b34..760ddfbe4 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/RowLevelOp.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/RowLevelOp.scala
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis
+package org.apache.paimon.spark.catalyst.analysis
import org.apache.paimon.CoreOptions.MergeEngine
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/expressions/ExpressionHelper.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/expressions/ExpressionHelper.scala
similarity index 98%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/expressions/ExpressionHelper.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/expressions/ExpressionHelper.scala
index ad02ffc03..aedd3ba7a 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/expressions/ExpressionHelper.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/expressions/ExpressionHelper.scala
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.analysis.expressions
+package org.apache.paimon.spark.catalyst.analysis.expressions
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.catalyst.expressions.{And, Attribute, Cast, Expression, GetStructField, Literal, PredicateHelper}
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallCommand.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonCallCommand.scala
similarity index 92%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallCommand.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonCallCommand.scala
index b0ece8f3f..6b1ce53f6 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallCommand.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonCallCommand.scala
@@ -15,11 +15,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.plans.logical
+package org.apache.paimon.spark.catalyst.plans.logical
import org.apache.paimon.spark.procedure.Procedure
import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference, Expression}
+import org.apache.spark.sql.catalyst.plans.logical.LeafCommand
import org.apache.spark.sql.catalyst.util.truncatedString
/** A CALL command that resolves stored procedure from SQL. */
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallStatement.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonCallStatement.scala
similarity index 91%
copy from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallStatement.scala
copy to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonCallStatement.scala
index 4a848d867..31b3e6777 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallStatement.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonCallStatement.scala
@@ -15,9 +15,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.plans.logical
+package org.apache.paimon.spark.catalyst.plans.logical
import org.apache.spark.sql.catalyst.expressions.Expression
+import org.apache.spark.sql.catalyst.plans.logical.LeafParsedStatement
/** A CALL statement parsed from SQL. */
case class PaimonCallStatement(name: Seq[String], args: Seq[PaimonCallArgument])
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonTableValuedFunctions.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonTableValuedFunctions.scala
similarity index 96%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonTableValuedFunctions.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonTableValuedFunctions.scala
index a751a2d0a..1d4e24249 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonTableValuedFunctions.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/plans/logical/PaimonTableValuedFunctions.scala
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.plans.logical
+package org.apache.paimon.spark.catalyst.plans.logical
import org.apache.paimon.CoreOptions
import org.apache.paimon.spark.SparkCatalog
@@ -26,6 +26,7 @@ import org.apache.spark.sql.catalyst.FunctionIdentifier
import org.apache.spark.sql.catalyst.analysis.FunctionRegistryBase
import org.apache.spark.sql.catalyst.analysis.TableFunctionRegistry.TableFunctionBuilder
import org.apache.spark.sql.catalyst.expressions.{Attribute, Expression, ExpressionInfo}
+import org.apache.spark.sql.catalyst.plans.logical.{LeafNode, LogicalPlan}
import org.apache.spark.sql.connector.catalog.Identifier
import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation
import org.apache.spark.sql.util.CaseInsensitiveStringMap
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/MergeIntoPaimonTable.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/MergeIntoPaimonTable.scala
index 7239baea2..95caadaa1 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/MergeIntoPaimonTable.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/MergeIntoPaimonTable.scala
@@ -19,6 +19,7 @@ package org.apache.paimon.spark.commands
import org.apache.paimon.options.Options
import org.apache.paimon.spark.{InsertInto, SparkTable}
+import org.apache.paimon.spark.catalyst.analysis.expressions.ExpressionHelper
import org.apache.paimon.spark.schema.SparkSystemColumns
import org.apache.paimon.spark.util.EncoderUtils
import org.apache.paimon.table.FileStoreTable
@@ -27,7 +28,6 @@ import org.apache.paimon.types.RowKind
import org.apache.spark.sql.{Column, Dataset, Row, SparkSession}
import org.apache.spark.sql.Utils._
import org.apache.spark.sql.catalyst.InternalRow
-import org.apache.spark.sql.catalyst.analysis.expressions.ExpressionHelper
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, BasePredicate, Expression, Literal, PredicateHelper, UnsafeProjection}
import org.apache.spark.sql.catalyst.expressions.Literal.TrueLiteral
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/UpdatePaimonTableCommand.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/UpdatePaimonTableCommand.scala
index bbf156cf2..1b7de80be 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/UpdatePaimonTableCommand.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/UpdatePaimonTableCommand.scala
@@ -19,13 +19,13 @@ package org.apache.paimon.spark.commands
import org.apache.paimon.options.Options
import org.apache.paimon.spark.{InsertInto, SparkTable}
+import org.apache.paimon.spark.catalyst.analysis.{AssignmentAlignmentHelper, PaimonRelation}
import org.apache.paimon.spark.schema.SparkSystemColumns.ROW_KIND_COL
import org.apache.paimon.table.FileStoreTable
import org.apache.paimon.types.RowKind
import org.apache.spark.sql.{Row, SparkSession}
import org.apache.spark.sql.Utils.createDataset
-import org.apache.spark.sql.catalyst.analysis.{AssignmentAlignmentHelper, PaimonRelation}
import org.apache.spark.sql.catalyst.expressions.Alias
import org.apache.spark.sql.catalyst.expressions.Literal.TrueLiteral
import org.apache.spark.sql.catalyst.plans.logical.{Filter, Project, UpdateTable}
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonCallExec.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/PaimonCallExec.scala
similarity index 97%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonCallExec.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/PaimonCallExec.scala
index d2bb302f5..0f1dd4eef 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonCallExec.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/PaimonCallExec.scala
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.execution
+package org.apache.paimon.spark.execution
import org.apache.paimon.spark.procedure.Procedure
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonStrategy.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/PaimonStrategy.scala
similarity index 90%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonStrategy.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/PaimonStrategy.scala
index 854957422..fcad9939b 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonStrategy.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/PaimonStrategy.scala
@@ -15,12 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.execution
+package org.apache.paimon.spark.execution
+
+import org.apache.paimon.spark.catalyst.plans.logical.PaimonCallCommand
import org.apache.spark.sql.{SparkSession, Strategy}
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.{Expression, GenericInternalRow, PredicateHelper}
-import org.apache.spark.sql.catalyst.plans.logical.{CreateTableAsSelect, LogicalPlan, PaimonCallCommand, TableSpec}
+import org.apache.spark.sql.catalyst.plans.logical.{CreateTableAsSelect, LogicalPlan}
+import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.execution.shim.PaimonCreateTableAsSelectStrategy
case class PaimonStrategy(spark: SparkSession) extends Strategy with PredicateHelper {
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/extensions/PaimonSparkSessionExtensions.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/extensions/PaimonSparkSessionExtensions.scala
index 4f76c4ae1..c4ec03ce5 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/extensions/PaimonSparkSessionExtensions.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/extensions/PaimonSparkSessionExtensions.scala
@@ -17,11 +17,12 @@
*/
package org.apache.paimon.spark.extensions
+import org.apache.paimon.spark.catalyst.analysis.{PaimonAnalysis, PaimonDeleteTable, PaimonMergeInto, PaimonPostHocResolutionRules, PaimonProcedureResolver, PaimonUpdateTable}
+import org.apache.paimon.spark.catalyst.plans.logical.PaimonTableValuedFunctions
+import org.apache.paimon.spark.execution.PaimonStrategy
+
import org.apache.spark.sql.SparkSessionExtensions
-import org.apache.spark.sql.catalyst.analysis.{PaimonAnalysis, PaimonCoerceArguments, PaimonDeleteTable, PaimonMergeInto, PaimonPostHocResolutionRules, PaimonProcedureResolver, PaimonUpdateTable}
import org.apache.spark.sql.catalyst.parser.extensions.PaimonSparkSqlExtensionsParser
-import org.apache.spark.sql.catalyst.plans.logical.PaimonTableValuedFunctions
-import org.apache.spark.sql.execution.PaimonStrategy
/** Spark session extension to extends the syntax and adds the rules. */
class PaimonSparkSessionExtensions extends (SparkSessionExtensions => Unit) {
@@ -33,7 +34,6 @@ class PaimonSparkSessionExtensions extends (SparkSessionExtensions => Unit) {
// analyzer extensions
extensions.injectResolutionRule(sparkSession => new PaimonAnalysis(sparkSession))
extensions.injectResolutionRule(spark => PaimonProcedureResolver(spark))
- extensions.injectResolutionRule(_ => PaimonCoerceArguments)
extensions.injectPostHocResolutionRule(spark => PaimonPostHocResolutionRules(spark))
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonCoerceArguments.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonCoerceArguments.scala
deleted file mode 100644
index ecc831dd8..000000000
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/analysis/PaimonCoerceArguments.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.catalyst.analysis
-
-import org.apache.spark.sql.AnalysisException
-import org.apache.spark.sql.catalyst.expressions.Cast
-import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, PaimonCallCommand}
-import org.apache.spark.sql.catalyst.rules.Rule
-
-/* This file is based on source code from the Iceberg Project (http://iceberg.apache.org/), licensed by the Apache
- * Software Foundation (ASF) under the Apache License, Version 2.0. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership. */
-
-/**
- * Coercion of procedure arguments rule.
- *
- * <p>Most of the content of this class is referenced from Iceberg's ProcedureArgumentCoercion.
- */
-object PaimonCoerceArguments extends Rule[LogicalPlan] {
-
- override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperators {
- case call @ PaimonCallCommand(procedure, arguments) if call.resolved =>
- val parameters = procedure.parameters
- val newArguments = arguments.zipWithIndex.map {
- case (argument, index) =>
- val parameter = parameters(index)
- val parameterType = parameter.dataType
- val argumentType = argument.dataType
- if (parameterType != argumentType && !Cast.canUpCast(argumentType, parameterType)) {
- throw new AnalysisException(
- s"Cannot cast $argumentType to $parameterType of ${parameter.name}.")
- }
- if (parameterType != argumentType) {
- Cast(argument, parameterType)
- } else {
- argument
- }
- }
-
- if (newArguments != arguments) {
- call.copy(args = newArguments)
- } else {
- call
- }
- }
-}
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/PaimonSqlExtensionsAstBuilder.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/PaimonSqlExtensionsAstBuilder.scala
index 51f12c644..8caab60c2 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/PaimonSqlExtensionsAstBuilder.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/PaimonSqlExtensionsAstBuilder.scala
@@ -17,6 +17,9 @@
*/
package org.apache.spark.sql.catalyst.parser.extensions
+import org.apache.paimon.spark.catalyst.plans.logical
+import org.apache.paimon.spark.catalyst.plans.logical.{PaimonCallArgument, PaimonCallStatement, PaimonNamedArgument, PaimonPositionalArgument}
+
import org.antlr.v4.runtime._
import org.antlr.v4.runtime.misc.Interval
import org.antlr.v4.runtime.tree.{ParseTree, TerminalNode}
@@ -56,7 +59,7 @@ class PaimonSqlExtensionsAstBuilder(delegate: ParserInterface)
override def visitCall(ctx: CallContext): PaimonCallStatement = withOrigin(ctx) {
val name = toSeq(ctx.multipartIdentifier.parts).map(_.getText)
val args = toSeq(ctx.callArgument).map(typedVisit[PaimonCallArgument])
- PaimonCallStatement(name, args)
+ logical.PaimonCallStatement(name, args)
}
/** Creates a positional argument in a stored procedure call. */
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallStatement.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/connector/catalog/PaimonLookupCatalog.scala
similarity index 56%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallStatement.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/connector/catalog/PaimonLookupCatalog.scala
index 4a848d867..a614c2009 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/PaimonCallStatement.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/connector/catalog/PaimonLookupCatalog.scala
@@ -15,22 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.spark.sql.catalyst.plans.logical
+package org.apache.spark.sql.connector.catalog
-import org.apache.spark.sql.catalyst.expressions.Expression
-
-/** A CALL statement parsed from SQL. */
-case class PaimonCallStatement(name: Seq[String], args: Seq[PaimonCallArgument])
- extends LeafParsedStatement
-
-/** An argument of a CALL statement. */
-sealed trait PaimonCallArgument {
-
- def expr: Expression
-}
-
-/** An argument identified by name. */
-case class PaimonNamedArgument(name: String, expr: Expression) extends PaimonCallArgument
-
-/** An argument identified by position. */
-case class PaimonPositionalArgument(expr: Expression) extends PaimonCallArgument
+trait PaimonLookupCatalog extends LookupCatalog
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/StrategyHelper.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonStrategyHelper.scala
similarity index 98%
rename from paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/StrategyHelper.scala
rename to paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonStrategyHelper.scala
index 11f2b261f..d1c2de667 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/StrategyHelper.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/PaimonStrategyHelper.scala
@@ -22,7 +22,7 @@ import org.apache.spark.sql.catalyst.catalog.CatalogUtils
import org.apache.spark.sql.catalyst.plans.logical.TableSpec
import org.apache.spark.sql.internal.StaticSQLConf.WAREHOUSE_PATH
-trait StrategyHelper {
+trait PaimonStrategyHelper {
def spark: SparkSession
diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala
index 1457d39b9..3ee9f6819 100644
--- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala
+++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/spark/sql/execution/shim/PaimonCreateTableAsSelectStrategy.scala
@@ -24,14 +24,14 @@ import org.apache.spark.sql.{SparkSession, Strategy}
import org.apache.spark.sql.catalyst.analysis.ResolvedIdentifier
import org.apache.spark.sql.catalyst.plans.logical.{CreateTableAsSelect, LogicalPlan, TableSpec}
import org.apache.spark.sql.connector.catalog.StagingTableCatalog
-import org.apache.spark.sql.execution.{SparkPlan, StrategyHelper}
+import org.apache.spark.sql.execution.{PaimonStrategyHelper, SparkPlan}
import org.apache.spark.sql.execution.datasources.v2.CreateTableAsSelectExec
import scala.collection.JavaConverters._
case class PaimonCreateTableAsSelectStrategy(spark: SparkSession)
extends Strategy
- with StrategyHelper {
+ with PaimonStrategyHelper {
import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
diff --git a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java
index 7858fcb97..85d83892e 100644
--- a/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java
+++ b/paimon-spark/paimon-spark-common/src/test/java/org/apache/paimon/spark/extensions/CallStatementParserTest.java
@@ -18,15 +18,16 @@
package org.apache.paimon.spark.extensions;
+import org.apache.paimon.spark.catalyst.plans.logical.PaimonCallArgument;
+import org.apache.paimon.spark.catalyst.plans.logical.PaimonCallStatement;
+import org.apache.paimon.spark.catalyst.plans.logical.PaimonNamedArgument;
+import org.apache.paimon.spark.catalyst.plans.logical.PaimonPositionalArgument;
+
import org.apache.spark.sql.SparkSession;
import org.apache.spark.sql.catalyst.expressions.Literal$;
import org.apache.spark.sql.catalyst.parser.ParseException;
import org.apache.spark.sql.catalyst.parser.ParserInterface;
import org.apache.spark.sql.catalyst.parser.extensions.PaimonParseException;
-import org.apache.spark.sql.catalyst.plans.logical.PaimonCallArgument;
-import org.apache.spark.sql.catalyst.plans.logical.PaimonCallStatement;
-import org.apache.spark.sql.catalyst.plans.logical.PaimonNamedArgument;
-import org.apache.spark.sql.catalyst.plans.logical.PaimonPositionalArgument;
import org.apache.spark.sql.types.DataType;
import org.apache.spark.sql.types.DataTypes;
import org.junit.jupiter.api.AfterEach;
diff --git a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/DeleteFromTableTest.scala b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/DeleteFromTableTest.scala
index e121027b2..fed222aea 100644
--- a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/DeleteFromTableTest.scala
+++ b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/DeleteFromTableTest.scala
@@ -19,8 +19,8 @@ package org.apache.paimon.spark.sql
import org.apache.paimon.CoreOptions
import org.apache.paimon.spark.PaimonSparkTestBase
+import org.apache.paimon.spark.catalyst.analysis.Delete
-import org.apache.spark.sql.catalyst.analysis.Delete
import org.assertj.core.api.Assertions.{assertThat, assertThatThrownBy}
class DeleteFromTableTest extends PaimonSparkTestBase {
diff --git a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/UpdateTableTest.scala b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/UpdateTableTest.scala
index 4ced313ff..0c4986aa5 100644
--- a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/UpdateTableTest.scala
+++ b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/UpdateTableTest.scala
@@ -19,8 +19,8 @@ package org.apache.paimon.spark.sql
import org.apache.paimon.CoreOptions
import org.apache.paimon.spark.PaimonSparkTestBase
+import org.apache.paimon.spark.catalyst.analysis.Update
-import org.apache.spark.sql.catalyst.analysis.Update
import org.assertj.core.api.Assertions.{assertThat, assertThatThrownBy}
class UpdateTableTest extends PaimonSparkTestBase {