diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorMapOperator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorMapOperator.java index 1ac8914516..e8c73a944a 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorMapOperator.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorMapOperator.java @@ -385,6 +385,9 @@ public VectorPartitionContext createAndInitPartitionContext(PartitionDesc partDe throws SerDeException, Exception { VectorPartitionDesc vectorPartDesc = partDesc.getVectorPartitionDesc(); + if (vectorPartDesc == null) { + return null; + } VectorPartitionContext vectorPartitionContext; VectorMapOperatorReadType vectorMapOperatorReadType = vectorPartDesc.getVectorMapOperatorReadType(); @@ -631,6 +634,10 @@ private void setRowIdentiferToNull(VectorizedRowBatch batch) { private void setupPartitionContextVars(String nominalPath) throws HiveException { currentVectorPartContext = fileToPartitionContextMap.get(nominalPath); + if (currentVectorPartContext == null) { + return; + } + PartitionDesc partDesc = currentVectorPartContext.getPartDesc(); VectorPartitionDesc vectorPartDesc = partDesc.getVectorPartitionDesc(); currentReadType = vectorPartDesc.getVectorMapOperatorReadType(); diff --git a/ql/src/test/queries/clientpositive/vectorized_parquet.q b/ql/src/test/queries/clientpositive/vectorized_parquet.q index e6ebdaac62..db02ec04a5 100644 --- a/ql/src/test/queries/clientpositive/vectorized_parquet.q +++ b/ql/src/test/queries/clientpositive/vectorized_parquet.q @@ -46,3 +46,6 @@ select ctinyint, stddev_pop(cdouble) from alltypes_parquet group by ctinyint; + +CREATE TABLE empty_parquet(x int) PARTITIONED BY (y int) stored as parquet; +select * from empty_parquet t1 join empty_parquet t2 where t1.x=t2.x; diff --git a/ql/src/test/results/clientpositive/llap/vectorized_parquet.q.out b/ql/src/test/results/clientpositive/llap/vectorized_parquet.q.out index e904286cb4..8a84d3dc22 100644 --- a/ql/src/test/results/clientpositive/llap/vectorized_parquet.q.out +++ b/ql/src/test/results/clientpositive/llap/vectorized_parquet.q.out @@ -348,3 +348,19 @@ NULL 1073418988 -16379 3115 NULL 305051.4870777435 55 626923679 -15887 21 55.0 9826.38569192808 61 626923679 -15894 29 61.0 8785.714950987198 62 626923679 -14307 17 62.0 9491.752726667326 +PREHOOK: query: CREATE TABLE empty_parquet(x int) PARTITIONED BY (y int) stored as parquet +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@empty_parquet +POSTHOOK: query: CREATE TABLE empty_parquet(x int) PARTITIONED BY (y int) stored as parquet +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@empty_parquet +PREHOOK: query: select * from empty_parquet t1 join empty_parquet t2 where t1.x=t2.x +PREHOOK: type: QUERY +PREHOOK: Input: default@empty_parquet +#### A masked pattern was here #### +POSTHOOK: query: select * from empty_parquet t1 join empty_parquet t2 where t1.x=t2.x +POSTHOOK: type: QUERY +POSTHOOK: Input: default@empty_parquet +#### A masked pattern was here ####