-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Timestamp millis repair #14120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timestamp millis repair #14120
Changes from 13 commits
e46d157
513e8a1
bb4a278
814d442
3ed9ee7
c6c6caa
2f447c2
be727d9
639e57c
c1179df
50a64cd
7441315
0b83171
2450d9b
0eb01ca
5090d2e
674babb
796e7f0
0ffcc96
6231af6
5b89d6d
bb4f550
3e7a298
f297231
b0933c0
6a6836f
a5ac68a
47506f6
758645e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -45,6 +45,7 @@ | |||
| import org.apache.avro.io.DecoderFactory; | ||||
| import org.apache.avro.io.Encoder; | ||||
| import org.apache.avro.io.EncoderFactory; | ||||
| import org.apache.parquet.schema.AvroSchemaRepair; | ||||
|
|
||||
| import javax.annotation.Nonnull; | ||||
|
|
||||
|
|
@@ -187,11 +188,12 @@ private RecordIterator(Schema readerSchema, Schema writerSchema, byte[] content) | |||
| this.totalRecords = this.dis.readInt(); | ||||
| } | ||||
|
|
||||
| if (recordNeedsRewriteForExtendedAvroTypePromotion(writerSchema, readerSchema)) { | ||||
| this.reader = new GenericDatumReader<>(writerSchema, writerSchema); | ||||
| Schema repairedWriterSchema = AvroSchemaRepair.repairLogicalTypes(writerSchema, readerSchema); | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the writer schema and reader schema are both schema from the log header which is actually the same, the fix seems not working as expected.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then how does the existing evolution fixes like recordNeedsRewriteForExtendedAvroTypePromotion work then? I will validate to see if the fix is working, but the schemas should be able to be different
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, looks like if there is no schema evolution, the read schema is right: hudi/hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java Line 223 in 5fe72cb
HoodieDataBlock constructors.
And we should invoke |
||||
| if (recordNeedsRewriteForExtendedAvroTypePromotion(repairedWriterSchema, readerSchema)) { | ||||
| this.reader = new GenericDatumReader<>(repairedWriterSchema, repairedWriterSchema); | ||||
| this.promotedSchema = Option.of(readerSchema); | ||||
| } else { | ||||
| this.reader = new GenericDatumReader<>(writerSchema, readerSchema); | ||||
| this.reader = new GenericDatumReader<>(repairedWriterSchema, readerSchema); | ||||
| } | ||||
| } | ||||
|
|
||||
|
|
@@ -272,11 +274,12 @@ private StreamingRecordIterator(Schema readerSchema, Schema writerSchema, Seekab | |||
| this.totalRecords = this.inputStream.readInt(); | ||||
| } | ||||
|
|
||||
| if (recordNeedsRewriteForExtendedAvroTypePromotion(writerSchema, readerSchema)) { | ||||
| this.reader = new GenericDatumReader<>(writerSchema, writerSchema); | ||||
| Schema repairedWriterSchema = AvroSchemaRepair.repairLogicalTypes(writerSchema, readerSchema); | ||||
| if (recordNeedsRewriteForExtendedAvroTypePromotion(repairedWriterSchema, readerSchema)) { | ||||
| this.reader = new GenericDatumReader<>(repairedWriterSchema, repairedWriterSchema); | ||||
| this.promotedSchema = Option.of(readerSchema); | ||||
| } else { | ||||
| this.reader = new GenericDatumReader<>(writerSchema, readerSchema); | ||||
| this.reader = new GenericDatumReader<>(repairedWriterSchema, readerSchema); | ||||
| } | ||||
|
|
||||
| this.buffer = ByteBuffer.allocate(Math.min(bufferSize, Math.toIntExact(contentLocation.getBlockSize()))); | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is fix for the Avro parquet reader? Also, the Hive reader needs a fix too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be ensured that the
readContext.getRequestedSchemacoming from the parquet footer?