[HUDI-2941] Show _hoodie_operation in spark sql results (#4649)
This commit is contained in:
@@ -679,9 +679,9 @@ public abstract class HoodieTable<T extends HoodieRecordPayload, I, K, O> implem
|
||||
Schema writerSchema;
|
||||
boolean isValid;
|
||||
try {
|
||||
TableSchemaResolver schemaUtil = new TableSchemaResolver(getMetaClient());
|
||||
TableSchemaResolver schemaResolver = new TableSchemaResolver(getMetaClient());
|
||||
writerSchema = HoodieAvroUtils.createHoodieWriteSchema(config.getSchema());
|
||||
tableSchema = HoodieAvroUtils.createHoodieWriteSchema(schemaUtil.getTableAvroSchemaWithoutMetadataFields());
|
||||
tableSchema = HoodieAvroUtils.createHoodieWriteSchema(schemaResolver.getTableAvroSchemaWithoutMetadataFields());
|
||||
isValid = TableSchemaResolver.isSchemaCompatible(tableSchema, writerSchema);
|
||||
} catch (Exception e) {
|
||||
throw new HoodieException("Failed to read schema/check compatibility for base path " + metaClient.getBasePath(), e);
|
||||
|
||||
@@ -111,13 +111,13 @@ public abstract class HoodieCompactor<T extends HoodieRecordPayload, I, K, O> im
|
||||
table.getMetaClient().reloadActiveTimeline();
|
||||
|
||||
HoodieTableMetaClient metaClient = table.getMetaClient();
|
||||
TableSchemaResolver schemaUtil = new TableSchemaResolver(metaClient);
|
||||
TableSchemaResolver schemaResolver = new TableSchemaResolver(metaClient);
|
||||
|
||||
// Here we firstly use the table schema as the reader schema to read
|
||||
// log file.That is because in the case of MergeInto, the config.getSchema may not
|
||||
// the same with the table schema.
|
||||
try {
|
||||
Schema readerSchema = schemaUtil.getTableAvroSchema(false);
|
||||
Schema readerSchema = schemaResolver.getTableAvroSchema(false);
|
||||
config.setSchema(readerSchema.toString());
|
||||
} catch (Exception e) {
|
||||
// If there is no commit in the table, just ignore the exception.
|
||||
|
||||
Reference in New Issue
Block a user