Skip to content
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

Merged

Conversation

lukasz-stec
Copy link
Member

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:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Feb 2, 2023
In case of null projection with UnknownType,
Rle with null ByteArrayBlock value is created.
This breaks RowPositionsAppender assumption
about incoming block type.
@lukasz-stec lukasz-stec force-pushed the ls/064-row-appender-null-project branch from 669608d to dd4e339 Compare February 2, 2023 15:03
@lukasz-stec lukasz-stec marked this pull request as ready for review February 3, 2023 09:28
@lukasz-stec lukasz-stec requested review from sopel39 and Dith3r February 3, 2023 09:30
@@ -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) {
Copy link
Member

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))
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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

@sopel39
Copy link
Member

sopel39 commented Feb 3, 2023

CI hit: #15429

@sopel39 sopel39 merged commit f38f7df into trinodb:master Feb 3, 2023
@sopel39 sopel39 mentioned this pull request Feb 3, 2023
@github-actions github-actions bot added this to the 407 milestone Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants