-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix null projects handling in RowPositionsAppender #15948
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
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 |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| import io.trino.spi.type.VarbinaryType; | ||
| import io.trino.spi.type.VarcharType; | ||
| import io.trino.type.BlockTypeOperators; | ||
| import io.trino.type.UnknownType; | ||
| import it.unimi.dsi.fastutil.ints.IntArrayList; | ||
| import org.testng.annotations.DataProvider; | ||
| import org.testng.annotations.Test; | ||
|
|
@@ -93,6 +94,8 @@ public void testMixedBlockTypes(TestType type) | |
| List<BlockView> input = ImmutableList.of( | ||
| input(emptyBlock(type)), | ||
| input(nullBlock(type, 3), 0, 2), | ||
| input(nullBlock(TestType.UNKNOWN, 3), 0, 2), // a := null projections are handled by UnknownType null block | ||
| input(nullBlock(TestType.UNKNOWN, 1), 0), // a := null projections are handled by UnknownType null block, 1 position uses non RLE block | ||
| input(notNullBlock(type, 3), 1, 2), | ||
| input(partiallyNullBlock(type, 4), 0, 1, 2, 3), | ||
| input(partiallyNullBlock(type, 4)), // empty position list | ||
|
|
@@ -270,6 +273,7 @@ public void testRowWithNestedFields() | |
| public static Object[][] types() | ||
| { | ||
| return Arrays.stream(TestType.values()) | ||
| .filter(testType -> !testType.equals(TestType.UNKNOWN)) | ||
|
Member
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. nit: why to filter it
Member
Author
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.
Member
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. would be good to add comment |
||
| .map(type -> new Object[] {type}) | ||
| .toArray(Object[][]::new); | ||
| } | ||
|
|
@@ -434,7 +438,8 @@ private enum TestType | |
| LONG_TIMESTAMP(createTimestampType(9)), | ||
| ROW_BIGINT_VARCHAR(anonymousRow(BigintType.BIGINT, VarcharType.VARCHAR)), | ||
| ARRAY_BIGINT(new ArrayType(BigintType.BIGINT)), | ||
| VARCHAR_WITH_TEST_BLOCK(VarcharType.VARCHAR, TestVariableWidthBlock.adaptation()); | ||
| VARCHAR_WITH_TEST_BLOCK(VarcharType.VARCHAR, TestVariableWidthBlock.adaptation()), | ||
| UNKNOWN(UnknownType.UNKNOWN); | ||
|
|
||
| private final Type type; | ||
| private final Function<Block, Block> blockAdaptation; | ||
|
|
||
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
AbstractRowBlockalways