JingsongLi commented on code in PR #1454:
URL: https://github.com/apache/incubator-paimon/pull/1454#discussion_r1251530233


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/PaimonCommand.scala:
##########
@@ -35,9 +35,19 @@ trait PaimonCommand {
 
   def getTable: Table
 
+  val bucketMode: BucketMode = getTable match {
+    case fileStoreTable: FileStoreTable =>
+      fileStoreTable.bucketMode
+    case _ =>
+      BucketMode.FIXED
+  }
+
   def isDynamicBucketTable: Boolean = {

Review Comment:
   remove this, use scala swith



##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/PaimonCommand.scala:
##########
@@ -35,9 +35,19 @@ trait PaimonCommand {
 
   def getTable: Table
 
+  val bucketMode: BucketMode = getTable match {
+    case fileStoreTable: FileStoreTable =>
+      fileStoreTable.bucketMode
+    case _ =>
+      BucketMode.FIXED
+  }
+
   def isDynamicBucketTable: Boolean = {
-    getTable.isInstanceOf[FileStoreTable] &&
-    getTable.asInstanceOf[FileStoreTable].bucketMode == BucketMode.DYNAMIC
+    bucketMode == BucketMode.DYNAMIC
+  }
+
+  def isUnawareBucketTable: Boolean = {

Review Comment:
   remove this, use scala swith



##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/commands/WriteIntoPaimonTable.scala:
##########
@@ -93,29 +93,33 @@ case class WriteIntoPaimonTable(_table: FileStoreTable, 
saveMode: SaveMode, data
       
withBucketCol.mapPartitions(commonBucketProcessor.processPartition)(withBucketDataEncoder)
     }
 
-    val commitMessages =

Review Comment:
   unaware bucket dose not need to assign bucket too.



-- 
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]

Reply via email to