xiarixiaoyao commented on a change in pull request #4910: URL: https://github.com/apache/hudi/pull/4910#discussion_r828101218
########## File path: hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/SparkMergeHelper.java ########## @@ -77,14 +89,39 @@ public void runMerge(HoodieTable<T, JavaRDD<HoodieRecord<T>>, JavaRDD<HoodieKey> readSchema = mergeHandle.getWriterSchemaWithMetaFields(); } + Option<InternalSchema> querySchemaOpt = SerDeHelper.fromJson(table.getConfig().getInternalSchema()); + Boolean needToReWriteRecord = false; + // to do support bootstrap + if (querySchemaOpt.isPresent() && !baseFile.getBootstrapBaseFile().isPresent()) { + // check implicitly add columns, and position reorder(spark sql may change cols order) + InternalSchema querySchema = AvroSchemaUtil.evolutionSchemaFromNewAvroSchema(readSchema, querySchemaOpt.get(), true); + long commitTime = Long.valueOf(FSUtils.getCommitTime(mergeHandle.getOldFilePath().getName())); + InternalSchema writeInternalSchema = TableInternalSchemaUtils.searchSchemaAndCache(commitTime, table.getMetaClient()); + List<String> colNamesFromQuerySchema = querySchema.getAllColsFullName(); + List<String> colNamesFromWriteSchema = writeInternalSchema.getAllColsFullName(); + List<String> diffCols = colNamesFromWriteSchema.stream() Review comment: yes,you are right, it should be named sameCols -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org