Copilot commented on code in PR #6497:
URL: https://github.com/apache/paimon/pull/6497#discussion_r2480076288


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/format/PaimonFormatTable.scala:
##########
@@ -53,11 +52,16 @@ case class PaimonFormatTable(table: FormatTable)
 
   override def properties: util.Map[String, String] = {
     val properties = new util.HashMap[String, String](table.options())
+    val options = new CoreOptions(table.options())

Review Comment:
   Unused variable `options`. This CoreOptions instance is created but never 
used in the method. Consider removing this line to avoid unnecessary object 
creation.
   ```suggestion
       // Removed unused variable 'options'
   ```



##########
paimon-core/src/main/java/org/apache/paimon/table/format/FormatBatchWriteBuilder.java:
##########
@@ -71,11 +73,13 @@ public BatchTableWrite newWrite() {
 
     @Override
     public BatchTableCommit newCommit() {
-        throw new UnsupportedOperationException("FormatTable does not support 
commit");
+        return table.newCommit(overwrite, staticPartition);

Review Comment:
   Potential NullPointerException when `staticPartition` is null. The 
`newCommit` method expects a non-null Map parameter, but `staticPartition` is 
initialized to null and may not be set if `withOverwrite()` is called without 
arguments. Consider initializing `staticPartition` to `Collections.emptyMap()` 
or `new HashMap<>()` instead of null.



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