/** * @param column column expression to convert * @param tableFieldTypeInfo TypeInfo to convert to * @return Expression converting column to the type specified by tableFieldTypeInfo */ public static ExprNodeDesc createConversionCast(ExprNodeDesc column, PrimitiveTypeInfo tableFieldTypeInfo) throws SemanticException { // Get base type, since type string may be parameterized String baseType = TypeInfoUtils.getBaseName(tableFieldTypeInfo.getTypeName()); // If the type cast UDF is for a parameterized type, then it should implement // the SettableUDF interface so that we can pass in the params. // Not sure if this is the cleanest solution, but there does need to be a way // to provide the type params to the type cast. return TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDescWithUdfData(baseType, tableFieldTypeInfo, column); }
public static ExprNodeDesc getFuncExprNodeDesc(String udfName, ExprNodeDesc... children) throws UDFArgumentException { return getFuncExprNodeDescWithUdfData(udfName, null, children); }
/** * @param column column expression to convert * @param tableFieldTypeInfo TypeInfo to convert to * @return Expression converting column to the type specified by tableFieldTypeInfo */ public static ExprNodeDesc createConversionCast(ExprNodeDesc column, PrimitiveTypeInfo tableFieldTypeInfo) throws SemanticException { // Get base type, since type string may be parameterized String baseType = TypeInfoUtils.getBaseName(tableFieldTypeInfo.getTypeName()); // If the type cast UDF is for a parameterized type, then it should implement // the SettableUDF interface so that we can pass in the params. // Not sure if this is the cleanest solution, but there does need to be a way // to provide the type params to the type cast. return TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDescWithUdfData(baseType, tableFieldTypeInfo, column); }
/** * @param column column expression to convert * @param tableFieldTypeInfo TypeInfo to convert to * @return Expression converting column to the type specified by tableFieldTypeInfo */ public static ExprNodeDesc createConversionCast(ExprNodeDesc column, PrimitiveTypeInfo tableFieldTypeInfo) throws SemanticException { // Get base type, since type string may be parameterized String baseType = TypeInfoUtils.getBaseName(tableFieldTypeInfo.getTypeName()); // If the type cast UDF is for a parameterized type, then it should implement // the SettableUDF interface so that we can pass in the params. // Not sure if this is the cleanest solution, but there does need to be a way // to provide the type params to the type cast. return TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDescWithUdfData(baseType, tableFieldTypeInfo, column); }
public static ExprNodeDesc getFuncExprNodeDesc(String udfName, ExprNodeDesc... children) throws UDFArgumentException { return getFuncExprNodeDescWithUdfData(udfName, null, children); }
public static ExprNodeDesc getFuncExprNodeDesc(String udfName, ExprNodeDesc... children) throws UDFArgumentException { return getFuncExprNodeDescWithUdfData(udfName, null, children); }