trushev commented on PR #5830:
URL: https://github.com/apache/hudi/pull/5830#issuecomment-1318006019
> 1. fetch the original schema when the file was committed, read the record
as is
is it possible to fetch the original schema when the file was committed if
SE disabled?
> I would suggest we only do 1 for all kinds of input formats, and wrap
another format only for schema evolution by doing step2, WDYT ?
Yes it sounds reasonable. Moreover, I've already tried it:) and faced with
one problem. Mb you know how to solve it. When SE enabled we can't do the
first step "read the record as is" because `int[] selectedFields` is based on
latest read schema (aka querySchema) not on file schema (aka actualSchema). So
we need additional `step 0`
0. Prepare `int[] selectedFields` according to actual schema (if SE enabled)
1. fetch the original schema when the file was committed, read the record as
is
2. project the record with latest read schema if needed (if SE enabled)
So "wrap another format" looks likes:
```java
InputFormat inputFormat;
if (SE.enabled) {
inputFormat = new ProjectFormat(new ReadAsIsFormat(new PrepareFormat()))
} else {
inputFormat = new ReadAsIsFormat()
}
```
I mean, this is a solvable problem, but the solution is more complicated
than this PR
--
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]