Search in sources :

Example 6 with GenericUDFOPNull

use of org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNull in project hive by apache.

the class TestPositivePartitionPrunerCompactExpr method data.

@Parameterized.Parameters(name = "{index}: {0} => {1}")
public static Iterable<Object[]> data() {
    ExprNodeDesc trueExpr = new ExprNodeConstantDesc(Boolean.TRUE);
    ExprNodeDesc falseExpr = new ExprNodeConstantDesc(Boolean.FALSE);
    ExprNodeDesc col1Expr = new ExprNodeColumnDesc(TypeInfoFactory.booleanTypeInfo, "col1", "t1", true);
    ExprNodeDesc col2Expr = new ExprNodeColumnDesc(TypeInfoFactory.booleanTypeInfo, "col2", "t1", true);
    ExprNodeDesc udf1Expr = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPNull(), Arrays.<ExprNodeDesc>asList(col1Expr));
    ExprNodeDesc udf2Expr = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPNull(), Arrays.<ExprNodeDesc>asList(col2Expr));
    return Arrays.asList(new Object[][] { { null, null }, { and(null, null), null }, { and(falseExpr, null), "false" }, { and(null, falseExpr), "false" }, { and(trueExpr, null), null }, { and(null, trueExpr), null }, { and(udf1Expr, null), "col1 is null" }, { and(null, udf2Expr), "col2 is null" }, { and(udf1Expr, udf2Expr), "(col1 is null and col2 is null)" }, { and(falseExpr, falseExpr), "false" }, { and(trueExpr, falseExpr), "false" }, { and(falseExpr, trueExpr), "false" }, { and(udf1Expr, falseExpr), "false" }, { and(falseExpr, udf2Expr), "false" }, { and(trueExpr, trueExpr), "true" }, { and(udf1Expr, trueExpr), "col1 is null" }, { and(trueExpr, udf2Expr), "col2 is null" }, { or(null, null), null }, { or(falseExpr, null), null }, { or(null, falseExpr), null }, { or(trueExpr, null), "true" }, { or(null, trueExpr), "true" }, { or(udf1Expr, null), null }, { or(null, udf2Expr), null }, { or(udf1Expr, udf2Expr), "(col1 is null or col2 is null)" }, { or(falseExpr, falseExpr), "false" }, { or(trueExpr, falseExpr), "true" }, { or(falseExpr, trueExpr), "true" }, { or(udf1Expr, falseExpr), "col1 is null" }, { or(falseExpr, udf2Expr), "col2 is null" }, { or(trueExpr, trueExpr), "true" }, { or(udf1Expr, trueExpr), "true" }, { or(trueExpr, udf2Expr), "true" }, { or(and(udf1Expr, udf2Expr), udf2Expr), "((col1 is null and col2 is null) or col2 is null)" }, { and(or(udf1Expr, udf2Expr), udf2Expr), "((col1 is null or col2 is null) and col2 is null)" } });
}
Also used : ExprNodeConstantDesc(org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc) GenericUDFOPNull(org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNull) ExprNodeColumnDesc(org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc) ExprNodeGenericFuncDesc(org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc) ExprNodeDesc(org.apache.hadoop.hive.ql.plan.ExprNodeDesc)

Aggregations

ExprNodeDesc (org.apache.hadoop.hive.ql.plan.ExprNodeDesc)6 GenericUDFOPNull (org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNull)6 ExprNodeColumnDesc (org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc)5 ExprNodeGenericFuncDesc (org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc)5 ArrayList (java.util.ArrayList)4 ExprNodeConstantDesc (org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc)4 GenericUDF (org.apache.hadoop.hive.ql.udf.generic.GenericUDF)3 GenericUDFOPNot (org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNot)3 GenericUDFOPNotNull (org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPNotNull)3 GenericUDFBaseCompare (org.apache.hadoop.hive.ql.udf.generic.GenericUDFBaseCompare)2 List (java.util.List)1 DataTypePhysicalVariation (org.apache.hadoop.hive.common.type.DataTypePhysicalVariation)1 ColumnInfo (org.apache.hadoop.hive.ql.exec.ColumnInfo)1 VectorRandomBatchSource (org.apache.hadoop.hive.ql.exec.vector.VectorRandomBatchSource)1 VectorRandomRowSource (org.apache.hadoop.hive.ql.exec.vector.VectorRandomRowSource)1 GenerationSpec (org.apache.hadoop.hive.ql.exec.vector.VectorRandomRowSource.GenerationSpec)1 VectorExpression (org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression)1 ExprNodeFieldDesc (org.apache.hadoop.hive.ql.plan.ExprNodeFieldDesc)1 GenericUDFBetween (org.apache.hadoop.hive.ql.udf.generic.GenericUDFBetween)1 GenericUDFIn (org.apache.hadoop.hive.ql.udf.generic.GenericUDFIn)1