-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[HUDI-8427] Fix delete in file group reader and re-enable test in TestHoodieSparkMergeOnReadTableInsertUpdateDelete #12283
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -53,6 +53,7 @@ | |
import org.apache.hadoop.io.ArrayWritable; | ||
import org.apache.hadoop.io.NullWritable; | ||
import org.apache.hadoop.io.Writable; | ||
import org.apache.hadoop.io.WritableComparable; | ||
import org.apache.hadoop.mapred.FileSplit; | ||
import org.apache.hadoop.mapred.InputSplit; | ||
import org.apache.hadoop.mapred.JobConf; | ||
|
@@ -265,10 +266,10 @@ public UnaryOperator<ArrayWritable> projectRecord(Schema from, Schema to, Map<St | |
@Override | ||
public Comparable castValue(Comparable value, Schema.Type newType) { | ||
//TODO: [HUDI-8261] actually do casting here | ||
if (newType == Schema.Type.STRING) { | ||
return value.toString(); | ||
if (value instanceof WritableComparable) { | ||
return value; | ||
} | ||
return value; | ||
return (WritableComparable) HoodieRealtimeRecordReaderUtils.avroToArrayWritable(value, Schema.create(newType)); | ||
jonvex marked this conversation as resolved.
Show resolved
Hide resolved
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. 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. No, it doesn't fix everything, but I think it might be worth it to fix that here as well 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. Spent some time trying to fix 8261. I think it's too complex to get into 1.0.0 |
||
} | ||
|
||
public UnaryOperator<ArrayWritable> reverseProjectRecord(Schema from, Schema to) { | ||
|
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.
Does this mean that without preCombine field it does not work? I've marked this test to be revisited by HUDI-8551.
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.
the test data gen creates the record with an ordering field of type long. If precombine is not set, then we default to int in the filegroup reader. So then when we read the records we try to cast the long to an int which fails. timestamp field is long, so then we don't need to do any casting.
What is also interesting is that there are 3 more constructors for RawTripTestPayload. 2 of them take in any Comparable as the ordering value. The final one sets it as an int: