linliu-code commented on code in PR #12343:
URL: https://github.com/apache/hudi/pull/12343#discussion_r1861117924
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/SparkTaskContextSupplier.java:
##########
@@ -90,4 +100,18 @@ public Option<String> getProperty(EngineProperty prop) {
throw new HoodieException("Unknown engine property :" + prop);
}
+ // This reader context is used to read records before write, like
compaction, clustering.
+ @Override
+ public Option<HoodieReaderContext> getReaderContext(HoodieTableMetaClient
metaClient, boolean useReaderContext) {
+ if (useReaderContext) {
+ SparkParquetReader reader =
SparkAdapterSupport$.MODULE$.sparkAdapter().createParquetFileReader(
+ false, SQLConf.get(), new HashMap<>(), (Configuration)
metaClient.getStorageConf().unwrap());
+ return Option.of(new SparkFileFormatInternalRowReaderContext(
+ reader,
+ metaClient.getTableConfig().getRecordKeyFields().get()[0],
+ new ArrayBuffer<>(),
+ new ArrayBuffer<>()));
+ }
+ return Option.empty();
+ }
Review Comment:
@yihua @jonvex , the sparkAdapter class cannot be found during the runtime
here. What is wrong with this?
--
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]