org.apache.hadoop.hive.ql.exec.vector.expressions
Class NullUtil

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil

public class NullUtil
extends Object

Utility functions to handle null propagation.


Constructor Summary
NullUtil()
           
 
Method Summary
static int filterNulls(ColumnVector v, boolean selectedInUse, int[] sel, int n)
          Filter out rows with null values.
static void initOutputNullsToFalse(ColumnVector v, boolean isRepeating, boolean selectedInUse, int[] sel, int n)
           
static void propagateNullsColCol(ColumnVector inputColVector1, ColumnVector inputColVector2, ColumnVector outputColVector, int[] sel, int n, boolean selectedInUse)
           
static void setNullAndDivBy0DataEntriesDouble(DoubleColumnVector v, boolean selectedInUse, int[] sel, int n, DoubleColumnVector denoms)
          Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for DoubleColumnVector.NULL_VALUE.
static void setNullAndDivBy0DataEntriesDouble(DoubleColumnVector v, boolean selectedInUse, int[] sel, int n, LongColumnVector denoms)
          Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for DoubleColumnVector.NULL_VALUE.
static void setNullAndDivBy0DataEntriesLong(LongColumnVector v, boolean selectedInUse, int[] sel, int n, DoubleColumnVector denoms)
          Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for LongColumnVector.NULL_VALUE.
static void setNullAndDivBy0DataEntriesLong(LongColumnVector v, boolean selectedInUse, int[] sel, int n, LongColumnVector denoms)
          Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for LongColumnVector.NULL_VALUE.
static void setNullDataEntriesDecimal(DecimalColumnVector v, boolean selectedInUse, int[] sel, int n)
          Follow the convention that null decimal values are internally set to the smallest positive value available.
static void setNullDataEntriesDouble(DoubleColumnVector v, boolean selectedInUse, int[] sel, int n)
          Set the data value for all NULL entries to NaN
static void setNullDataEntriesLong(LongColumnVector v, boolean selectedInUse, int[] sel, int n)
          Set the data value for all NULL entries to the designated NULL_VALUE.
static void setNullOutputEntriesColScalar(ColumnVector v, boolean selectedInUse, int[] sel, int n)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullUtil

public NullUtil()
Method Detail

setNullDataEntriesLong

public static void setNullDataEntriesLong(LongColumnVector v,
                                          boolean selectedInUse,
                                          int[] sel,
                                          int n)
Set the data value for all NULL entries to the designated NULL_VALUE.


setNullOutputEntriesColScalar

public static void setNullOutputEntriesColScalar(ColumnVector v,
                                                 boolean selectedInUse,
                                                 int[] sel,
                                                 int n)

setNullDataEntriesDouble

public static void setNullDataEntriesDouble(DoubleColumnVector v,
                                            boolean selectedInUse,
                                            int[] sel,
                                            int n)
Set the data value for all NULL entries to NaN


setNullAndDivBy0DataEntriesDouble

public static void setNullAndDivBy0DataEntriesDouble(DoubleColumnVector v,
                                                     boolean selectedInUse,
                                                     int[] sel,
                                                     int n,
                                                     LongColumnVector denoms)
Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for DoubleColumnVector.NULL_VALUE.


setNullAndDivBy0DataEntriesDouble

public static void setNullAndDivBy0DataEntriesDouble(DoubleColumnVector v,
                                                     boolean selectedInUse,
                                                     int[] sel,
                                                     int n,
                                                     DoubleColumnVector denoms)
Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for DoubleColumnVector.NULL_VALUE.


setNullAndDivBy0DataEntriesLong

public static void setNullAndDivBy0DataEntriesLong(LongColumnVector v,
                                                   boolean selectedInUse,
                                                   int[] sel,
                                                   int n,
                                                   LongColumnVector denoms)
Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for LongColumnVector.NULL_VALUE.


setNullAndDivBy0DataEntriesLong

public static void setNullAndDivBy0DataEntriesLong(LongColumnVector v,
                                                   boolean selectedInUse,
                                                   int[] sel,
                                                   int n,
                                                   DoubleColumnVector denoms)
Set all the entries for which denoms array contains zeroes to NULL; sets all the data values for NULL entries for LongColumnVector.NULL_VALUE.


propagateNullsColCol

public static void propagateNullsColCol(ColumnVector inputColVector1,
                                        ColumnVector inputColVector2,
                                        ColumnVector outputColVector,
                                        int[] sel,
                                        int n,
                                        boolean selectedInUse)

setNullDataEntriesDecimal

public static void setNullDataEntriesDecimal(DecimalColumnVector v,
                                             boolean selectedInUse,
                                             int[] sel,
                                             int n)
Follow the convention that null decimal values are internally set to the smallest positive value available. Prevents accidental zero-divide later in expression evaluation.


initOutputNullsToFalse

public static void initOutputNullsToFalse(ColumnVector v,
                                          boolean isRepeating,
                                          boolean selectedInUse,
                                          int[] sel,
                                          int n)

filterNulls

public static int filterNulls(ColumnVector v,
                              boolean selectedInUse,
                              int[] sel,
                              int n)
Filter out rows with null values. Return the number of rows in the batch.



Copyright © 2014 The Apache Software Foundation. All rights reserved.