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


Java PrimitiveCategory.BINARY属性代码示例

本文整理汇总了Java中org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory.BINARY属性的典型用法代码示例。如果您正苦于以下问题:Java PrimitiveCategory.BINARY属性的具体用法?Java PrimitiveCategory.BINARY怎么用?Java PrimitiveCategory.BINARY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory的用法示例。


在下文中一共展示了PrimitiveCategory.BINARY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newInstance

Evaluator<?> newInstance(PredicateLeaf predicateLeaf) {
  TypeInfo typeInfo = structTypeInfo.getStructFieldTypeInfo(predicateLeaf.getColumnName());
  if (typeInfo.getCategory() != Category.PRIMITIVE) {
    throw new IllegalArgumentException("Unsupported column type: " + typeInfo.getCategory());
  }
  PrimitiveCategory category = ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory();
  if (category == PrimitiveCategory.BINARY) {
    throw new IllegalArgumentException("Unsupported column type: " + category);
  }

  switch (predicateLeaf.getOperator()) {
  case EQUALS:
  case NULL_SAFE_EQUALS:
    return equalsEvaluator(predicateLeaf, category);
  case LESS_THAN:
  case LESS_THAN_EQUALS:
    return lessThanEvaluator(predicateLeaf, category);
  case IN:
    return inEvaluator(predicateLeaf, category);
  case BETWEEN:
    return betweenEvaluator(predicateLeaf, category);
  case IS_NULL:
    return isNullEvaluator(predicateLeaf);
  default:
    throw new IllegalArgumentException("Unsupported operator: " + predicateLeaf.getOperator());
  }
}
 
开发者ID:HotelsDotCom,项目名称:corc,代码行数:27,代码来源:EvaluatorFactory.java

示例2: getEvaluator

@Override
public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters) throws SemanticException {
  if (parameters.length != 1) {
    throw new IllegalArgumentException("Function only takes 1 parameter");
  } else if (parameters[0].getCategory() != ObjectInspector.Category.PRIMITIVE || 
      ((PrimitiveTypeInfo)parameters[0]).getPrimitiveCategory() != PrimitiveCategory.BINARY) {
    throw new UDFArgumentTypeException(1,
        "Only BINARY columns in HLL format are accepted but "
            + parameters[0].getTypeName() + " was passed.");
  }
  return new HyperLogLogMergeEvaluator();
}
 
开发者ID:t3rmin4t0r,项目名称:hive-hll-udf,代码行数:12,代码来源:UDAFHyperLogLogMerge.java

示例3: GenericUDFTestBINARY

public GenericUDFTestBINARY() {
  super("testHiveUDFBINARY", PrimitiveCategory.BINARY);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:3,代码来源:HiveTestUDFImpls.java


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