本文整理汇总了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());
}
}
示例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();
}
示例3: GenericUDFTestBINARY
public GenericUDFTestBINARY() {
super("testHiveUDFBINARY", PrimitiveCategory.BINARY);
}