Repository: hive Updated Branches: refs/heads/master 82590226a -> ad106f0c4
HIVE-18286 - java.lang.ClassCastException: org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector cannot be cast to org.apache.hadoop.hive.ql.exec.vector.LongColumnVector (Eugene Koifman, reviewed by Alan Gates) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/ad106f0c Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/ad106f0c Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/ad106f0c Branch: refs/heads/master Commit: ad106f0c4378b10e9c6ef11116e1620bae689ba8 Parents: 8259022 Author: Eugene Koifman <ekoif...@hortonworks.com> Authored: Mon Dec 18 14:13:02 2017 -0800 Committer: Eugene Koifman <ekoif...@hortonworks.com> Committed: Mon Dec 18 14:13:02 2017 -0800 ---------------------------------------------------------------------- .../io/orc/VectorizedOrcAcidRowBatchReader.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/ad106f0c/ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java index d571bd0..990e0cb 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java @@ -415,7 +415,9 @@ public class VectorizedOrcAcidRowBatchReader * If there are deletes and reading original file, we must produce synthetic ROW_IDs in order * to see if any deletes apply */ - if(needSyntheticRowIds(true, !deleteEventRegistry.isEmpty(), rowIdProjected)) { + boolean needSyntheticRowId = + needSyntheticRowIds(true, !deleteEventRegistry.isEmpty(), rowIdProjected); + if(needSyntheticRowId) { assert syntheticProps != null && syntheticProps.rowIdOffset >= 0 : "" + syntheticProps; assert syntheticProps != null && syntheticProps.bucketProperty >= 0 : "" + syntheticProps; if(innerReader == null) { @@ -459,8 +461,19 @@ public class VectorizedOrcAcidRowBatchReader // txnid:0 which is always committed so there is no need to check wrt invalid transactions //But originals written by Load Data for example can be in base_x or delta_x_x so we must //check if 'x' is committed or not evn if ROW_ID is not needed in the Operator pipeline. - findRecordsWithInvalidTransactionIds(innerRecordIdColumnVector, - vectorizedRowBatchBase.size, selectedBitSet); + if (needSyntheticRowId) { + findRecordsWithInvalidTransactionIds(innerRecordIdColumnVector, + vectorizedRowBatchBase.size, selectedBitSet); + } else { + /*since ROW_IDs are not needed we didn't create the ColumnVectors to hold them but we + * still have to check if the data being read is committed as far as current + * reader (transactions) is concerned. Since here we are reading 'original' schema file, + * all rows in it have been created by the same txn, namely 'syntheticProps.syntheticTxnId' + */ + if (!validTxnList.isTxnValid(syntheticProps.syntheticTxnId)) { + selectedBitSet.clear(0, vectorizedRowBatchBase.size); + } + } } } else {