Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public RleAwarePositionsAppender(BlockPositionIsDistinctFrom isDistinctFromOpera
@Override
public void append(IntArrayList positions, Block source)
{
// RleAwarePositionsAppender should be used with FlatteningPositionsAppender that makes sure
// RleAwarePositionsAppender should be used with UnnestingPositionsAppender that makes sure
// append is called only with flat block
checkArgument(!(source instanceof RunLengthEncodedBlock));
checkArgument(!(source instanceof RunLengthEncodedBlock), "Append should be called with non-RLE block but got %s", source);
switchToFlat();
delegate.append(positions, source);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public long getSizeInBytes()
private void appendDictionary(IntArrayList positions, DictionaryBlock source)
{
Block dictionary = source.getDictionary();
if (dictionary instanceof RunLengthEncodedBlock rleDictionary) {
appendRle(rleDictionary.getValue(), positions.size());
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to create a test ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible at the moment but it will be brittle as we don't want blocks like that so the test may stop covering this case at any time e.g. after #17842 is merged

IntArrayList dictionaryPositions = getDictionaryPositions(positions, source);
if (dictionaryBlockBuilder.canAppend(dictionary)) {
dictionaryBlockBuilder.append(dictionaryPositions, dictionary);
Expand Down