本文整理汇总了Java中org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqualOrLessThan类的典型用法代码示例。如果您正苦于以下问题:Java GenericUDFOPEqualOrLessThan类的具体用法?Java GenericUDFOPEqualOrLessThan怎么用?Java GenericUDFOPEqualOrLessThan使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenericUDFOPEqualOrLessThan类属于org.apache.hadoop.hive.ql.udf.generic包,在下文中一共展示了GenericUDFOPEqualOrLessThan类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDataForSinglePredicate
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqualOrLessThan; //导入依赖的package包/类
/**
* Data provider for a predicate with single function.
*
* @return the require arguments: an expression node and respective null/non-null check
* for the pushed predicate and residual predicate
*/
@DataProvider
private Object[][] getDataForSinglePredicate() {
return new Object[][]{
{getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPEqual()), NullCheck.NotNull, NullCheck.Null,
new SingleColumnValueFilter("c1", CompareOp.EQUAL, 10)},
{getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPLessThan()), NullCheck.NotNull, NullCheck.Null,
new SingleColumnValueFilter("c1", CompareOp.LESS, 10)},
{getExprNodeDesc(TypeInfoFactory.stringTypeInfo, "c1", "10", TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPEqual()), NullCheck.NotNull, NullCheck.Null,
new SingleColumnValueFilter("c1", CompareOp.EQUAL, "10")},
{getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPEqualOrLessThan()), NullCheck.NotNull, NullCheck.Null,
new SingleColumnValueFilter("c1", CompareOp.LESS_OR_EQUAL, "10")},
{getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPGreaterThan()), NullCheck.NotNull, NullCheck.Null,
new SingleColumnValueFilter("c1", CompareOp.GREATER, 10)},
{getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPEqualOrGreaterThan()), NullCheck.NotNull, NullCheck.Null,
new SingleColumnValueFilter("c1", CompareOp.GREATER_OR_EQUAL, 10)},
{getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPNotEqual()), NullCheck.NotNull, NullCheck.Null,
new SingleColumnValueFilter("c1", CompareOp.NOT_EQUAL, 10)},
{getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo,
new GenericUDFOPMultiply()), NullCheck.Null, NullCheck.NotNull,
null
}
};
}
示例2: getPredicateAnalyzer
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqualOrLessThan; //导入依赖的package包/类
public static IndexPredicateAnalyzer getPredicateAnalyzer() {
IndexPredicateAnalyzer analyzer = new IndexPredicateAnalyzer();
analyzer.addComparisonOp(GenericUDFOPEqual.class.getName());
analyzer.addComparisonOp(GenericUDFOPGreaterThan.class.getName());
analyzer.addComparisonOp(GenericUDFOPEqualOrGreaterThan.class.getName());
analyzer.addComparisonOp(GenericUDFOPLessThan.class.getName());
analyzer.addComparisonOp(GenericUDFOPEqualOrLessThan.class.getName());
//TODO: Add support for LIKE operator.
return analyzer;
}
示例3: get
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqualOrLessThan; //导入依赖的package包/类
public static IHiveExprNode get( final ExprNodeGenericFuncDesc exprNodeDesc , final GenericUDF udf , final List<ExprNodeDesc> childNodeDesc ){
if( udf instanceof GenericUDFBridge ){
return getFromUdfClassName( ( (GenericUDFBridge)udf ).getUdfClass() , childNodeDesc );
}
if( udf instanceof GenericUDFOPEqual ){
return new EqualsHiveExpr( childNodeDesc );
}
else if( udf instanceof GenericUDFOPNotEqual ){
return new NotEqualsHiveExpr( childNodeDesc );
}
else if( udf instanceof GenericUDFOPNotNull ){
return new NotNullHiveExpr( childNodeDesc );
}
else if( udf instanceof GenericUDFIn ){
return new InHiveExpr( childNodeDesc );
}
else if( udf instanceof GenericUDFBetween ){
return new BetweenHiveExpr( childNodeDesc );
}
else if( udf instanceof GenericUDFOPNull ){
return new NullHiveExpr( childNodeDesc );
}
else if( udf instanceof GenericUDFIndex ){
return new BooleanHiveExpr( exprNodeDesc , (GenericUDFIndex)udf );
}
else if( udf instanceof GenericUDFOPEqualOrLessThan ){
return new CompareHiveExpr( childNodeDesc , StringCompareFilterType.LE , NumberFilterType.LE );
}
else if( udf instanceof GenericUDFOPLessThan ){
return new CompareHiveExpr( childNodeDesc , StringCompareFilterType.LT , NumberFilterType.LT );
}
else if( udf instanceof GenericUDFOPEqualOrGreaterThan ){
return new CompareHiveExpr( childNodeDesc , StringCompareFilterType.GE , NumberFilterType.GE );
}
else if( udf instanceof GenericUDFOPGreaterThan ){
return new CompareHiveExpr( childNodeDesc , StringCompareFilterType.GT , NumberFilterType.GT );
}
return new UnsupportHiveExpr();
}