You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Sergey Shelukhin (JIRA)" <ji...@apache.org> on 2016/01/15 20:00:40 UTC

[jira] [Commented] (HIVE-12827) Vectorization: VectorCopyRow/VectorAssignRow/VectorDeserializeRow assign needs explicit isNull[offset] modification

    [ https://issues.apache.org/jira/browse/HIVE-12827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15102304#comment-15102304 ] 

Sergey Shelukhin commented on HIVE-12827:
-----------------------------------------

+1. Did the fill() on the main path get committed, and does it need to be removed with this patch?

> Vectorization: VectorCopyRow/VectorAssignRow/VectorDeserializeRow assign needs explicit isNull[offset] modification
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-12827
>                 URL: https://issues.apache.org/jira/browse/HIVE-12827
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Gopal V
>            Assignee: Gopal V
>         Attachments: HIVE-12827.2.patch
>
>
> Some scenarios do set Double.NaN instead of isNull=true, but all types aren't consistent.
> Examples of un-set isNull for the valid values are 
> {code}
>   private class FloatReader extends AbstractDoubleReader {
>     FloatReader(int columnIndex) {
>       super(columnIndex);
>     }
>     @Override
>     void apply(VectorizedRowBatch batch, int batchIndex) throws IOException {
>       DoubleColumnVector colVector = (DoubleColumnVector) batch.cols[columnIndex];
>       if (deserializeRead.readCheckNull()) {
>         VectorizedBatchUtil.setNullColIsNullValue(colVector, batchIndex);
>       } else {
>         float value = deserializeRead.readFloat();
>         colVector.vector[batchIndex] = (double) value;
>       }
>     }
>   }
> {code}
> {code}
>   private class DoubleCopyRow extends CopyRow {
>     DoubleCopyRow(int inColumnIndex, int outColumnIndex) {
>       super(inColumnIndex, outColumnIndex);
>     }
>     @Override
>     void copy(VectorizedRowBatch inBatch, int inBatchIndex, VectorizedRowBatch outBatch, int outBatchIndex) {
>       DoubleColumnVector inColVector = (DoubleColumnVector) inBatch.cols[inColumnIndex];
>       DoubleColumnVector outColVector = (DoubleColumnVector) outBatch.cols[outColumnIndex];
>       if (inColVector.isRepeating) {
>         if (inColVector.noNulls || !inColVector.isNull[0]) {
>           outColVector.vector[outBatchIndex] = inColVector.vector[0];
>         } else {
>           VectorizedBatchUtil.setNullColIsNullValue(outColVector, outBatchIndex);
>         }
>       } else {
>         if (inColVector.noNulls || !inColVector.isNull[inBatchIndex]) {
>           outColVector.vector[outBatchIndex] = inColVector.vector[inBatchIndex];
>         } else {
>           VectorizedBatchUtil.setNullColIsNullValue(outColVector, outBatchIndex);
>         }
>       }
>     }
>   }
> {code}
> {code}
>  private static abstract class VectorDoubleColumnAssign
>     extends VectorColumnAssignVectorBase<DoubleColumnVector> {
>     protected void assignDouble(double value, int destIndex) {
>       outCol.vector[destIndex] = value;
>     }
>   }
> {code}
> The pattern to imitate would be the earlier code from VectorBatchUtil
> {code}
>     case DOUBLE: {
>       DoubleColumnVector dcv = (DoubleColumnVector) batch.cols[offset + colIndex];
>       if (writableCol != null) {
>         dcv.vector[rowIndex] = ((DoubleWritable) writableCol).get();
>         dcv.isNull[rowIndex] = false;
>       } else {
>         dcv.vector[rowIndex] = Double.NaN;
>         setNullColIsNullValue(dcv, rowIndex);
>       }
>     }
>       break;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)