geserdugarov commented on code in PR #18010:
URL: https://github.com/apache/hudi/pull/18010#discussion_r2731271805


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java:
##########
@@ -82,14 +82,22 @@ public class HoodieTableFactory implements 
DynamicTableSourceFactory, DynamicTab
   @Override
   public DynamicTableSource createDynamicTableSource(Context context) {
     Configuration conf = 
FlinkOptions.fromMap(context.getCatalogTable().getOptions());
-    StoragePath path = new 
StoragePath(conf.getOptional(FlinkOptions.PATH).orElseThrow(() ->
-        new ValidationException("Option [path] should not be empty.")));
-    setupTableOptions(conf.get(FlinkOptions.PATH), conf);
+    String path = getTablePath(conf);
+    enrichOptionsFromTableConfig(path, conf);
+
+    // set common parameters
+    conf.setString(FlinkOptions.TABLE_NAME.key(), 
context.getObjectIdentifier().getObjectName());
+    conf.setString(FlinkOptions.DATABASE_NAME.key(), 
context.getObjectIdentifier().getDatabaseName());
+    setupKeyGenRelatedOptions(conf, context.getCatalogTable());
     ResolvedSchema schema = context.getCatalogTable().getResolvedSchema();
-    setupConfOptions(conf, context.getObjectIdentifier(), 
context.getCatalogTable(), schema);
+    setupAdditionalOptions(conf, context.getObjectIdentifier(), 
schema.toPhysicalRowDataType().notNull().getLogicalType());

Review Comment:
   The code block up to this line is repeated in `createDynamicTableSink`, but 
I suppose it's simpler to understand of what is going on here this way.



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