JingsongLi commented on a change in pull request #9909: [FLINK-14381][table] 
Partition field names should be got from CatalogTable instead of source/sink
URL: https://github.com/apache/flink/pull/9909#discussion_r338958652
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/delegation/PlannerBase.scala
 ##########
 @@ -175,12 +175,10 @@ abstract class PlannerBase(
       case catalogSink: CatalogSinkModifyOperation =>
         val input = 
getRelBuilder.queryOperation(modifyOperation.getChild).build()
         val identifier = 
catalogManager.qualifyIdentifier(catalogSink.getTablePath: _*)
-        getTableSink(identifier).map(sink => {
-          TableSinkUtils.validateSink(catalogSink, identifier, sink)
+        getTableSink(identifier).map { case (table, sink) =>
+          TableSinkUtils.validateSink(catalogSink, identifier, sink, 
table.getPartitionKeys)
           sink match {
-            case partitionableSink: PartitionableTableSink
-              if partitionableSink.getPartitionFieldNames != null
-                && partitionableSink.getPartitionFieldNames.nonEmpty =>
+            case partitionableSink: PartitionableTableSink =>
               
partitionableSink.setStaticPartition(catalogSink.getStaticPartitions)
 
 Review comment:
   Maybe just for the test in 
`PartitionableSinkITCase.testInsertWithStaticPartitions`, it get 
`staticPartitions` from the origin `Sink`, if in `ExecSinkRule`, it will be 
another copied sink.
   I think we can modify this in https://github.com/apache/flink/pull/9796

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to