public ExprNodeGenericFuncDesc(TypeInfo typeInfo, GenericUDF genericUDF, String funcText, List<ExprNodeDesc> children) { this(TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo), genericUDF, funcText, children); }
public ColumnInfo(String internalName, TypeInfo type, String tabAlias, boolean isVirtualCol, boolean isHiddenVirtualCol) { this(internalName, TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(type), tabAlias, isVirtualCol, isHiddenVirtualCol); }
private ObjectInspector[] getObjectInspectorArray(TypeInfo[] typeInfos) { final int size = typeInfos.length; ObjectInspector[] objectInspectors = new ObjectInspector[size]; for(int i = 0; i < size; i++) { TypeInfo typeInfo = typeInfos[i]; ObjectInspector standardWritableObjectInspector = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo); objectInspectors[i] = standardWritableObjectInspector; } return objectInspectors; }
public Field(Category category, ComplexTypeHelper complexTypeHelper, TypeInfo typeInfo) { isPrimitive = false; this.category = category; this.objectInspector = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo); this.primitiveCategory = null; this.dataTypePhysicalVariation = null; this.maxLength = 0; this.isConvert = false; this.conversionWritable = null; this.complexTypeHelper = complexTypeHelper; }
public DynamicValue(String id, TypeInfo typeInfo) { this.id = id; this.typeInfo = typeInfo; this.objectInspector = (PrimitiveObjectInspector) TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo); }
public ObjectInspector getWritableObjectInspector() { return TypeInfoUtils .getStandardWritableObjectInspectorFromTypeInfo(typeInfo); }
private ObjectInspector[] getObjectInspectorArray(TypeInfo[] typeInfos) { final int size = typeInfos.length; ObjectInspector[] objectInspectors = new ObjectInspector[size]; for(int i = 0; i < size; i++) { TypeInfo typeInfo = typeInfos[i]; ObjectInspector standardWritableObjectInspector = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo); objectInspectors[i] = standardWritableObjectInspector; } return objectInspectors; }
public DynamicValue(String id, TypeInfo typeInfo) { this.id = id; this.typeInfo = typeInfo; this.objectInspector = (PrimitiveObjectInspector) TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo); }
public ExprNodeGenericFuncDesc(TypeInfo typeInfo, GenericUDF genericUDF, String funcText, List<ExprNodeDesc> children) { this(TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo), genericUDF, funcText, children); }
public ColumnInfo(String internalName, TypeInfo type, String tabAlias, boolean isVirtualCol, boolean isHiddenVirtualCol) { this(internalName, TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(type), tabAlias, isVirtualCol, isHiddenVirtualCol); }
public HiveJsonStructReader(TypeInfo t, TimestampParser tsParser) { this.tsParser = tsParser; oi = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(t); factory = new JsonFactory(); }
/** * Convert exprNodeDesc array to Typeinfo array. */ static ObjectInspector[] getStandardObjectInspector(ArrayList<TypeInfo> exprs) { ObjectInspector[] result = new ObjectInspector[exprs.size()]; for (int i = 0; i < exprs.size(); i++) { result[i] = TypeInfoUtils .getStandardWritableObjectInspectorFromTypeInfo(exprs.get(i)); } return result; }
public MyHiveType(Object object, TypeInfo info) { super(object, TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(info)); } }
public void setType(TypeInfo type) { objectInspector = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(type); setTypeName(type.getTypeName()); }
/** * Compiles the appropriate vector expression writer based on an expression info (ExprNodeDesc) */ public static VectorExpressionWriter genVectorExpressionWritable(VectorExpression vecExpr) throws HiveException { TypeInfo outputTypeInfo = vecExpr.getOutputTypeInfo(); ObjectInspector objectInspector = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo( outputTypeInfo); return genVectorExpressionWritable(objectInspector); }
static StandardStructObjectInspector structObjectInspector(Properties tableProperties) { // extract column info - don't use Hive constants as they were renamed in 0.9 breaking compatibility // the column names are saved as the given inspector to #serialize doesn't preserves them (maybe because it's an external table) // use the class since StructType requires it ... List<String> columnNames = StringUtils.tokenize(tableProperties.getProperty(HiveConstants.COLUMNS), ","); List<TypeInfo> colTypes = TypeInfoUtils.getTypeInfosFromTypeString(tableProperties.getProperty(HiveConstants.COLUMNS_TYPES)); // create a standard writable Object Inspector - used later on by serialization/deserialization List<ObjectInspector> inspectors = new ArrayList<ObjectInspector>(); for (TypeInfo typeInfo : colTypes) { inspectors.add(TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo)); } return ObjectInspectorFactory.getStandardStructObjectInspector(columnNames, inspectors); }
public void setType(TypeInfo type) { objectInspector = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(type); setTypeName(type.getTypeName()); }
public static StandardStructObjectInspector convertToStandardStructObjectInspector( StructObjectInspector structObjectInspector) throws HiveException { List<? extends StructField> fields = structObjectInspector.getAllStructFieldRefs(); List<ObjectInspector> oids = new ArrayList<ObjectInspector>(); ArrayList<String> columnNames = new ArrayList<String>(); for(StructField field : fields) { TypeInfo typeInfo = TypeInfoUtils.getTypeInfoFromTypeString( field.getFieldObjectInspector().getTypeName()); ObjectInspector standardWritableObjectInspector = TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(typeInfo); oids.add(standardWritableObjectInspector); columnNames.add(field.getFieldName()); } return ObjectInspectorFactory.getStandardStructObjectInspector(columnNames,oids); }
/** * Compiles the appropriate vector expression writer based on an expression info (ExprNodeDesc) */ public static VectorExpressionWriter genVectorExpressionWritable(ExprNodeDesc nodeDesc) throws HiveException { ObjectInspector objectInspector = nodeDesc.getWritableObjectInspector(); if (null == objectInspector) { objectInspector = TypeInfoUtils .getStandardWritableObjectInspectorFromTypeInfo(nodeDesc.getTypeInfo()); } if (null == objectInspector) { throw new HiveException(String.format( "Failed to initialize VectorExpressionWriter for expr: %s", nodeDesc.getExprString())); } return genVectorExpressionWritable(objectInspector); }
private void extractResultObjects(VectorizedRowBatch batch, int rowIndex, VectorExtractRow resultVectorExtractRow, Object[] scrqtchRow, TypeInfo targetTypeInfo, Object[] resultObjects) { ObjectInspector objectInspector = TypeInfoUtils .getStandardWritableObjectInspectorFromTypeInfo(targetTypeInfo); boolean selectedInUse = batch.selectedInUse; int[] selected = batch.selected; for (int logicalIndex = 0; logicalIndex < batch.size; logicalIndex++) { final int batchIndex = (selectedInUse ? selected[logicalIndex] : logicalIndex); resultVectorExtractRow.extractRow(batch, batchIndex, scrqtchRow); Object copyResult = ObjectInspectorUtils.copyToStandardObject( scrqtchRow[0], objectInspector, ObjectInspectorCopyOption.WRITABLE); resultObjects[rowIndex++] = copyResult; } }