muyihao commented on code in PR #11914:
URL: https://github.com/apache/hudi/pull/11914#discussion_r1769525755
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/SchemaEvolutionContext.java:
##########
@@ -98,19 +101,63 @@ public SchemaEvolutionContext(InputSplit split, JobConf
job) throws IOException
public SchemaEvolutionContext(InputSplit split, JobConf job,
Option<HoodieTableMetaClient> metaClientOption) throws IOException {
this.split = split;
this.job = job;
- this.metaClient = metaClientOption.isPresent() ? metaClientOption.get() :
setUpHoodieTableMetaClient();
- if (this.metaClient == null) {
+ if (!job.getBoolean(HIVE_EVOLUTION_ENABLE, true)) {
+ LOG.info("schema evolution is disabled for split: {}", split);
internalSchemaOption = Option.empty();
+ this.metaClient = null;
return;
}
+ this.metaClient = metaClientOption.isPresent() ? metaClientOption.get() :
setUpHoodieTableMetaClient();
+ this.internalSchemaOption = getInternalSchemaFromCache();
+ LOG.info("finish init schema evolution for split: {}", split);
+ }
+
+ public Option<InternalSchema> getInternalSchemaFromCache() throws
IOException {
+ Option<InternalSchema> internalSchema = getCachedData(
+ HoodieCombineHiveInputFormat.INTERNAL_SCHEMA_CACHE_KEY_PREFIX,
+ json -> SerDeHelper.fromJson(json)
+ );
+ if (internalSchema != null && internalSchema.isPresent()) {
+ LOG.info("get internal schema from conf for split: {}" + split);
Review Comment:
Will remove it
--
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]