docete 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_r336421342
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/sinks/TableSinkUtils.scala
##########
@@ -80,23 +81,12 @@ object TableSinkUtils {
"field names via 'getPartitionFieldNames()' method."
sink match {
case pts: PartitionableTableSink =>
- val partitionFields = pts.getPartitionFieldNames
- if (partitionFields == null || partitionFields.isEmpty) {
- throw new ValidationException(invalidMsg)
- }
staticPartitions.map(_._1) foreach { p =>
- if (!partitionFields.contains(p)) {
+ if (!partitionKeys.contains(p)) {
throw new ValidationException(s"Static partition column $p " +
- s"should be in the partition fields list $partitionFields.")
+ s"should be in the partition fields list $partitionKeys.")
}
}
- staticPartitions.map(_._1).zip(partitionFields).foreach {
Review comment:
Why you remove this validation? Does static partitions not appear before
dynamic partitions any more?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services