1
0

Revert "Read and apply schema for each log block from the metadata header instead of the latest schema"

This reverts commit 9e7ce19b06.
This commit is contained in:
Balaji Varadarajan
2019-04-18 00:44:01 -07:00
committed by Balaji Varadarajan
parent 9ef51deb84
commit 2f1e3e15fb
2 changed files with 2 additions and 52 deletions

View File

@@ -197,17 +197,12 @@ class HoodieLogFileReader implements HoodieLogFormat.Reader {
switch (blockType) {
// based on type read the block
case AVRO_DATA_BLOCK:
Schema readerSchemaForBlock = readerSchema;
if (header != null) {
String schema = header.get(HeaderMetadataType.SCHEMA);
readerSchemaForBlock = schema != null ? new Schema.Parser().parse(schema) : readerSchema;
}
if (nextBlockVersion.getVersion() == HoodieLogFormatVersion.DEFAULT_VERSION) {
return HoodieAvroDataBlock.getBlock(content, readerSchemaForBlock);
return HoodieAvroDataBlock.getBlock(content, readerSchema);
} else {
return HoodieAvroDataBlock
.getBlock(logFile, inputStream, Optional.ofNullable(content), readBlockLazily,
contentPosition, contentLength, blockEndPos, readerSchemaForBlock, header, footer);
contentPosition, contentLength, blockEndPos, readerSchema, header, footer);
}
case DELETE_BLOCK:
return HoodieDeleteBlock