本文整理汇总了Java中org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.booleanTypeInfo方法的典型用法代码示例。如果您正苦于以下问题:Java TypeInfoFactory.booleanTypeInfo方法的具体用法?Java TypeInfoFactory.booleanTypeInfo怎么用?Java TypeInfoFactory.booleanTypeInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory
的用法示例。
在下文中一共展示了TypeInfoFactory.booleanTypeInfo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToExpression
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
/**
* Convert generic Ampool filter(s) to the corresponding generic UDF(s).
*
* @param filter the Ampool filters
* @param td the Ampool table descriptor
* @return the generic ORC predicates
*/
public static ExprNodeDesc convertToExpression(final Filter filter, final TableDescriptor td)
throws IOException {
if (filter instanceof FilterList) {
FilterList fl = (FilterList) filter;
ExprNodeDesc expression = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo,
fl.getOperator() == FilterList.Operator.MUST_PASS_ALL ? new GenericUDFOPAnd()
: new GenericUDFOPOr(),
new ArrayList<>());
for (Filter f : fl.getFilters()) {
expression.getChildren().add(convertToExpression(f, td));
}
return expression;
} else if (filter instanceof SingleColumnValueFilter) {
SingleColumnValueFilter cf = (SingleColumnValueFilter) filter;
if (!UDF_CONVERT_MAP.containsKey(cf.getOperator())) {
throw new IOException("Failed to convert ComparisonOperator: " + cf.getOperator());
}
return UDF_CONVERT_MAP.get(cf.getOperator()).apply(cf, td);
} else {
return null;
}
}
示例2: testPredicate_Multiple_1
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
@Test
public void testPredicate_Multiple_1() {
ExprNodeDesc expr1 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
ExprNodeDesc expr2 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
ExprNodeDesc exprT = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPAnd(), new ArrayList<>(2));
exprT.getChildren().add(expr1);
exprT.getChildren().add(expr2);
DecomposedPredicate dp = MonarchPredicateHandler.decomposePredicate(null, serDe, exprT);
assertNotNull(dp);
assertNotNull(dp.pushedPredicate);
assertNull(dp.residualPredicate);
assertEquals(dp.pushedPredicate.toString(), exprT.toString());
}
示例3: testPredicate_Multiple_2
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
@Test
public void testPredicate_Multiple_2() {
ExprNodeDesc expr1 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
ExprNodeDesc expr2 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 100, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPLessThan());
ExprNodeDesc exprT = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPAnd(), new ArrayList<>(2));
exprT.getChildren().add(expr1);
exprT.getChildren().add(expr2);
DecomposedPredicate dp = MonarchPredicateHandler.decomposePredicate(null, serDe, exprT);
assertNotNull(dp);
assertNotNull(dp.pushedPredicate);
assertNull(dp.residualPredicate);
assertEquals(dp.pushedPredicate.toString(), exprT.toString());
}
示例4: testPredicate_Multiple_3
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
@Test
public void testPredicate_Multiple_3() {
ExprNodeDesc expr1 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
ExprNodeDesc expr2 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPMinus());
ExprNodeDesc exprT = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPAnd(), new ArrayList<>(2));
exprT.getChildren().add(expr1);
exprT.getChildren().add(expr2);
DecomposedPredicate dp = MonarchPredicateHandler.decomposePredicate(null, serDe, exprT);
assertNotNull(dp);
assertNotNull(dp.pushedPredicate);
assertNotNull(dp.residualPredicate);
assertEquals(dp.pushedPredicate.toString(), expr1.toString());
assertEquals(dp.residualPredicate.toString(), expr2.toString());
}
示例5: convertFilter
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
/**
* Convert Ampool SingleColumnValueFilter to the respective ORC predicate.
*
* @param f the Ampool filter
* @param td the table descriptor
* @param udf the generic UDF corresponding to the Ampool filter
* @return the ORC predicate
*/
private static ExprNodeDesc convertFilter(final SingleColumnValueFilter f,
final TableDescriptor td, final GenericUDF udf) {
final String cName = f.getColumnNameString();
final String aType = td.getColumnByName(cName).getColumnType().toString();
ExprNodeDesc exprNodeDesc =
new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, udf, new ArrayList<>(2));
final TypeInfo ti = OrcTypeMap.get(aType);
final ExprNodeDesc c1 = new ExprNodeColumnDesc(ti, cName, cName, false);
final ExprNodeDesc c2 = new ExprNodeConstantDesc(ti,
ti == TypeInfoFactory.floatTypeInfo ? ((Number) f.getValue()).doubleValue() : f.getValue());
exprNodeDesc.getChildren().add(c1);
exprNodeDesc.getChildren().add(c2);
return exprNodeDesc;
}
示例6: PhoenixBooleanObjectInspector
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
public PhoenixBooleanObjectInspector() {
super(TypeInfoFactory.booleanTypeInfo);
}
示例7: getTypeInfo
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
@SuppressWarnings({"override", "UnusedDeclaration", "RedundantCast"}) // FB Hive
public PrimitiveTypeInfo getTypeInfo() {
return (PrimitiveTypeInfo) TypeInfoFactory.booleanTypeInfo;
}