-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix null projects handling in RowPositionsAppender #15948
Fix null projects handling in RowPositionsAppender #15948
Conversation
In case of null projection with UnknownType, Rle with null ByteArrayBlock value is created. This breaks RowPositionsAppender assumption about incoming block type.
669608d
to
dd4e339
Compare
@@ -100,20 +110,29 @@ public void append(IntArrayList positions, Block block) | |||
public void appendRle(Block value, int rlePositionCount) | |||
{ | |||
ensureCapacity(rlePositionCount); | |||
AbstractRowBlock sourceRowBlock = (AbstractRowBlock) value; | |||
if (sourceRowBlock.isNull(0)) { | |||
if (value instanceof AbstractRowBlock sourceRowBlock) { |
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.
nit: I think there might be other places where we assume AbstractRowBlock
always
@@ -270,6 +273,7 @@ public void testRowWithNestedFields() | |||
public static Object[][] types() | |||
{ | |||
return Arrays.stream(TestType.values()) | |||
.filter(testType -> !testType.equals(TestType.UNKNOWN)) |
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.
nit: why to filter it
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.
UnknownType
does not support values other than null and tests are producing non null blocks based on the type provided
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.
would be good to add comment
CI hit: #15429 |
Description
In case of null projection with UnknownType,
Rle with null ByteArrayBlock value is created.
This breaks RowPositionsAppender assumption
about incoming block type.
Additional context and related issues
Release notes
( X) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: