wuchong commented on code in PR #22166:
URL: https://github.com/apache/flink/pull/22166#discussion_r1174528650


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/HiveParserDMLHelper.java:
##########
@@ -331,20 +333,48 @@ public Operation 
createInsertOperation(HiveParserCalcitePlanner analyzer, RelNod
                 createInsertOperationInfo(
                         queryRelNode,
                         destTable,
-                        
HiveParserBaseSemanticAnalyzer.parseCompoundName(catalogManager, tableName),
+                        HiveParserBaseSemanticAnalyzer.parseCompoundName(
+                                catalogRegistry, tableName),
                         staticPartSpec,
                         analyzer.getDestSchemaForClause(insClauseName),
                         overwrite);
 
         return new SinkModifyOperation(
-                catalogManager.getTableOrError(insertOperationInfo.f0),
+                getContextResolvedTable(insertOperationInfo.f0),
                 insertOperationInfo.f1,
                 insertOperationInfo.f2,
                 null, // targetColumns
                 insertOperationInfo.f3,
                 Collections.emptyMap());
     }
 
+    private ContextResolvedTable getContextResolvedTable(ObjectIdentifier 
tableIdentifier) {

Review Comment:
   It seems we still need to depend on `ContextResolvedTable`, which is an 
`@Internal` class. The `getContextResolvedTable` method is somehow duplicated 
with `CatalogManager#getTable`. Besides, I don't favor the verbose method 
signature of `CatalogRegistry#getResolvedCatalogBaseTable`. What do you think 
about replacing the `CatalogRegistry#getResolvedCatalogBaseTable` with 
`CatalogRegistry#getTableOrError`? This can also make the callers easier 
without dealing with the empty result. 



##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/HiveParserFactory.java:
##########
@@ -47,15 +47,6 @@ public Set<ConfigOption<?>> optionalOptions() {
 
     @Override
     public Parser create(Context context) {
-        return new HiveParser(
-                context.getCatalogManager(),
-                context.getPlannerContext()::createFlinkPlanner,
-                context.getPlannerContext()::createCalciteParser,
-                context.getPlannerContext());
-    }
-
-    @Override
-    public ExtendedOperationExecutor createExtendedOperationExecutor(Context 
context) {
-        return new HiveOperationExecutor(context.getCatalogManager(), 
context.getPlannerContext());
+        return new HiveParser((CalciteContext) context);

Review Comment:
   Please add a comment about the hard cast. 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to