leesf commented on a change in pull request #2808:
URL: https://github.com/apache/hudi/pull/2808#discussion_r612387947
##########
File path:
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/client/HoodieFlinkWriteClient.java
##########
@@ -162,17 +162,54 @@ public void bootstrap(Option<Map<String, String>>
extraMetadata) {
table.validateUpsertSchema();
preWrite(instantTime, WriteOperationType.INSERT, table.getMetaClient());
// create the write handle if not exists
- final HoodieRecord<T> record = records.get(0);
- final boolean isDelta =
table.getMetaClient().getTableType().equals(HoodieTableType.MERGE_ON_READ);
- final HoodieWriteHandle<?, ?, ?, ?> writeHandle =
getOrCreateWriteHandle(record, isDelta, getConfig(),
- instantTime, table, record.getPartitionPath(), records.listIterator());
+ final HoodieWriteHandle<?, ?, ?, ?> writeHandle =
getOrCreateWriteHandle(records.get(0), getConfig(),
+ instantTime, table, records.listIterator());
HoodieWriteMetadata<List<WriteStatus>> result = ((HoodieFlinkTable<T>)
table).insert(context, writeHandle, instantTime, records);
if (result.getIndexLookupDuration().isPresent()) {
metrics.updateIndexMetrics(LOOKUP_STR,
result.getIndexLookupDuration().get().toMillis());
}
return postWrite(result, instantTime, table);
}
+ /**
+ * Removes all existing records from the partitions affected and inserts the
given HoodieRecords, into the table.
+ *
+ * @param records HoodieRecords to insert
+ * @param instantTime Instant time of the commit
+ * @return list of WriteStatus to inspect errors and counts
+ */
+ public List<WriteStatus> insertOverwrite(
Review comment:
@danny0405 would you please file a jira to track this work? I think the
methods(insertOverwrite /insertOverwriteTable) between SparkRDDWriteClient and
HoodieFlinkWriteClient would be unified.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]