public ExprNodeColumnDesc(Class<?> c, String column, String tabAlias, boolean isPartitionColOrVirtualCol) { this(TypeInfoFactory.getPrimitiveTypeInfoFromJavaPrimitive(c), column, tabAlias, isPartitionColOrVirtualCol, false, false); }
public ExprNodeColumnDesc(Class<?> c, String column, String tabAlias, boolean isPartitionColOrVirtualCol) { this(TypeInfoFactory.getPrimitiveTypeInfoFromJavaPrimitive(c), column, tabAlias, isPartitionColOrVirtualCol, false, false); }
public ExprNodeConstantDesc(Object value) { this(TypeInfoFactory .getPrimitiveTypeInfoFromJavaPrimitive(value.getClass()), value); }
public ExprNodeConstantDesc(Object value) { this(TypeInfoFactory .getPrimitiveTypeInfoFromJavaPrimitive(value.getClass()), value); }
public ExprNodeColumnDesc(Class<?> c, String column, String tabAlias, boolean isPartitionColOrVirtualCol) { super(TypeInfoFactory.getPrimitiveTypeInfoFromJavaPrimitive(c)); this.column = column; this.tabAlias = tabAlias; this.isPartitionColOrVirtualCol = isPartitionColOrVirtualCol; }
public ExprNodeColumnDesc(Class<?> c, String column, String tabAlias, boolean isPartitionColOrVirtualCol) { super(TypeInfoFactory.getPrimitiveTypeInfoFromJavaPrimitive(c)); this.column = column; this.tabAlias = tabAlias; this.isPartitionColOrVirtualCol = isPartitionColOrVirtualCol; }
public ExprNodeConstantDesc(Object value) { this(TypeInfoFactory .getPrimitiveTypeInfoFromJavaPrimitive(value.getClass()), value); }
public ExprNodeConstantDesc(Object value) { this(TypeInfoFactory .getPrimitiveTypeInfoFromJavaPrimitive(value.getClass()), value); }
public static ObjectInspector[] toInspectors( Object[] args, List<Boolean> constants) { assert args.length == constants.size(); List<TypeInfo> typeInfos = new ArrayList<>(); for (Object arg: args) { if (arg == null) { // If arg is null, we use String Type Info to replace. // This may only be called at the default case of the client side. typeInfos.add(TypeInfoFactory.stringTypeInfo); } else { typeInfos.add(TypeInfoFactory.getPrimitiveTypeInfoFromJavaPrimitive(arg.getClass())); } } ObjectInspector[] argumentInspectors = new ObjectInspector[typeInfos.size()]; for (int i = 0; i < typeInfos.size(); i++) { if (constants.get(i)) { argumentInspectors[i] = getPrimitiveJavaConstantObjectInspector( (PrimitiveTypeInfo) typeInfos.get(i), args[i]); } else { argumentInspectors[i] = PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector( (PrimitiveTypeInfo) typeInfos.get(i)); } } return argumentInspectors; }
private void initialize(Object... args) throws UDFArgumentException { typeInfos = new ArrayList<>(); for (Object arg : args) { typeInfos.add( TypeInfoFactory.getPrimitiveTypeInfoFromJavaPrimitive(arg.getClass())); } method = function.getResolver().getEvalMethod(typeInfos); objectInspectors = new ObjectInspector[typeInfos.size()]; for (int i = 0; i < args.length; i++) { objectInspectors[i] = PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector( (PrimitiveTypeInfo) typeInfos.get(i)); } conversionHelper = new GenericUDFUtils.ConversionHelper(method, objectInspectors); initialized = true; }