public ExprNodeConstantEvaluator(ExprNodeConstantDesc expr, Configuration conf) { super(expr, conf); writableObjectInspector = expr.getWritableObjectInspector(); }
public ExprNodeConstantEvaluator(ExprNodeConstantDesc expr, Configuration conf) { super(expr, conf); writableObjectInspector = expr.getWritableObjectInspector(); }
@Override /** * Return string representation of constant expression * Beside ExplainPlan task Default constraint also make use it to deserialize constant expression * to store it in metastore, which is later reparsed to generate appropriate constant expression * Therefore it is necessary for this method to qualify the intervals with appropriate qualifiers */ public String getExprString() { if (typeInfo.getCategory() == Category.PRIMITIVE) { return getFormatted(typeInfo, value); } else if (typeInfo.getCategory() == Category.STRUCT) { StringBuilder sb = new StringBuilder(); sb.append("const struct("); List<?> items = (List<?>) getWritableObjectInspector().getWritableConstantValue(); List<TypeInfo> structTypes = ((StructTypeInfo) typeInfo).getAllStructFieldTypeInfos(); for (int i = 0; i < structTypes.size(); i++) { final Object o = (i < items.size()) ? items.get(i) : null; sb.append(getFormatted(structTypes.get(i), o)).append(","); } sb.setCharAt(sb.length() - 1, ')'); return sb.toString(); } else { // unknown type return toString(); } }
@Override public String getExprString() { if (typeInfo.getCategory() == Category.PRIMITIVE) { return getFormatted(typeInfo, value); } else if (typeInfo.getCategory() == Category.STRUCT) { StringBuilder sb = new StringBuilder(); sb.append("const struct("); List<?> items = (List<?>) getWritableObjectInspector().getWritableConstantValue(); List<TypeInfo> structTypes = ((StructTypeInfo) typeInfo).getAllStructFieldTypeInfos(); for (int i = 0; i < structTypes.size(); i++) { final Object o = (i < items.size()) ? items.get(i) : null; sb.append(getFormatted(structTypes.get(i), o)).append(","); } sb.setCharAt(sb.length() - 1, ')'); return sb.toString(); } else { // unknown type return toString(); } }
List<?> items = (List<?>) constantChild.getWritableObjectInspector().getWritableConstantValue(); List<TypeInfo> structTypes = ((StructTypeInfo) constantChild.getTypeInfo()).getAllStructFieldTypeInfos(); for (int j = 0; j < structTypes.size(); j++) {
List<?> items = (List<?>) constantChild.getWritableObjectInspector().getWritableConstantValue(); List<TypeInfo> structTypes = ((StructTypeInfo) constantChild.getTypeInfo()).getAllStructFieldTypeInfos(); for (int j = 0; j < structTypes.size(); j++) {
ObjectInspector childoi = foldedChild.getWritableObjectInspector(); GenericUDF gudf = ((ExprNodeGenericFuncDesc) exprDesc).getGenericUDF();
ObjectInspector childoi = foldedChild.getWritableObjectInspector(); GenericUDF gudf = ((ExprNodeGenericFuncDesc) exprDesc).getGenericUDF();
arguments[i] = new DeferredJavaObject(writableValue); argois[i] = ObjectInspectorUtils.getConstantObjectInspector(constant.getWritableObjectInspector(), writableValue); (PrimitiveTypeInfo) constant.getTypeInfo()).getPrimitiveWritableObject(constant.getValue()); arguments[i] = new DeferredJavaObject(writableValue); argois[i] = ObjectInspectorUtils.getConstantObjectInspector(constant.getWritableObjectInspector(), writableValue); } else { return null;
ConstantObjectInspector output = constNode.getWritableObjectInspector(); constants = ((List<?>) output.getWritableConstantValue()).toArray(); } else {
ConstantObjectInspector output = constNode.getWritableObjectInspector(); constants = ((List<?>) output.getWritableConstantValue()).toArray(); } else {
arguments[i] = new DeferredJavaObject(writableValue); argois[i] = ObjectInspectorUtils.getConstantObjectInspector(constant.getWritableObjectInspector(), writableValue); (PrimitiveTypeInfo) constant.getTypeInfo()).getPrimitiveWritableObject(constant.getValue()); arguments[i] = new DeferredJavaObject(writableValue); argois[i] = ObjectInspectorUtils.getConstantObjectInspector(constant.getWritableObjectInspector(), writableValue); } else { return null;
ConstantObjectInspector coi = literal.getWritableObjectInspector(); Object value = ObjectInspectorUtils.copyToStandardJavaObject(coi.getWritableConstantValue(), coi);
ConstantObjectInspector coi = literal.getWritableObjectInspector(); Object value = ObjectInspectorUtils.copyToStandardJavaObject(coi.getWritableConstantValue(), coi);
public ExprNodeConstantEvaluator(ExprNodeConstantDesc expr) { super(expr); writableObjectInspector = expr.getWritableObjectInspector(); }
ObjectInspector childoi = foldedChild.getWritableObjectInspector(); GenericUDF gudf = ((ExprNodeGenericFuncDesc) exprDesc).getGenericUDF();
arguments[i] = new DeferredJavaObject(writableValue); argois[i] = ObjectInspectorUtils.getConstantObjectInspector(constant.getWritableObjectInspector(), writableValue); (PrimitiveTypeInfo) constant.getTypeInfo()).getPrimitiveWritableObject(constant.getValue()); arguments[i] = new DeferredJavaObject(writableValue); argois[i] = ObjectInspectorUtils.getConstantObjectInspector(constant.getWritableObjectInspector(), writableValue); } else { return null;
ConstantObjectInspector objInspector = constantDesc.getWritableObjectInspector();
ConstantObjectInspector objInspector = constantDesc.getWritableObjectInspector();
colType = encd.getTypeString(); countDistincts = 1; oi = encd.getWritableObjectInspector();