flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] KurtYoung commented on a change in pull request #9909: [FLINK-14381][table] Partition field names should be got from CatalogTable instead of source/sink
Date Fri, 25 Oct 2019 08:41:20 GMT
KurtYoung 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_r338942526
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRule.scala
 ##########
 @@ -62,85 +61,84 @@ class PushPartitionIntoTableSourceScanRule extends RelOptRule(
     val filter: Filter = call.rel(0)
     val scan: LogicalTableScan = call.rel(1)
     val table: FlinkRelOptTable = scan.getTable.asInstanceOf[FlinkRelOptTable]
-    pushPartitionIntoScan(call, filter, scan, table)
-  }
 
-  private def pushPartitionIntoScan(
-      call: RelOptRuleCall,
-      filter: Filter,
-      scan: LogicalTableScan,
-      relOptTable: FlinkRelOptTable): Unit = {
-
-    val tableSourceTable = relOptTable.unwrap(classOf[TableSourceTable[_]])
-    val tableSource = tableSourceTable.tableSource.asInstanceOf[PartitionableTableSource]
-    val partitionFieldNames = tableSource.getPartitionFieldNames.toList.toArray
-    val inputFieldType = filter.getInput.getRowType
-
-    val relBuilder = call.builder()
-    val maxCnfNodeCount = FlinkRelOptUtil.getMaxCnfNodeCount(scan)
-    val (partitionPredicate, nonPartitionPredicate) =
-      RexNodeExtractor.extractPartitionPredicates(
-        filter.getCondition,
-        maxCnfNodeCount,
+    val tableSourceTable = table.unwrap(classOf[TableSourceTable[_]])
+
+    val partitionFieldNames = tableSourceTable.catalogTable.getPartitionKeys.toSeq.toArray[String]
+
+    if (!partitionFieldNames.isEmpty) {
 
 Review comment:
   I think we don't need this, and it's a really big `if` statement.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message