danny0405 commented on code in PR #11031:
URL: https://github.com/apache/hudi/pull/11031#discussion_r1602800923


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java:
##########
@@ -86,12 +86,15 @@ public DynamicTableSource createDynamicTableSource(Context 
context) {
     setupTableOptions(conf.getString(FlinkOptions.PATH), conf);
     ResolvedSchema schema = context.getCatalogTable().getResolvedSchema();
     setupConfOptions(conf, context.getObjectIdentifier(), 
context.getCatalogTable(), schema);
+    HoodieTableMetaClient metaClient = StreamerUtil.metaClientForReader(conf, 
HadoopConfigurations.getHadoopConf(conf));
+    SanityCheckUtil.sanitCheck(conf, schema, metaClient);
     return new HoodieTableSource(
         schema,
         path,
         context.getCatalogTable().getPartitionKeys(),
         conf.getString(FlinkOptions.PARTITION_DEFAULT_NAME),
-        conf);
+        conf,
+        metaClient);

Review Comment:
   The metaClient initialization is costly but the table source only happens 
once in Job Graph compile time, let's not reuse here to reduce complexity.



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