the-other-tim-brown commented on code in PR #480:
URL: https://github.com/apache/incubator-xtable/pull/480#discussion_r1721108861
##########
xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java:
##########
@@ -149,24 +150,45 @@ public static void main(String[] args) throws IOException
{
"Running sync for basePath {} for following table formats {}",
table.getTableBasePath(),
tableFormatList);
- PerTableConfig config =
- PerTableConfigImpl.builder()
- .tableBasePath(table.getTableBasePath())
- .tableName(table.getTableName())
+ Properties sourceProperties = new Properties();
+ if (table.getPartitionSpec() != null) {
+ sourceProperties.put(
+ HudiSourceConfig.PARTITION_FIELD_SPEC_CONFIG,
table.getPartitionSpec());
+ }
+ SourceTable sourceTable =
+ SourceTable.builder()
+ .name(table.getTableName())
+ .basePath(table.getTableBasePath())
.namespace(table.getNamespace() == null ? null :
table.getNamespace().split("\\."))
- .tableDataPath(table.getTableDataPath())
- .icebergCatalogConfig(icebergCatalogConfig)
- .hudiSourceConfig(
- HudiSourceConfigImpl.builder()
- .partitionSpecExtractorClass(
-
ConfigurationBasedPartitionSpecExtractor.class.getName())
- .partitionFieldSpecConfig(table.getPartitionSpec())
- .build())
- .targetTableFormats(tableFormatList)
+ .dataPath(table.getTableDataPath())
+ .catalogConfig(icebergCatalogConfig)
+ .additionalProperties(sourceProperties)
+ .formatName(sourceFormat)
+ .build();
+ List<TargetTable> targetTables =
+ tableFormatList.stream()
+ .map(
+ tableFormat ->
+ TargetTable.builder()
+ .name(table.getTableName())
+ .basePath(table.getTableBasePath())
+ .namespace(
+ table.getNamespace() == null
+ ? null
+ : table.getNamespace().split("\\."))
+ .catalogConfig(icebergCatalogConfig)
+ .formatName(tableFormat)
Review Comment:
There is no `targetProperties` currently, what should this contain?
--
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]