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)" } });
}
Aggregations