the-other-tim-brown commented on code in PR #13295:
URL: https://github.com/apache/hudi/pull/13295#discussion_r2106074687
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/SparkRDDWriteClient.java:
##########
@@ -148,6 +152,24 @@ public JavaRDD<WriteStatus>
upsertPreppedRecords(JavaRDD<HoodieRecord<T>> preppe
return postWrite(resultRDD, instantTime, table);
}
+ /**
+ * Used for streaming writes to metadata table.
+ */
+ @Override
+ public JavaRDD<WriteStatus> upsertPreppedRecords(JavaRDD<HoodieRecord<T>>
preppedRecords, String instantTime, Option<List<Pair<String, String>>>
partitionFileIdPairsOpt) {
+ ValidationUtils.checkArgument(isMetadataTable, "This version of upsert
prepped can only be invoked for metadata table");
+ HoodieTable<T, HoodieData<HoodieRecord<T>>, HoodieData<HoodieKey>,
HoodieData<WriteStatus>> table =
+ initTable(WriteOperationType.UPSERT_PREPPED,
Option.ofNullable(instantTime));
+ table.validateUpsertSchema();
+ if (!(partitionFileIdPairsOpt.isPresent() &&
partitionFileIdPairsOpt.get().get(0).getKey().equals(FILES.getPartitionPath())))
{
+ // we do not want to call prewrite more than once for the same instant
writing to metadata table twice.
Review Comment:
Now that there is a separate write client for the mdt writer, is it worth
revisiting?
--
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]