You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/04 15:28:36 UTC

[GitHub] [flink] wuchong opened a new pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

wuchong opened a new pull request #11985:
URL: https://github.com/apache/flink/pull/11985


   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Travis CI to do that following [this guide](https://flink.apache.org/contributing/contribute-code.html#open-a-pull-request).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   Support the `ScanTableSource` interface in planner. We don't support change mode `[I, UA, D]` (`UPDATE_AFTER` without `UPDATE_BEFORE`) in first version. May support it in the future. 
   
   ## Brief change log
   
   - The first 3 commits are from #11959, so this pull request depends on #11959.
   - We rename the existing `TableSourceTable` into `LegacyTableSourceTable` and `TableSourceScan` into `LegacyTableSourceScan`, and use `TableSourceTable` and `TableSourceScan` for the new `DynamicTableSource`.
     - We don't want to use `LogicalDynamicTableSourceScan` because the `Dynamic` is verbose and misleading. 
     - Besides, `LegacyTableSourceScan` will be dropped in the near future, we can easily remove all `Legacy` classes at that time. 
   - Implements logical node and physical nodes for `ScanTableSource` and integrate with changelog program.
   
   ## Verifying this change
   
   - Introudce a `TestValuesTableFactory` for testing
   - Use the `values` source in `TableScanTest` and add validation tests in it. 
   - Add `DynamicTableSourceITCase` for integration tests 
   - Add `testChangelog` and `testAggregateOnChangelogSource` for integration tests for changelog source.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: yes
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): yes
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented? not applicable 
   


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807",
       "triggerID" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "triggerType" : "PUSH"
     }, {
       "hash" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 44a5d8792e56e1e0676c76ff270720caf36558c1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807) 
   * 8808e39c0d3cb29cc88fd23ede27820e427e6a75 UNKNOWN
   * 85affedaf4bd2005f910870613a20387fb3a527e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6dd7e458809c5c43ce9e51f4381af0b84440526d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660) 
   * 5cebd993df368d4065154858dae34ea2d6e41727 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * de26ba11042772d77be2416fd6c829d80c9c66b7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568) 
   * 945427a9cf24c43097883cc9fccbac2983ab8bac UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * de26ba11042772d77be2416fd6c829d80c9c66b7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568) 
   * 945427a9cf24c43097883cc9fccbac2983ab8bac Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] danny0405 commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421997440



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/FlinkCalciteCatalogReader.java
##########
@@ -188,11 +192,46 @@ private static FlinkPreparingTableBase convertCatalogTable(
 			RelDataType rowType,
 			CatalogTable catalogTable,
 			CatalogSchemaTable schemaTable) {
-		return new CatalogSourceTable<>(
-			relOptSchema,
-			names,
-			rowType,
-			schemaTable,
-			catalogTable);
+		if (isLegacyConnectorOptions(catalogTable, schemaTable)) {
+			return new LegacyCatalogSourceTable<>(
+				relOptSchema,
+				names,
+				rowType,
+				schemaTable,
+				catalogTable);
+		} else {
+			return new CatalogSourceTable<>(
+				relOptSchema,
+				names,
+				rowType,
+				schemaTable,
+				catalogTable);
+		}
+	}
+
+	/**
+	 * Checks whether the {@link CatalogTable} uses legacy connector options.
+	 */
+	private static boolean isLegacyConnectorOptions(
+			CatalogTable catalogTable,
+			CatalogSchemaTable schemaTable) {
+		if (catalogTable.getOptions().containsKey(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+			return true;

Review comment:
       I think we should consider the case sensitivity here.

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +251,113 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  /**
+   * Infers whether the current options is using legacy [[TableSource]].
+   */
+  private def isLegacyOptions(
+      hintedOptions: JMap[String, String],
+      conf: ReadableConfig): Boolean = {
+    val newCatalogTable = createCatalogTableWithHints(hintedOptions)
+    if (newCatalogTable.getOptions.contains(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+      true
+    } else {
+      // try to create legacy table source using the options,
+      // some legacy factories uses the new 'connector' key
+      try {
+        findAndCreateLegacyTableSource(hintedOptions, conf)
+        // success, then we will use the legacy factories
+        true
+      } catch {
+        case _: Throwable =>
+          // can't create, then we will use new factories
+          false
+      }
+    }
+  }
+
+  private def validateTableSource(tableSource: DynamicTableSource): Unit = {
+    // validation
+    val unsupportedAbilities = List(
+      classOf[SupportsProjectionPushDown],
+      classOf[SupportsFilterPushDown],
+      classOf[SupportsLimitPushDown],
+      classOf[SupportsPartitionPushDown],
+      classOf[SupportsComputedColumnPushDown],
+      classOf[SupportsWatermarkPushDown]
+    )
+    val tableName = schemaTable.getTableIdentifier.asSummaryString
+    tableSource match {
+      case ts: ScanTableSource =>
+        val changelogMode = ts.getChangelogMode
+        if (!schemaTable.isStreamingMode) {
+          // batch only supports bounded source
+          val provider = ts.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE)
+          if (!provider.isBounded) {
+            throw new ValidationException("Cannot query on an unbounded source in batch mode, " +
+              s"but '$tableName' is unbounded.")
+          }
+          // batch only supports INSERT only source
+          if (!changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, batch mode only supports INSERT only source, but " +
+              s"'$tableName' source produces not INSERT only messages")
+          }
+        } else {
+          // sanity check for produced ChangelogMode
+          val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+          val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+          (hasUpdateBefore, hasUpdateAfter) match {
+            case (true, true) =>
+              // UPDATE_BEFORE and UPDATE_AFTER, pass
+            case (false, true) =>
+              // only UPDATE_AFTER
+              throw new UnsupportedOperationException(
+                "Currently, ScanTableSource doesn't support producing ChangelogMode " +
+                  "which contains UPDATE_AFTER but no UPDATE_BEFORE. Please adapt the " +
+                  s"implementation of '${ts.asSummaryString()}' source.")
+            case (true, false) =>
+               // only UPDATE_BEFORE
+              throw new ValidationException(
+                s"'$tableName' source produces ChangelogMode which " +
+                  s"contains UPDATE_BEFORE but doesn't contain UPDATE_AFTER, this is invalid.")
+            case _ =>
+              // no updates, pass
+          }
+
+          // watermark defined on a changelog source is not supported
+          if (!catalogTable.getSchema.getWatermarkSpecs.isEmpty &&
+              !changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, defining WATERMARK on a changelog source is not supported.")
+          }
+        }
+      case _ =>
+        unsupportedAbilities.foreach { ability =>
+          if (tableSource.getClass.isAssignableFrom(ability)) {

Review comment:
       Did i miss something, the `ScanTableSource` code would never go here. So the check never triggers.




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 420704211108d661a5d9959e571ce98460ae1897 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 945427a9cf24c43097883cc9fccbac2983ab8bac Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587) 
   * 420704211108d661a5d9959e571ce98460ae1897 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6dd7e458809c5c43ce9e51f4381af0b84440526d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660) 
   * 5cebd993df368d4065154858dae34ea2d6e41727 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-625654598


   Hi @danny0405 , thanks for reviewing. I have addressed the comments. Some major changes:
   
   1. I updated `TimeAttributeITCase` to use the new factories as sources which covers watermark and computed column.
   2. Keep the implementation of the original `CatalogSourceTable` and rename to `LegacyCatalogSourceTable`.
   3. Rename test classes `DynamicTableSourceITCase` to `ScanTableSourceITCase`.


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 420704211108d661a5d9959e571ce98460ae1897 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624) 
   * 6dd7e458809c5c43ce9e51f4381af0b84440526d UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] danny0405 commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r422006300



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/FlinkCalciteCatalogReader.java
##########
@@ -188,11 +192,46 @@ private static FlinkPreparingTableBase convertCatalogTable(
 			RelDataType rowType,
 			CatalogTable catalogTable,
 			CatalogSchemaTable schemaTable) {
-		return new CatalogSourceTable<>(
-			relOptSchema,
-			names,
-			rowType,
-			schemaTable,
-			catalogTable);
+		if (isLegacyConnectorOptions(catalogTable, schemaTable)) {
+			return new LegacyCatalogSourceTable<>(
+				relOptSchema,
+				names,
+				rowType,
+				schemaTable,
+				catalogTable);
+		} else {
+			return new CatalogSourceTable<>(
+				relOptSchema,
+				names,
+				rowType,
+				schemaTable,
+				catalogTable);
+		}
+	}
+
+	/**
+	 * Checks whether the {@link CatalogTable} uses legacy connector options.
+	 */
+	private static boolean isLegacyConnectorOptions(
+			CatalogTable catalogTable,
+			CatalogSchemaTable schemaTable) {
+		if (catalogTable.getOptions().containsKey(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+			return true;

Review comment:
       Because `catalogTable.getOptions()` returns the original key.




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807",
       "triggerID" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 44a5d8792e56e1e0676c76ff270720caf36558c1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807) 
   * 8808e39c0d3cb29cc88fd23ede27820e427e6a75 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 945427a9cf24c43097883cc9fccbac2983ab8bac Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-625842475


   Azure build is passed in my private pipeline: https://dev.azure.com/imjark/Flink/_build/results?buildId=58&view=results
   
   Merging...


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * be8f4d8caa346a125f6c75e241370e449040ffe9 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795) 
   * 44a5d8792e56e1e0676c76ff270720caf36558c1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8f0b6b9413eb41350d6455527715cddedf4eea00 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421916467



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/DynamicTableSourceITCase.scala
##########
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.runtime.batch.sql
+
+import org.apache.flink.table.planner.factories.TestValuesTableFactory
+import org.apache.flink.table.planner.runtime.utils.BatchTestBase.row
+import org.apache.flink.table.planner.runtime.utils.{BatchTestBase, TestData}
+import org.apache.flink.table.planner.utils._
+import org.apache.flink.types.Row
+
+import org.junit.{Before, Test}
+
+import java.lang.{Boolean => JBool, Integer => JInt, Long => JLong}
+
+class DynamicTableSourceITCase extends BatchTestBase {
+
+  @Before
+  override def before(): Unit = {
+    super.before()
+    env.setParallelism(1) // set sink parallelism to 1
+    val myTableDataId = TestValuesTableFactory.registerData(TestData.smallData3)
+    tEnv.executeSql(
+      s"""
+        |CREATE TABLE MyTable (
+        |  `a` INT,
+        |  `b` BIGINT,
+        |  `c` STRING
+        |) WITH (
+        |  'connector' = 'values',
+        |  'data-id' = '$myTableDataId',
+        |  'bounded' = 'true'
+        |)
+        |""".stripMargin)
+
+    val filterableTableDataId = TestValuesTableFactory.registerData(
+      TestFilterableTableSource.defaultRows)
+    // TODO: [FLINK-17425] support filter pushdown for TestValuesTableSource
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE FilterableTable (
+         |  name STRING,
+         |  id BIGINT,
+         |  amount INT,
+         |  price DOUBLE
+         |) WITH (
+         |  'connector' = 'values',
+         |  'data-id' = '$filterableTableDataId',
+         |  'bounded' = 'true'
+         |)
+         |""".stripMargin)
+  }
+
+  @Test
+  def testSimpleProject(): Unit = {
+    checkResult(
+      "SELECT a, c FROM MyTable",
+      Seq(
+        row(1, "Hi"),
+        row(2, "Hello"),
+        row(3, "Hello world"))
+    )
+  }
+
+  @Test
+  def testProjectWithoutInputRef(): Unit = {
+    checkResult(
+      "SELECT COUNT(*) FROM MyTable",
+      Seq(row(3))
+    )
+  }
+
+  @Test
+  def testNestedProject(): Unit = {
+    val data = Seq(
+      Row.of(new JLong(1),
+        Row.of(
+          Row.of("Sarah", new JInt(100)),
+          Row.of(new JInt(1000), new JBool(true))
+        ),
+        Row.of("Peter", new JInt(10000)),
+        "Mary"),
+      Row.of(new JLong(2),
+        Row.of(
+          Row.of("Rob", new JInt(200)),
+          Row.of(new JInt(2000), new JBool(false))
+        ),
+        Row.of("Lucy", new JInt(20000)),
+        "Bob"),
+      Row.of(new JLong(3),
+        Row.of(
+          Row.of("Mike", new JInt(300)),
+          Row.of(new JInt(3000), new JBool(true))
+        ),
+        Row.of("Betty", new JInt(30000)),
+        "Liz"))
+
+    val dataId = TestValuesTableFactory.registerData(data)
+
+    // TODO: [FLINK-17428] support nested project for TestValuesTableSource
+    val ddl =

Review comment:
       Sure.




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * de26ba11042772d77be2416fd6c829d80c9c66b7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8f0b6b9413eb41350d6455527715cddedf4eea00 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771) 
   * be8f4d8caa346a125f6c75e241370e449040ffe9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6dd7e458809c5c43ce9e51f4381af0b84440526d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807",
       "triggerID" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * be8f4d8caa346a125f6c75e241370e449040ffe9 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795) 
   * 44a5d8792e56e1e0676c76ff270720caf36558c1 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807) 
   * 8808e39c0d3cb29cc88fd23ede27820e427e6a75 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807",
       "triggerID" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "triggerType" : "PUSH"
     }, {
       "hash" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=813",
       "triggerID" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "361ae00a1fe74959062e48c7e659605eea0295ef",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "361ae00a1fe74959062e48c7e659605eea0295ef",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8808e39c0d3cb29cc88fd23ede27820e427e6a75 UNKNOWN
   * 85affedaf4bd2005f910870613a20387fb3a527e Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=813) 
   * 361ae00a1fe74959062e48c7e659605eea0295ef UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-625852185


   The just merged #11905 conflicts with this PR. Wait another round of build...


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



[GitHub] [flink] danny0405 commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421915899



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/DynamicTableSourceITCase.scala
##########
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.runtime.batch.sql
+
+import org.apache.flink.table.planner.factories.TestValuesTableFactory
+import org.apache.flink.table.planner.runtime.utils.BatchTestBase.row
+import org.apache.flink.table.planner.runtime.utils.{BatchTestBase, TestData}
+import org.apache.flink.table.planner.utils._
+import org.apache.flink.types.Row
+
+import org.junit.{Before, Test}
+
+import java.lang.{Boolean => JBool, Integer => JInt, Long => JLong}
+
+class DynamicTableSourceITCase extends BatchTestBase {
+
+  @Before
+  override def before(): Unit = {
+    super.before()
+    env.setParallelism(1) // set sink parallelism to 1
+    val myTableDataId = TestValuesTableFactory.registerData(TestData.smallData3)
+    tEnv.executeSql(
+      s"""
+        |CREATE TABLE MyTable (
+        |  `a` INT,
+        |  `b` BIGINT,
+        |  `c` STRING
+        |) WITH (
+        |  'connector' = 'values',
+        |  'data-id' = '$myTableDataId',
+        |  'bounded' = 'true'
+        |)
+        |""".stripMargin)
+
+    val filterableTableDataId = TestValuesTableFactory.registerData(
+      TestFilterableTableSource.defaultRows)
+    // TODO: [FLINK-17425] support filter pushdown for TestValuesTableSource
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE FilterableTable (
+         |  name STRING,
+         |  id BIGINT,
+         |  amount INT,
+         |  price DOUBLE
+         |) WITH (
+         |  'connector' = 'values',
+         |  'data-id' = '$filterableTableDataId',
+         |  'bounded' = 'true'
+         |)
+         |""".stripMargin)
+  }
+
+  @Test
+  def testSimpleProject(): Unit = {
+    checkResult(
+      "SELECT a, c FROM MyTable",
+      Seq(
+        row(1, "Hi"),
+        row(2, "Hello"),
+        row(3, "Hello world"))
+    )
+  }
+
+  @Test
+  def testProjectWithoutInputRef(): Unit = {
+    checkResult(
+      "SELECT COUNT(*) FROM MyTable",
+      Seq(row(3))
+    )
+  }
+
+  @Test
+  def testNestedProject(): Unit = {
+    val data = Seq(
+      Row.of(new JLong(1),
+        Row.of(
+          Row.of("Sarah", new JInt(100)),
+          Row.of(new JInt(1000), new JBool(true))
+        ),
+        Row.of("Peter", new JInt(10000)),
+        "Mary"),
+      Row.of(new JLong(2),
+        Row.of(
+          Row.of("Rob", new JInt(200)),
+          Row.of(new JInt(2000), new JBool(false))
+        ),
+        Row.of("Lucy", new JInt(20000)),
+        "Bob"),
+      Row.of(new JLong(3),
+        Row.of(
+          Row.of("Mike", new JInt(300)),
+          Row.of(new JInt(3000), new JBool(true))
+        ),
+        Row.of("Betty", new JInt(30000)),
+        "Liz"))
+
+    val dataId = TestValuesTableFactory.registerData(data)
+
+    // TODO: [FLINK-17428] support nested project for TestValuesTableSource
+    val ddl =

Review comment:
       Also add tests for computed column and watermark definition ?




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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421914078



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/trait/UpdateKindTrait.scala
##########
@@ -95,4 +98,17 @@ object UpdateKindTrait {
     }
     new UpdateKindTrait(updateKind)
   }
+
+  /**
+   * Creates an instance of [[UpdateKindTrait]] from the given [[ChangelogMode]].
+   */
+  def fromChangelogMode(changelogMode: ChangelogMode): UpdateKindTrait = {
+    val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+    val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+    (hasUpdateBefore, hasUpdateAfter) match {
+      case (true, true) => BEFORE_AND_AFTER
+      case (false, true) => ONLY_UPDATE_AFTER
+      case _ => NONE
+    }

Review comment:
       OK. I will throw exception for `true, false`, but keep `NONE` for `false, false`. 




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8f0b6b9413eb41350d6455527715cddedf4eea00 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771) 
   * be8f4d8caa346a125f6c75e241370e449040ffe9 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r422013806



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +251,113 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  /**
+   * Infers whether the current options is using legacy [[TableSource]].
+   */
+  private def isLegacyOptions(
+      hintedOptions: JMap[String, String],
+      conf: ReadableConfig): Boolean = {
+    val newCatalogTable = createCatalogTableWithHints(hintedOptions)
+    if (newCatalogTable.getOptions.contains(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+      true
+    } else {
+      // try to create legacy table source using the options,
+      // some legacy factories uses the new 'connector' key
+      try {
+        findAndCreateLegacyTableSource(hintedOptions, conf)
+        // success, then we will use the legacy factories
+        true
+      } catch {
+        case _: Throwable =>
+          // can't create, then we will use new factories
+          false
+      }
+    }
+  }
+
+  private def validateTableSource(tableSource: DynamicTableSource): Unit = {
+    // validation
+    val unsupportedAbilities = List(
+      classOf[SupportsProjectionPushDown],
+      classOf[SupportsFilterPushDown],
+      classOf[SupportsLimitPushDown],
+      classOf[SupportsPartitionPushDown],
+      classOf[SupportsComputedColumnPushDown],
+      classOf[SupportsWatermarkPushDown]
+    )
+    val tableName = schemaTable.getTableIdentifier.asSummaryString
+    tableSource match {
+      case ts: ScanTableSource =>
+        val changelogMode = ts.getChangelogMode
+        if (!schemaTable.isStreamingMode) {
+          // batch only supports bounded source
+          val provider = ts.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE)
+          if (!provider.isBounded) {
+            throw new ValidationException("Cannot query on an unbounded source in batch mode, " +
+              s"but '$tableName' is unbounded.")
+          }
+          // batch only supports INSERT only source
+          if (!changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, batch mode only supports INSERT only source, but " +
+              s"'$tableName' source produces not INSERT only messages")
+          }
+        } else {
+          // sanity check for produced ChangelogMode
+          val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+          val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+          (hasUpdateBefore, hasUpdateAfter) match {
+            case (true, true) =>
+              // UPDATE_BEFORE and UPDATE_AFTER, pass
+            case (false, true) =>
+              // only UPDATE_AFTER
+              throw new UnsupportedOperationException(
+                "Currently, ScanTableSource doesn't support producing ChangelogMode " +
+                  "which contains UPDATE_AFTER but no UPDATE_BEFORE. Please adapt the " +
+                  s"implementation of '${ts.asSummaryString()}' source.")
+            case (true, false) =>
+               // only UPDATE_BEFORE
+              throw new ValidationException(
+                s"'$tableName' source produces ChangelogMode which " +
+                  s"contains UPDATE_BEFORE but doesn't contain UPDATE_AFTER, this is invalid.")
+            case _ =>
+              // no updates, pass
+          }
+
+          // watermark defined on a changelog source is not supported
+          if (!catalogTable.getSchema.getWatermarkSpecs.isEmpty &&
+              !changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, defining WATERMARK on a changelog source is not supported.")
+          }
+        }
+      case _ =>
+        unsupportedAbilities.foreach { ability =>
+          if (tableSource.getClass.isAssignableFrom(ability)) {

Review comment:
       I moved this validation to the beginning of this method. And added a test for it. 




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



[GitHub] [flink] danny0405 commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421898493



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/logical/FlinkLogicalTableSourceScan.scala
##########
@@ -76,7 +73,7 @@ class FlinkLogicalTableSourceScan(
 
   override def explainTerms(pw: RelWriter): RelWriter = {
     super.explainTerms(pw)
-      .item("fields", tableSource.getTableSchema.getFieldNames.mkString(", "))
+      .item("fields", getRowType.getFieldNames.mkString(", "))
   }

Review comment:
       Is this because we have new way to support fields push down ?

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamExecTableSourceScan.scala
##########
@@ -92,177 +73,21 @@ class StreamExecTableSourceScan(
     replaceInput(ordinalInParent, newInputNode.asInstanceOf[RelNode])
   }
 
-  override protected def translateToPlanInternal(
-      planner: StreamPlanner): Transformation[RowData] = {
-    val config = planner.getTableConfig
-    val inputTransform = getSourceTransformation(planner.getExecEnv)
-
-    val fieldIndexes = computeIndexMapping()
-
-    val inputDataType = inputTransform.getOutputType
-    val producedDataType = tableSource.getProducedDataType
-
-    // check that declared and actual type of table source DataStream are identical
-    if (inputDataType !=
-        TypeInfoDataTypeConverter.fromDataTypeToTypeInfo(producedDataType)) {
-      throw new TableException(s"TableSource of type ${tableSource.getClass.getCanonicalName} " +
-        s"returned a DataStream of data type $inputDataType that does not match with the " +
-        s"data type $producedDataType declared by the TableSource.getProducedDataType() method. " +
-        s"Please validate the implementation of the TableSource.")
-    }
-
-    // get expression to extract rowtime attribute
-    val rowtimeExpression: Option[RexNode] = TableSourceUtil.getRowtimeAttributeDescriptor(
-      tableSource,
-      tableSourceTable.getRowType
-    ).map(desc =>
-      TableSourceUtil.getRowtimeExtractionExpression(
-        desc.getTimestampExtractor,
-        producedDataType,
-        planner.getRelBuilder,
-        nameMapping
-      )
-    )
-
-    val streamTransformation = if (needInternalConversion) {
-      // extract time if the index is -1 or -2.
-      val (extractElement, resetElement) =
-        if (ScanUtil.hasTimeAttributeField(fieldIndexes)) {
-          (s"ctx.$ELEMENT = $ELEMENT;", s"ctx.$ELEMENT = null;")
-        } else {
-          ("", "")
-        }
-      val ctx = CodeGeneratorContext(config).setOperatorBaseClass(
-        classOf[AbstractProcessStreamOperator[RowData]])
-      // the produced type may not carry the correct precision user defined in DDL, because
-      // it may be converted from legacy type. Fix precision using logical schema from DDL.
-      // Code generation requires the correct precision of input fields.
-      val fixedProducedDataType = TableSourceUtil.fixPrecisionForProducedDataType(
-        tableSource,
-        FlinkTypeFactory.toLogicalRowType(tableSourceTable.getRowType))
-      val conversionTransform = ScanUtil.convertToInternalRow(
-        ctx,
-        inputTransform.asInstanceOf[Transformation[Any]],
-        fieldIndexes,
-        fixedProducedDataType,
-        getRowType,
-        getTable.getQualifiedName,
-        config,
-        rowtimeExpression,
-        beforeConvert = extractElement,
-        afterConvert = resetElement)
-      conversionTransform
-    } else {
-      inputTransform.asInstanceOf[Transformation[RowData]]
-    }
-
-    val ingestedTable = new DataStream(planner.getExecEnv, streamTransformation)
-
-    // generate watermarks for rowtime indicator
-    val rowtimeDescOption: Option[RowtimeAttributeDescriptor] =
-      TableSourceUtil.getRowtimeAttributeDescriptor(tableSource, tableSourceTable.getRowType)
-
-    val withWatermarks = rowtimeDescOption match {
-      case Some(rowtimeDesc) =>
-        val rowtimeFieldIdx = getRowType.getFieldNames.indexOf(rowtimeDesc.getAttributeName)
-        val watermarkStrategy = rowtimeDesc.getWatermarkStrategy
-        watermarkStrategy match {
-          case p: PeriodicWatermarkAssigner =>
-            val watermarkGenerator = new PeriodicWatermarkAssignerWrapper(rowtimeFieldIdx, p)
-            ingestedTable.assignTimestampsAndWatermarks(watermarkGenerator)
-          case p: PunctuatedWatermarkAssigner =>
-            val watermarkGenerator =
-              new PunctuatedWatermarkAssignerWrapper(rowtimeFieldIdx, p, producedDataType)
-            ingestedTable.assignTimestampsAndWatermarks(watermarkGenerator)
-          case _: PreserveWatermarks =>
-            // The watermarks have already been provided by the underlying DataStream.
-            ingestedTable
-        }
-      case None =>
-        // No need to generate watermarks if no rowtime attribute is specified.
-        ingestedTable
-    }
-    withWatermarks.getTransformation
-  }
-
-  private def needInternalConversion: Boolean = {
-    val fieldIndexes = computeIndexMapping()
-    ScanUtil.hasTimeAttributeField(fieldIndexes) ||
-      ScanUtil.needsConversion(tableSource.getProducedDataType)
-  }
-
-  override def createInput[IN](
+  override protected def createInputFormatTransformation(
       env: StreamExecutionEnvironment,
-      format: InputFormat[IN, _ <: InputSplit],
-      t: TypeInformation[IN]): Transformation[IN] = {
-    // See StreamExecutionEnvironment.createInput, it is better to deal with checkpoint.
-    // The disadvantage is that streaming not support multi-paths.
-    env.createInput(format, t).name(tableSource.explainSource()).getTransformation
-  }
-
-  private def computeIndexMapping()
-    : Array[Int] = {
-    TypeMappingUtils.computePhysicalIndicesOrTimeAttributeMarkers(
-      tableSource,
-      FlinkTypeFactory.toTableSchema(getRowType).getTableColumns,
-      true,
-      nameMapping
-    )
-  }
-
-  private lazy val nameMapping: JFunction[String, String] = tableSource match {
-    case mapping: DefinedFieldMapping if mapping.getFieldMapping != null =>
-      new JFunction[String, String] {
-        override def apply(t: String): String = mapping.getFieldMapping.get(t)
-      }
-    case _ => JFunction.identity()
+      inputFormat: InputFormat[RowData, _],
+      name: String,
+      outTypeInfo: RowDataTypeInfo): Transformation[RowData] = {
+    // It's better to use StreamExecutionEnvironment.createInput()
+    // rather than addSource() for streaming, because it take care of checkpoint.
+    env
+      .createInput(inputFormat, outTypeInfo)
+      .name(name)
+      .getTransformation
   }
-}
-
-/**
-  * Generates periodic watermarks based on a [[PeriodicWatermarkAssigner]].
-  *
-  * @param timeFieldIdx the index of the rowtime attribute.
-  * @param assigner the watermark assigner.
-  */
-private class PeriodicWatermarkAssignerWrapper(
-    timeFieldIdx: Int,
-    assigner: PeriodicWatermarkAssigner)
-  extends AssignerWithPeriodicWatermarks[RowData] {
-
-  override def getCurrentWatermark: Watermark = assigner.getWatermark
-
-  override def extractTimestamp(row: RowData, previousElementTimestamp: Long): Long = {
-    val timestamp: Long = row.getTimestamp(timeFieldIdx, 3).getMillisecond
-    assigner.nextTimestamp(timestamp)
-    0L
-  }
-}
 
-/**
-  * Generates periodic watermarks based on a [[PunctuatedWatermarkAssigner]].
-  *
-  * @param timeFieldIdx the index of the rowtime attribute.
-  * @param assigner the watermark assigner.
-  */
-private class PunctuatedWatermarkAssignerWrapper(
-    timeFieldIdx: Int,
-    assigner: PunctuatedWatermarkAssigner,
-    sourceType: DataType)
-  extends AssignerWithPunctuatedWatermarks[RowData] {
-
-  private val converter =
-    DataFormatConverters.getConverterForDataType((sourceType match {
-      case _: FieldsDataType => sourceType
-      case _ => DataTypes.ROW(DataTypes.FIELD("f0", sourceType))
-    }).bridgedTo(classOf[Row])).asInstanceOf[DataFormatConverter[RowData, Row]]
-
-  override def checkAndGetNextWatermark(row: RowData, ts: Long): Watermark = {
-    val timestamp: Long = row.getLong(timeFieldIdx)
-    assigner.getWatermark(converter.toExternal(row), timestamp)
-  }
-
-  override def extractTimestamp(element: RowData, previousElementTimestamp: Long): Long = {
-    0L
+  override protected def translateToPlanInternal(
+      planner: StreamPlanner): Transformation[RowData] = {
+    createSourceTransformation(planner.getExecEnv, getRelDetailedDescription)
   }

Review comment:
       The old code uses `tableSource.explainSource()` as the name, is this change intentional ?

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/trait/UpdateKindTrait.scala
##########
@@ -95,4 +98,17 @@ object UpdateKindTrait {
     }
     new UpdateKindTrait(updateKind)
   }
+
+  /**
+   * Creates an instance of [[UpdateKindTrait]] from the given [[ChangelogMode]].
+   */
+  def fromChangelogMode(changelogMode: ChangelogMode): UpdateKindTrait = {
+    val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+    val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+    (hasUpdateBefore, hasUpdateAfter) match {
+      case (true, true) => BEFORE_AND_AFTER
+      case (false, true) => ONLY_UPDATE_AFTER
+      case _ => NONE
+    }

Review comment:
       Should we throw exception for `NONE` ?

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +251,113 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  /**
+   * Infers whether the current options is using legacy [[TableSource]].
+   */
+  private def isLegacyOptions(
+      hintedOptions: JMap[String, String],
+      conf: ReadableConfig): Boolean = {
+    val newCatalogTable = createCatalogTableWithHints(hintedOptions)
+    if (newCatalogTable.getOptions.contains(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+      true
+    } else {
+      // try to create legacy table source using the options,
+      // some legacy factories uses the new 'connector' key
+      try {
+        findAndCreateLegacyTableSource(hintedOptions, conf)
+        // success, then we will use the legacy factories
+        true
+      } catch {
+        case _: Throwable =>
+          // can't create, then we will use new factories
+          false
+      }
+    }
+  }
+
+  private def validateTableSource(tableSource: DynamicTableSource): Unit = {
+    // validation
+    val unsupportedAbilities = List(
+      classOf[SupportsProjectionPushDown],
+      classOf[SupportsFilterPushDown],
+      classOf[SupportsLimitPushDown],
+      classOf[SupportsPartitionPushDown],
+      classOf[SupportsComputedColumnPushDown],
+      classOf[SupportsWatermarkPushDown]
+    )
+    val tableName = schemaTable.getTableIdentifier.asSummaryString
+    tableSource match {
+      case ts: ScanTableSource =>
+        val changelogMode = ts.getChangelogMode
+        if (!schemaTable.isStreamingMode) {
+          // batch only supports bounded source
+          val provider = ts.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE)
+          if (!provider.isBounded) {
+            throw new ValidationException("Cannot query on an unbounded source in batch mode, " +
+              s"but '$tableName' is unbounded.")
+          }
+          // batch only supports INSERT only source
+          if (!changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, batch mode only supports INSERT only source, but " +
+              s"'$tableName' source produces not INSERT only messages")
+          }
+        } else {
+          // sanity check for produced ChangelogMode
+          val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+          val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+          (hasUpdateBefore, hasUpdateAfter) match {
+            case (true, true) =>
+              // UPDATE_BEFORE and UPDATE_AFTER, pass
+            case (false, true) =>
+              // only UPDATE_AFTER
+              throw new UnsupportedOperationException(
+                "Currently, ScanTableSource doesn't support producing ChangelogMode " +
+                  "which contains UPDATE_AFTER but no UPDATE_BEFORE. Please adapt the " +
+                  s"implementation of '${ts.asSummaryString()}' source.")
+            case (true, false) =>
+               // only UPDATE_BEFORE
+              throw new ValidationException(
+                s"'$tableName' source produces ChangelogMode which " +
+                  s"contains UPDATE_BEFORE but doesn't contain UPDATE_AFTER, this is invalid.")
+            case _ =>
+              // no updates, pass
+          }
+
+          // watermark defined on a changelog source is not supported
+          if (!catalogTable.getSchema.getWatermarkSpecs.isEmpty &&
+              !changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, defining WATERMARK on a changelog source is not supported.")
+          }
+        }
+      case _ =>
+        unsupportedAbilities.foreach { ability =>
+          if (tableSource.getClass.isAssignableFrom(ability)) {
+            throw new UnsupportedOperationException("Currently, a DynamicTableSource with " +
+              s"${ability.getSimpleName} ability is not supported.")
+          }
+        }
+    }

Review comment:
       How about we move to a new CatalogSourceTable and keep the old one as `LegacyCatalogSourceTable` ? The code now is a mess.

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +251,113 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  /**
+   * Infers whether the current options is using legacy [[TableSource]].
+   */
+  private def isLegacyOptions(
+      hintedOptions: JMap[String, String],
+      conf: ReadableConfig): Boolean = {
+    val newCatalogTable = createCatalogTableWithHints(hintedOptions)
+    if (newCatalogTable.getOptions.contains(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+      true
+    } else {
+      // try to create legacy table source using the options,
+      // some legacy factories uses the new 'connector' key
+      try {
+        findAndCreateLegacyTableSource(hintedOptions, conf)
+        // success, then we will use the legacy factories
+        true
+      } catch {
+        case _: Throwable =>
+          // can't create, then we will use new factories
+          false
+      }
+    }
+  }
+
+  private def validateTableSource(tableSource: DynamicTableSource): Unit = {
+    // validation
+    val unsupportedAbilities = List(
+      classOf[SupportsProjectionPushDown],
+      classOf[SupportsFilterPushDown],
+      classOf[SupportsLimitPushDown],
+      classOf[SupportsPartitionPushDown],
+      classOf[SupportsComputedColumnPushDown],
+      classOf[SupportsWatermarkPushDown]
+    )
+    val tableName = schemaTable.getTableIdentifier.asSummaryString
+    tableSource match {
+      case ts: ScanTableSource =>
+        val changelogMode = ts.getChangelogMode
+        if (!schemaTable.isStreamingMode) {
+          // batch only supports bounded source
+          val provider = ts.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE)
+          if (!provider.isBounded) {
+            throw new ValidationException("Cannot query on an unbounded source in batch mode, " +
+              s"but '$tableName' is unbounded.")
+          }
+          // batch only supports INSERT only source
+          if (!changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, batch mode only supports INSERT only source, but " +
+              s"'$tableName' source produces not INSERT only messages")
+          }
+        } else {
+          // sanity check for produced ChangelogMode
+          val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+          val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+          (hasUpdateBefore, hasUpdateAfter) match {
+            case (true, true) =>
+              // UPDATE_BEFORE and UPDATE_AFTER, pass
+            case (false, true) =>
+              // only UPDATE_AFTER
+              throw new UnsupportedOperationException(
+                "Currently, ScanTableSource doesn't support producing ChangelogMode " +
+                  "which contains UPDATE_AFTER but no UPDATE_BEFORE. Please adapt the " +
+                  s"implementation of '${ts.asSummaryString()}' source.")
+            case (true, false) =>
+               // only UPDATE_BEFORE
+              throw new ValidationException(
+                s"'$tableName' source produces ChangelogMode which " +
+                  s"contains UPDATE_BEFORE but doesn't contain UPDATE_AFTER, this is invalid.")
+            case _ =>
+              // no updates, pass
+          }
+
+          // watermark defined on a changelog source is not supported
+          if (!catalogTable.getSchema.getWatermarkSpecs.isEmpty &&
+              !changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, defining WATERMARK on a changelog source is not supported.")
+          }
+        }
+      case _ =>
+        unsupportedAbilities.foreach { ability =>
+          if (tableSource.getClass.isAssignableFrom(ability)) {

Review comment:
       Does the `ScanTableSource ` support all these features now ?

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +251,113 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  /**
+   * Infers whether the current options is using legacy [[TableSource]].
+   */
+  private def isLegacyOptions(
+      hintedOptions: JMap[String, String],
+      conf: ReadableConfig): Boolean = {
+    val newCatalogTable = createCatalogTableWithHints(hintedOptions)
+    if (newCatalogTable.getOptions.contains(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+      true
+    } else {
+      // try to create legacy table source using the options,
+      // some legacy factories uses the new 'connector' key
+      try {
+        findAndCreateLegacyTableSource(hintedOptions, conf)
+        // success, then we will use the legacy factories
+        true
+      } catch {
+        case _: Throwable =>

Review comment:
       Should we use the connector.property-version to identify if the connector is new or not ?




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * be8f4d8caa346a125f6c75e241370e449040ffe9 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] danny0405 commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r422001068



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +176,89 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {

Review comment:
       => `getOrCreateTableWithHints` ?

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +176,89 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  private def validateTableSource(tableSource: DynamicTableSource): Unit = {
+    // validation
+    val unsupportedAbilities = List(
+      classOf[SupportsProjectionPushDown],
+      classOf[SupportsFilterPushDown],
+      classOf[SupportsLimitPushDown],
+      classOf[SupportsPartitionPushDown],
+      classOf[SupportsComputedColumnPushDown],
+      classOf[SupportsWatermarkPushDown]
+    )
+    val tableName = schemaTable.getTableIdentifier.asSummaryString
+    tableSource match {
+      case ts: ScanTableSource =>
+        val changelogMode = ts.getChangelogMode
+        if (!schemaTable.isStreamingMode) {
+          // batch only supports bounded source
+          val provider = ts.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE)
+          if (!provider.isBounded) {
+            throw new ValidationException("Cannot query on an unbounded source in batch mode, " +
+              s"but '$tableName' is unbounded.")
+          }
+          // batch only supports INSERT only source
+          if (!changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, batch mode only supports INSERT only source, but " +
+              s"'$tableName' source produces not INSERT only messages")
+          }
+        } else {
+          // sanity check for produced ChangelogMode
+          val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+          val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+          (hasUpdateBefore, hasUpdateAfter) match {
+            case (true, true) =>
+              // UPDATE_BEFORE and UPDATE_AFTER, pass
+            case (false, true) =>
+              // only UPDATE_AFTER

Review comment:
       I saw similar logic in `FlinkChangelogModeInferenceProgram`, maybe we should have a `ChangelogMode` util for such a validation ~




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5cebd993df368d4065154858dae34ea2d6e41727 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 420704211108d661a5d9959e571ce98460ae1897 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624) 
   * 6dd7e458809c5c43ce9e51f4381af0b84440526d Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r422013035



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +176,89 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  private def validateTableSource(tableSource: DynamicTableSource): Unit = {
+    // validation
+    val unsupportedAbilities = List(
+      classOf[SupportsProjectionPushDown],
+      classOf[SupportsFilterPushDown],
+      classOf[SupportsLimitPushDown],
+      classOf[SupportsPartitionPushDown],
+      classOf[SupportsComputedColumnPushDown],
+      classOf[SupportsWatermarkPushDown]
+    )
+    val tableName = schemaTable.getTableIdentifier.asSummaryString
+    tableSource match {
+      case ts: ScanTableSource =>
+        val changelogMode = ts.getChangelogMode
+        if (!schemaTable.isStreamingMode) {
+          // batch only supports bounded source
+          val provider = ts.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE)
+          if (!provider.isBounded) {
+            throw new ValidationException("Cannot query on an unbounded source in batch mode, " +
+              s"but '$tableName' is unbounded.")
+          }
+          // batch only supports INSERT only source
+          if (!changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, batch mode only supports INSERT only source, but " +
+              s"'$tableName' source produces not INSERT only messages")
+          }
+        } else {
+          // sanity check for produced ChangelogMode
+          val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+          val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+          (hasUpdateBefore, hasUpdateAfter) match {
+            case (true, true) =>
+              // UPDATE_BEFORE and UPDATE_AFTER, pass
+            case (false, true) =>
+              // only UPDATE_AFTER

Review comment:
       Do you mean in `UpdateKindTrait`? It's not similar. There is not much code can be shared between them. 




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807",
       "triggerID" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "triggerType" : "PUSH"
     }, {
       "hash" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=813",
       "triggerID" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "361ae00a1fe74959062e48c7e659605eea0295ef",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=822",
       "triggerID" : "361ae00a1fe74959062e48c7e659605eea0295ef",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8808e39c0d3cb29cc88fd23ede27820e427e6a75 UNKNOWN
   * 361ae00a1fe74959062e48c7e659605eea0295ef Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=822) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 945427a9cf24c43097883cc9fccbac2983ab8bac Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587) 
   * 420704211108d661a5d9959e571ce98460ae1897 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5cebd993df368d4065154858dae34ea2d6e41727 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665) 
   * 8f0b6b9413eb41350d6455527715cddedf4eea00 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=771",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     }, {
       "hash" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=795",
       "triggerID" : "be8f4d8caa346a125f6c75e241370e449040ffe9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=807",
       "triggerID" : "44a5d8792e56e1e0676c76ff270720caf36558c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8808e39c0d3cb29cc88fd23ede27820e427e6a75",
       "triggerType" : "PUSH"
     }, {
       "hash" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=813",
       "triggerID" : "85affedaf4bd2005f910870613a20387fb3a527e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "361ae00a1fe74959062e48c7e659605eea0295ef",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=822",
       "triggerID" : "361ae00a1fe74959062e48c7e659605eea0295ef",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8808e39c0d3cb29cc88fd23ede27820e427e6a75 UNKNOWN
   * 85affedaf4bd2005f910870613a20387fb3a527e Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=813) 
   * 361ae00a1fe74959062e48c7e659605eea0295ef Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=822) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421914970



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +251,113 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  /**
+   * Infers whether the current options is using legacy [[TableSource]].
+   */
+  private def isLegacyOptions(
+      hintedOptions: JMap[String, String],
+      conf: ReadableConfig): Boolean = {
+    val newCatalogTable = createCatalogTableWithHints(hintedOptions)
+    if (newCatalogTable.getOptions.contains(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+      true
+    } else {
+      // try to create legacy table source using the options,
+      // some legacy factories uses the new 'connector' key
+      try {
+        findAndCreateLegacyTableSource(hintedOptions, conf)
+        // success, then we will use the legacy factories
+        true
+      } catch {
+        case _: Throwable =>

Review comment:
       I though about this. However, it doesn't work. Because, the `connector.property-version` is attached by the framework. So no matter the the connector is old or new, they have the same `connector.property-version`.




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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421914394



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
##########
@@ -226,4 +251,113 @@ class CatalogSourceTable[T](
     }
     factory.buildRelNodeRowType(fieldNames, fieldTypes)
   }
+
+  /**
+   * Returns true if there is any generated columns defined on the catalog table.
+   */
+  private def containsGeneratedColumns(catalogTable: CatalogTable): Boolean = {
+    catalogTable.getSchema.getTableColumns.exists(_.isGenerated)
+  }
+
+  /**
+   * Creates a new catalog table with the given hint options,
+   * but return the original catalog table if the given hint options is empty.
+   */
+  private def createCatalogTableWithHints(hintedOptions: JMap[String, String]): CatalogTable = {
+    if (hintedOptions.nonEmpty) {
+      catalogTable.copy(FlinkHints.mergeTableOptions(hintedOptions, catalogTable.getOptions))
+    } else {
+      catalogTable
+    }
+  }
+
+  /**
+   * Infers whether the current options is using legacy [[TableSource]].
+   */
+  private def isLegacyOptions(
+      hintedOptions: JMap[String, String],
+      conf: ReadableConfig): Boolean = {
+    val newCatalogTable = createCatalogTableWithHints(hintedOptions)
+    if (newCatalogTable.getOptions.contains(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+      true
+    } else {
+      // try to create legacy table source using the options,
+      // some legacy factories uses the new 'connector' key
+      try {
+        findAndCreateLegacyTableSource(hintedOptions, conf)
+        // success, then we will use the legacy factories
+        true
+      } catch {
+        case _: Throwable =>
+          // can't create, then we will use new factories
+          false
+      }
+    }
+  }
+
+  private def validateTableSource(tableSource: DynamicTableSource): Unit = {
+    // validation
+    val unsupportedAbilities = List(
+      classOf[SupportsProjectionPushDown],
+      classOf[SupportsFilterPushDown],
+      classOf[SupportsLimitPushDown],
+      classOf[SupportsPartitionPushDown],
+      classOf[SupportsComputedColumnPushDown],
+      classOf[SupportsWatermarkPushDown]
+    )
+    val tableName = schemaTable.getTableIdentifier.asSummaryString
+    tableSource match {
+      case ts: ScanTableSource =>
+        val changelogMode = ts.getChangelogMode
+        if (!schemaTable.isStreamingMode) {
+          // batch only supports bounded source
+          val provider = ts.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE)
+          if (!provider.isBounded) {
+            throw new ValidationException("Cannot query on an unbounded source in batch mode, " +
+              s"but '$tableName' is unbounded.")
+          }
+          // batch only supports INSERT only source
+          if (!changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, batch mode only supports INSERT only source, but " +
+              s"'$tableName' source produces not INSERT only messages")
+          }
+        } else {
+          // sanity check for produced ChangelogMode
+          val hasUpdateBefore = changelogMode.contains(RowKind.UPDATE_BEFORE)
+          val hasUpdateAfter = changelogMode.contains(RowKind.UPDATE_AFTER)
+          (hasUpdateBefore, hasUpdateAfter) match {
+            case (true, true) =>
+              // UPDATE_BEFORE and UPDATE_AFTER, pass
+            case (false, true) =>
+              // only UPDATE_AFTER
+              throw new UnsupportedOperationException(
+                "Currently, ScanTableSource doesn't support producing ChangelogMode " +
+                  "which contains UPDATE_AFTER but no UPDATE_BEFORE. Please adapt the " +
+                  s"implementation of '${ts.asSummaryString()}' source.")
+            case (true, false) =>
+               // only UPDATE_BEFORE
+              throw new ValidationException(
+                s"'$tableName' source produces ChangelogMode which " +
+                  s"contains UPDATE_BEFORE but doesn't contain UPDATE_AFTER, this is invalid.")
+            case _ =>
+              // no updates, pass
+          }
+
+          // watermark defined on a changelog source is not supported
+          if (!catalogTable.getSchema.getWatermarkSpecs.isEmpty &&
+              !changelogMode.containsOnly(RowKind.INSERT)) {
+            throw new UnsupportedOperationException(
+              "Currently, defining WATERMARK on a changelog source is not supported.")
+          }
+        }
+      case _ =>
+        unsupportedAbilities.foreach { ability =>
+          if (tableSource.getClass.isAssignableFrom(ability)) {

Review comment:
       No. We don't support any of the ability interface. That's why we should throw exception to idnicate users they are not supported yet. Once one of the ability interface is supported, the developer should remove then entry from `unsupportedAbilities`.




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



[GitHub] [flink] flinkbot commented on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * de26ba11042772d77be2416fd6c829d80c9c66b7 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot commented on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623535573


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit de26ba11042772d77be2416fd6c829d80c9c66b7 (Mon May 04 15:32:57 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421915497



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/logical/FlinkLogicalTableSourceScan.scala
##########
@@ -76,7 +73,7 @@ class FlinkLogicalTableSourceScan(
 
   override def explainTerms(pw: RelWriter): RelWriter = {
     super.explainTerms(pw)
-      .item("fields", tableSource.getTableSchema.getFieldNames.mkString(", "))
+      .item("fields", getRowType.getFieldNames.mkString(", "))
   }

Review comment:
       We don't have `getTableSchema` method for `DynamicTableSource`. If we support projection push down, the `getRowType` should be the projected fields. 




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=587",
       "triggerID" : "945427a9cf24c43097883cc9fccbac2983ab8bac",
       "triggerType" : "PUSH"
     }, {
       "hash" : "420704211108d661a5d9959e571ce98460ae1897",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=624",
       "triggerID" : "420704211108d661a5d9959e571ce98460ae1897",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=660",
       "triggerID" : "6dd7e458809c5c43ce9e51f4381af0b84440526d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665",
       "triggerID" : "5cebd993df368d4065154858dae34ea2d6e41727",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8f0b6b9413eb41350d6455527715cddedf4eea00",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5cebd993df368d4065154858dae34ea2d6e41727 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=665) 
   * 8f0b6b9413eb41350d6455527715cddedf4eea00 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r422004638



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/FlinkCalciteCatalogReader.java
##########
@@ -188,11 +192,46 @@ private static FlinkPreparingTableBase convertCatalogTable(
 			RelDataType rowType,
 			CatalogTable catalogTable,
 			CatalogSchemaTable schemaTable) {
-		return new CatalogSourceTable<>(
-			relOptSchema,
-			names,
-			rowType,
-			schemaTable,
-			catalogTable);
+		if (isLegacyConnectorOptions(catalogTable, schemaTable)) {
+			return new LegacyCatalogSourceTable<>(
+				relOptSchema,
+				names,
+				rowType,
+				schemaTable,
+				catalogTable);
+		} else {
+			return new CatalogSourceTable<>(
+				relOptSchema,
+				names,
+				rowType,
+				schemaTable,
+				catalogTable);
+		}
+	}
+
+	/**
+	 * Checks whether the {@link CatalogTable} uses legacy connector options.
+	 */
+	private static boolean isLegacyConnectorOptions(
+			CatalogTable catalogTable,
+			CatalogSchemaTable schemaTable) {
+		if (catalogTable.getOptions().containsKey(ConnectorDescriptorValidator.CONNECTOR_TYPE)) {
+			return true;

Review comment:
       Why? I checked `TableFactoryService`, we use lower-case as the option key. And `CONNECTOR_TYPE` is lower case. 




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



[GitHub] [flink] wuchong commented on a change in pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11985:
URL: https://github.com/apache/flink/pull/11985#discussion_r421913683



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamExecTableSourceScan.scala
##########
@@ -92,177 +73,21 @@ class StreamExecTableSourceScan(
     replaceInput(ordinalInParent, newInputNode.asInstanceOf[RelNode])
   }
 
-  override protected def translateToPlanInternal(
-      planner: StreamPlanner): Transformation[RowData] = {
-    val config = planner.getTableConfig
-    val inputTransform = getSourceTransformation(planner.getExecEnv)
-
-    val fieldIndexes = computeIndexMapping()
-
-    val inputDataType = inputTransform.getOutputType
-    val producedDataType = tableSource.getProducedDataType
-
-    // check that declared and actual type of table source DataStream are identical
-    if (inputDataType !=
-        TypeInfoDataTypeConverter.fromDataTypeToTypeInfo(producedDataType)) {
-      throw new TableException(s"TableSource of type ${tableSource.getClass.getCanonicalName} " +
-        s"returned a DataStream of data type $inputDataType that does not match with the " +
-        s"data type $producedDataType declared by the TableSource.getProducedDataType() method. " +
-        s"Please validate the implementation of the TableSource.")
-    }
-
-    // get expression to extract rowtime attribute
-    val rowtimeExpression: Option[RexNode] = TableSourceUtil.getRowtimeAttributeDescriptor(
-      tableSource,
-      tableSourceTable.getRowType
-    ).map(desc =>
-      TableSourceUtil.getRowtimeExtractionExpression(
-        desc.getTimestampExtractor,
-        producedDataType,
-        planner.getRelBuilder,
-        nameMapping
-      )
-    )
-
-    val streamTransformation = if (needInternalConversion) {
-      // extract time if the index is -1 or -2.
-      val (extractElement, resetElement) =
-        if (ScanUtil.hasTimeAttributeField(fieldIndexes)) {
-          (s"ctx.$ELEMENT = $ELEMENT;", s"ctx.$ELEMENT = null;")
-        } else {
-          ("", "")
-        }
-      val ctx = CodeGeneratorContext(config).setOperatorBaseClass(
-        classOf[AbstractProcessStreamOperator[RowData]])
-      // the produced type may not carry the correct precision user defined in DDL, because
-      // it may be converted from legacy type. Fix precision using logical schema from DDL.
-      // Code generation requires the correct precision of input fields.
-      val fixedProducedDataType = TableSourceUtil.fixPrecisionForProducedDataType(
-        tableSource,
-        FlinkTypeFactory.toLogicalRowType(tableSourceTable.getRowType))
-      val conversionTransform = ScanUtil.convertToInternalRow(
-        ctx,
-        inputTransform.asInstanceOf[Transformation[Any]],
-        fieldIndexes,
-        fixedProducedDataType,
-        getRowType,
-        getTable.getQualifiedName,
-        config,
-        rowtimeExpression,
-        beforeConvert = extractElement,
-        afterConvert = resetElement)
-      conversionTransform
-    } else {
-      inputTransform.asInstanceOf[Transformation[RowData]]
-    }
-
-    val ingestedTable = new DataStream(planner.getExecEnv, streamTransformation)
-
-    // generate watermarks for rowtime indicator
-    val rowtimeDescOption: Option[RowtimeAttributeDescriptor] =
-      TableSourceUtil.getRowtimeAttributeDescriptor(tableSource, tableSourceTable.getRowType)
-
-    val withWatermarks = rowtimeDescOption match {
-      case Some(rowtimeDesc) =>
-        val rowtimeFieldIdx = getRowType.getFieldNames.indexOf(rowtimeDesc.getAttributeName)
-        val watermarkStrategy = rowtimeDesc.getWatermarkStrategy
-        watermarkStrategy match {
-          case p: PeriodicWatermarkAssigner =>
-            val watermarkGenerator = new PeriodicWatermarkAssignerWrapper(rowtimeFieldIdx, p)
-            ingestedTable.assignTimestampsAndWatermarks(watermarkGenerator)
-          case p: PunctuatedWatermarkAssigner =>
-            val watermarkGenerator =
-              new PunctuatedWatermarkAssignerWrapper(rowtimeFieldIdx, p, producedDataType)
-            ingestedTable.assignTimestampsAndWatermarks(watermarkGenerator)
-          case _: PreserveWatermarks =>
-            // The watermarks have already been provided by the underlying DataStream.
-            ingestedTable
-        }
-      case None =>
-        // No need to generate watermarks if no rowtime attribute is specified.
-        ingestedTable
-    }
-    withWatermarks.getTransformation
-  }
-
-  private def needInternalConversion: Boolean = {
-    val fieldIndexes = computeIndexMapping()
-    ScanUtil.hasTimeAttributeField(fieldIndexes) ||
-      ScanUtil.needsConversion(tableSource.getProducedDataType)
-  }
-
-  override def createInput[IN](
+  override protected def createInputFormatTransformation(
       env: StreamExecutionEnvironment,
-      format: InputFormat[IN, _ <: InputSplit],
-      t: TypeInformation[IN]): Transformation[IN] = {
-    // See StreamExecutionEnvironment.createInput, it is better to deal with checkpoint.
-    // The disadvantage is that streaming not support multi-paths.
-    env.createInput(format, t).name(tableSource.explainSource()).getTransformation
-  }
-
-  private def computeIndexMapping()
-    : Array[Int] = {
-    TypeMappingUtils.computePhysicalIndicesOrTimeAttributeMarkers(
-      tableSource,
-      FlinkTypeFactory.toTableSchema(getRowType).getTableColumns,
-      true,
-      nameMapping
-    )
-  }
-
-  private lazy val nameMapping: JFunction[String, String] = tableSource match {
-    case mapping: DefinedFieldMapping if mapping.getFieldMapping != null =>
-      new JFunction[String, String] {
-        override def apply(t: String): String = mapping.getFieldMapping.get(t)
-      }
-    case _ => JFunction.identity()
+      inputFormat: InputFormat[RowData, _],
+      name: String,
+      outTypeInfo: RowDataTypeInfo): Transformation[RowData] = {
+    // It's better to use StreamExecutionEnvironment.createInput()
+    // rather than addSource() for streaming, because it take care of checkpoint.
+    env
+      .createInput(inputFormat, outTypeInfo)
+      .name(name)
+      .getTransformation
   }
-}
-
-/**
-  * Generates periodic watermarks based on a [[PeriodicWatermarkAssigner]].
-  *
-  * @param timeFieldIdx the index of the rowtime attribute.
-  * @param assigner the watermark assigner.
-  */
-private class PeriodicWatermarkAssignerWrapper(
-    timeFieldIdx: Int,
-    assigner: PeriodicWatermarkAssigner)
-  extends AssignerWithPeriodicWatermarks[RowData] {
-
-  override def getCurrentWatermark: Watermark = assigner.getWatermark
-
-  override def extractTimestamp(row: RowData, previousElementTimestamp: Long): Long = {
-    val timestamp: Long = row.getTimestamp(timeFieldIdx, 3).getMillisecond
-    assigner.nextTimestamp(timestamp)
-    0L
-  }
-}
 
-/**
-  * Generates periodic watermarks based on a [[PunctuatedWatermarkAssigner]].
-  *
-  * @param timeFieldIdx the index of the rowtime attribute.
-  * @param assigner the watermark assigner.
-  */
-private class PunctuatedWatermarkAssignerWrapper(
-    timeFieldIdx: Int,
-    assigner: PunctuatedWatermarkAssigner,
-    sourceType: DataType)
-  extends AssignerWithPunctuatedWatermarks[RowData] {
-
-  private val converter =
-    DataFormatConverters.getConverterForDataType((sourceType match {
-      case _: FieldsDataType => sourceType
-      case _ => DataTypes.ROW(DataTypes.FIELD("f0", sourceType))
-    }).bridgedTo(classOf[Row])).asInstanceOf[DataFormatConverter[RowData, Row]]
-
-  override def checkAndGetNextWatermark(row: RowData, ts: Long): Watermark = {
-    val timestamp: Long = row.getLong(timeFieldIdx)
-    assigner.getWatermark(converter.toExternal(row), timestamp)
-  }
-
-  override def extractTimestamp(element: RowData, previousElementTimestamp: Long): Long = {
-    0L
+  override protected def translateToPlanInternal(
+      planner: StreamPlanner): Transformation[RowData] = {
+    createSourceTransformation(planner.getExecEnv, getRelDetailedDescription)
   }

Review comment:
       Yes. This is on purpose. We should prefer to use `getRelDetailedDescription` which have more detailed and formated information about this node. Besides, the `DynamicTableSource#asSummaryString` is not the same meaning with `TableSource#explainSource`. `asSummaryString` is just used for logging (such as `Kafka_0.9`), it doesn't contain detailed information of this node.




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



[GitHub] [flink] flinkbot edited a comment on pull request #11985: [FLINK-16989][table] Support ScanTableSource in blink planner

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11985:
URL: https://github.com/apache/flink/pull/11985#issuecomment-623545781


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568",
       "triggerID" : "de26ba11042772d77be2416fd6c829d80c9c66b7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * de26ba11042772d77be2416fd6c829d80c9c66b7 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=568) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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