danny0405 commented on code in PR #6991: URL: https://github.com/apache/hudi/pull/6991#discussion_r1001599929
########## hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieCatalog.java: ########## @@ -505,7 +552,29 @@ private Map<String, String> applyOptionsHook(String tablePath, Map<String, Strin return newOptions; } - private String inferTablePath(String catalogPath, ObjectPath tablePath) { + private HoodieFlinkWriteClient<?> createWriteClient( + Map<String, String> options, + String tablePathStr, + ObjectPath tablePath) throws IOException { + return StreamerUtil.createWriteClient( + Configuration.fromMap(options) + .set(FlinkOptions.TABLE_NAME, tablePath.getObjectName()) + .set(FlinkOptions.SOURCE_AVRO_SCHEMA, + StreamerUtil.createMetaClient(tablePathStr, hadoopConf) + .getTableConfig().getTableCreateSchema().get().toString())); + } + + @VisibleForTesting + protected String inferTablePath(String catalogPath, ObjectPath tablePath) { return String.format("%s/%s/%s", catalogPath, tablePath.getDatabaseName(), tablePath.getObjectName()); } + + private String inferPartitionPath(boolean hiveStylePartitioning, CatalogPartitionSpec catalogPartitionSpec) { + return catalogPartitionSpec.getPartitionSpec().entrySet() + .stream().map(entry -> Review Comment: Can we move this method into the util `HoodieCatalogUtil` ? -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org