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


Reply via email to