当前位置: 首页>>代码示例>>Java>>正文


Java TypeInfoFactory.booleanTypeInfo方法代码示例

本文整理汇总了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;
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:30,代码来源:OrcUtils.java

示例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());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:14,代码来源:MonarchPredicateHandlerTest.java

示例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());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:14,代码来源:MonarchPredicateHandlerTest.java

示例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());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:MonarchPredicateHandlerTest.java

示例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;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:23,代码来源:OrcUtils.java

示例6: PhoenixBooleanObjectInspector

import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
public PhoenixBooleanObjectInspector() {
	super(TypeInfoFactory.booleanTypeInfo);
}
 
开发者ID:mini666,项目名称:hive-phoenix-handler,代码行数:4,代码来源:PhoenixBooleanObjectInspector.java

示例7: getTypeInfo

import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; //导入方法依赖的package包/类
@SuppressWarnings({"override", "UnusedDeclaration", "RedundantCast"}) // FB Hive
public PrimitiveTypeInfo getTypeInfo() {
  return (PrimitiveTypeInfo) TypeInfoFactory.booleanTypeInfo;
}
 
开发者ID:facebookarchive,项目名称:hive-dwrf,代码行数:5,代码来源:OrcLazyBooleanObjectInspector.java


注:本文中的org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.booleanTypeInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。