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


Reply via email to