-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Assign default value to newly added derived column upon reload #12648
Conversation
This change is intended to handle the case where the derived column depends on upstream data which is not a column in the table schema
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12648 +/- ##
============================================
- Coverage 61.75% 61.34% -0.41%
+ Complexity 207 198 -9
============================================
Files 2436 2452 +16
Lines 133233 133847 +614
Branches 20636 20765 +129
============================================
- Hits 82274 82109 -165
- Misses 44911 45577 +666
- Partials 6048 6161 +113
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
// TODO: Support creation of derived columns from forward index disabled columns | ||
if (!_segmentWriter.hasIndexFor(argument, StandardIndexes.forward())) { | ||
// replace the transform function with the default value for the derived column | ||
String expression = _schema.getFieldSpecFor(column).getDefaultNullValueString(); |
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.
You can simply short circuit it by invoking createDefaultValueColumnV1Indices(column)
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.
Yes, much better. Thanks for pointing it out!
reverted the changes and did as you suggested.
This reverts commit 331983b.
…argument in schema
This change is intended to handle the case where the derived column depends on upstream data which is not a column in the table schema. Currently it fails reloading the existing segments as existing segments don’t have this data available. With this PR the newly added derived column will be assigned the default null value in such cases so that user is able to query the column across all segments.