public Type getType() { return type.getType(); }
/** * Gets the qualified type name. * * @param typeDesc the type desc * @return the qualified type name */ public static String getQualifiedTypeName(TypeDescriptor typeDesc) { if (typeDesc.getType().isQualifiedType()) { switch (typeDesc.getType()) { case VARCHAR_TYPE: return VarcharTypeInfo.getQualifiedName(typeDesc.getTypeName(), typeDesc.getTypeQualifiers().getCharacterMaximumLength()).toLowerCase(); case CHAR_TYPE: return CharTypeInfo.getQualifiedName(typeDesc.getTypeName(), typeDesc.getTypeQualifiers().getCharacterMaximumLength()).toLowerCase(); case DECIMAL_TYPE: return DecimalTypeInfo.getQualifiedName(typeDesc.getTypeQualifiers().getPrecision(), typeDesc.getTypeQualifiers().getScale()).toLowerCase(); } } else if (typeDesc.getType().isComplexType()) { switch (typeDesc.getType()) { case ARRAY_TYPE: case MAP_TYPE: case STRUCT_TYPE: return "string"; } } return typeDesc.getTypeName().toLowerCase(); }
/** * Gets the qualified type name. * * @param typeDesc the type desc * @return the qualified type name */ public static String getQualifiedTypeName(TypeDescriptor typeDesc) { if (typeDesc.getType().isQualifiedType()) { switch (typeDesc.getType()) { case VARCHAR_TYPE: return VarcharTypeInfo.getQualifiedName(typeDesc.getTypeName(), typeDesc.getTypeQualifiers().getCharacterMaximumLength()).toLowerCase(); case CHAR_TYPE: return CharTypeInfo.getQualifiedName(typeDesc.getTypeName(), typeDesc.getTypeQualifiers().getCharacterMaximumLength()).toLowerCase(); case DECIMAL_TYPE: return DecimalTypeInfo.getQualifiedName(typeDesc.getTypeQualifiers().getPrecision(), typeDesc.getTypeQualifiers().getScale()).toLowerCase(); } } else if (typeDesc.getType().isComplexType()) { switch (typeDesc.getType()) { case ARRAY_TYPE: case MAP_TYPE: case STRUCT_TYPE: return "string"; } } return typeDesc.getTypeName().toLowerCase(); }
public boolean isPrimitive() { return type.getType().isPrimitiveType(); }
@Override public ColumnBasedSet addRow(Object[] fields) { if (isBlobBased) { this.blob = (byte[]) fields[0]; } else { for (int i = 0; i < fields.length; i++) { TypeDescriptor descriptor = descriptors[i]; Object field = fields[i]; if (field != null && descriptor.getType() == Type.DECIMAL_TYPE) { int scale = descriptor.getDecimalDigits(); field = ((HiveDecimal) field).toFormatString(scale); } columns.get(i).addValue(descriptor.getType(), field); } } return this; }
public static TColumnValue toTColumnValue(TypeDescriptor typeDescriptor, Object value) { Type type = typeDescriptor.getType();
public Type getType() { return type.getType(); }
public Type getType() { return type.getType(); }
public Type getType() { return type.getType(); }
public Type getType() { return type.getType(); }
public Type getType() { return type.getType(); }
public boolean isPrimitive() { return type.getType().isPrimitiveType(); }
public boolean isPrimitive() { return type.getType().isPrimitiveType(); }
public boolean isPrimitive() { return type.getType().isPrimitiveType(); }
public boolean isPrimitive() { return type.getType().isPrimitiveType(); }
public boolean isPrimitive() { return type.getType().isPrimitiveType(); }
@Override public ColumnBasedSet addRow(Object[] fields) { if (isBlobBased) { this.blob = (byte[]) fields[0]; } else { for (int i = 0; i < fields.length; i++) { TypeDescriptor descriptor = descriptors[i]; Object field = fields[i]; if (field != null && descriptor.getType() == Type.DECIMAL_TYPE) { int scale = descriptor.getDecimalDigits(); field = ((HiveDecimal) field).toFormatString(scale); } columns.get(i).addValue(descriptor.getType(), field); } } return this; }
public static TColumnValue toTColumnValue(TypeDescriptor typeDescriptor, Object value) { Type type = typeDescriptor.getType();