From a79862602408c85f3af7fd3a3b5f64ace0f5ffdc Mon Sep 17 00:00:00 2001 From: "oerling@fb.com" Date: Wed, 30 Oct 2019 14:02:06 -0700 Subject: [PATCH] Fix getBlockView for all-null SliceDictionarySelectiveReader --- .../presto/orc/reader/SliceDictionarySelectiveReader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDictionarySelectiveReader.java b/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDictionarySelectiveReader.java index 27e364d2b79bb..c8f5ba7e7926b 100644 --- a/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDictionarySelectiveReader.java +++ b/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDictionarySelectiveReader.java @@ -411,6 +411,9 @@ public BlockLease getBlockView(int[] positions, int positionCount) checkState(positionCount <= outputPositionCount, "Not enough values"); checkState(!valuesInUse, "BlockLease hasn't been closed yet"); + if (allNulls) { + return newLease(new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), positionCount)); + } if (positionCount < outputPositionCount) { compactValues(positions, positionCount); }