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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java:
##########
@@ -98,20 +105,29 @@ public DynamicTableSource createDynamicTableSource(Context 
context) {
   @Override
   public DynamicTableSink createDynamicTableSink(Context context) {
     Configuration conf = 
FlinkOptions.fromMap(context.getCatalogTable().getOptions());
-    checkArgument(!StringUtils.isNullOrEmpty(conf.get(FlinkOptions.PATH)),
-        "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());

Review Comment:
   The principal change is here, where we setup key related options first with 
possible overwrites, and only then check them in `sanityCheck`.



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