Search in sources :

Example 16 with VarcharType

use of com.facebook.presto.common.type.VarcharType in project presto by prestodb.

the class IcebergPageSource method deserializePartitionValue.

private static Object deserializePartitionValue(Type type, String valueString, String name, TimeZoneKey timeZoneKey) {
    if (valueString == null) {
        return null;
    }
    try {
        if (type.equals(BOOLEAN)) {
            if (valueString.equalsIgnoreCase("true")) {
                return true;
            }
            if (valueString.equalsIgnoreCase("false")) {
                return false;
            }
            throw new IllegalArgumentException();
        }
        if (type.equals(INTEGER)) {
            return parseLong(valueString);
        }
        if (type.equals(BIGINT)) {
            return parseLong(valueString);
        }
        if (type.equals(REAL)) {
            return (long) floatToRawIntBits(parseFloat(valueString));
        }
        if (type.equals(DOUBLE)) {
            return parseDouble(valueString);
        }
        if (type.equals(DATE) || type.equals(TIME) || type.equals(TIMESTAMP)) {
            return parseLong(valueString);
        }
        if (type instanceof VarcharType) {
            Slice value = utf8Slice(valueString);
            return value;
        }
        if (type.equals(VarbinaryType.VARBINARY)) {
            return utf8Slice(valueString);
        }
        if (isShortDecimal(type) || isLongDecimal(type)) {
            DecimalType decimalType = (DecimalType) type;
            BigDecimal decimal = new BigDecimal(valueString);
            decimal = decimal.setScale(decimalType.getScale(), BigDecimal.ROUND_UNNECESSARY);
            if (decimal.precision() > decimalType.getPrecision()) {
                throw new IllegalArgumentException();
            }
            BigInteger unscaledValue = decimal.unscaledValue();
            return isShortDecimal(type) ? unscaledValue.longValue() : Decimals.encodeUnscaledValue(unscaledValue);
        }
    } catch (IllegalArgumentException e) {
        throw new PrestoException(ICEBERG_INVALID_PARTITION_VALUE, format("Invalid partition value '%s' for %s partition key: %s", valueString, type.getDisplayName(), name));
    }
    // Iceberg tables don't partition by non-primitive-type columns.
    throw new PrestoException(GENERIC_INTERNAL_ERROR, "Invalid partition type " + type.toString());
}
Also used : VarcharType(com.facebook.presto.common.type.VarcharType) Slice(io.airlift.slice.Slice) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) DecimalType(com.facebook.presto.common.type.DecimalType) BigInteger(java.math.BigInteger) PrestoException(com.facebook.presto.spi.PrestoException) BigDecimal(java.math.BigDecimal)

Example 17 with VarcharType

use of com.facebook.presto.common.type.VarcharType in project presto by prestodb.

the class TypeCoercer method isTypeOnlyCoercion.

public boolean isTypeOnlyCoercion(Type source, Type result) {
    if (source.equals(result)) {
        return true;
    }
    if (!canCoerce(source, result)) {
        return false;
    }
    if (source instanceof VarcharType && result instanceof VarcharType) {
        return true;
    }
    if (source instanceof DecimalType && result instanceof DecimalType) {
        DecimalType sourceDecimal = (DecimalType) source;
        DecimalType resultDecimal = (DecimalType) result;
        boolean sameDecimalSubtype = (sourceDecimal.isShort() && resultDecimal.isShort()) || (!sourceDecimal.isShort() && !resultDecimal.isShort());
        boolean sameScale = sourceDecimal.getScale() == resultDecimal.getScale();
        boolean sourcePrecisionIsLessOrEqualToResultPrecision = sourceDecimal.getPrecision() <= resultDecimal.getPrecision();
        return sameDecimalSubtype && sameScale && sourcePrecisionIsLessOrEqualToResultPrecision;
    }
    String sourceTypeBase = source.getTypeSignature().getBase();
    String resultTypeBase = result.getTypeSignature().getBase();
    if (sourceTypeBase.equals(resultTypeBase) && isCovariantParametrizedType(source)) {
        List<Type> sourceTypeParameters = source.getTypeParameters();
        List<Type> resultTypeParameters = result.getTypeParameters();
        checkState(sourceTypeParameters.size() == resultTypeParameters.size());
        for (int i = 0; i < sourceTypeParameters.size(); i++) {
            if (!isTypeOnlyCoercion(sourceTypeParameters.get(i), resultTypeParameters.get(i))) {
                return false;
            }
        }
        return true;
    }
    return false;
}
Also used : CharType.createCharType(com.facebook.presto.common.type.CharType.createCharType) MapType(com.facebook.presto.common.type.MapType) DecimalType(com.facebook.presto.common.type.DecimalType) VarcharType.createUnboundedVarcharType(com.facebook.presto.common.type.VarcharType.createUnboundedVarcharType) KHyperLogLogType(com.facebook.presto.type.khyperloglog.KHyperLogLogType) SetDigestType(com.facebook.presto.type.setdigest.SetDigestType) VarcharType.createVarcharType(com.facebook.presto.common.type.VarcharType.createVarcharType) ArrayType(com.facebook.presto.common.type.ArrayType) CharType(com.facebook.presto.common.type.CharType) UnknownType(com.facebook.presto.common.type.UnknownType) Type(com.facebook.presto.common.type.Type) VarcharType(com.facebook.presto.common.type.VarcharType) RowType(com.facebook.presto.common.type.RowType) DecimalType.createDecimalType(com.facebook.presto.common.type.DecimalType.createDecimalType) VarcharType.createUnboundedVarcharType(com.facebook.presto.common.type.VarcharType.createUnboundedVarcharType) VarcharType.createVarcharType(com.facebook.presto.common.type.VarcharType.createVarcharType) VarcharType(com.facebook.presto.common.type.VarcharType) DecimalType(com.facebook.presto.common.type.DecimalType) DecimalType.createDecimalType(com.facebook.presto.common.type.DecimalType.createDecimalType)

Example 18 with VarcharType

use of com.facebook.presto.common.type.VarcharType in project presto by prestodb.

the class DynamicFilters method getPlaceholder.

public static Optional<DynamicFilterPlaceholder> getPlaceholder(RowExpression expression) {
    if (!(expression instanceof CallExpression)) {
        return Optional.empty();
    }
    CallExpression call = (CallExpression) expression;
    List<RowExpression> arguments = call.getArguments();
    if (!call.getDisplayName().equals(DynamicFilterPlaceholderFunction.NAME)) {
        return Optional.empty();
    }
    checkArgument(arguments.size() == 3, "invalid arguments count: %s", arguments.size());
    RowExpression probeSymbol = arguments.get(0);
    RowExpression operatorExpression = arguments.get(1);
    checkArgument(operatorExpression instanceof ConstantExpression);
    checkArgument(operatorExpression.getType() instanceof VarcharType);
    String operator = ((Slice) ((ConstantExpression) operatorExpression).getValue()).toStringUtf8();
    RowExpression idExpression = arguments.get(2);
    checkArgument(idExpression instanceof ConstantExpression);
    checkArgument(idExpression.getType() instanceof VarcharType);
    String id = ((Slice) ((ConstantExpression) idExpression).getValue()).toStringUtf8();
    OperatorType operatorType = OperatorType.valueOf(operator);
    if (operatorType.isComparisonOperator()) {
        return Optional.of(new DynamicFilterPlaceholder(id, probeSymbol, operatorType));
    }
    return Optional.empty();
}
Also used : VarcharType(com.facebook.presto.common.type.VarcharType) Slice(io.airlift.slice.Slice) ConstantExpression(com.facebook.presto.spi.relation.ConstantExpression) RowExpression(com.facebook.presto.spi.relation.RowExpression) CallExpression(com.facebook.presto.spi.relation.CallExpression) OperatorType(com.facebook.presto.common.function.OperatorType)

Example 19 with VarcharType

use of com.facebook.presto.common.type.VarcharType in project presto by prestodb.

the class HiveUtil method varcharPartitionKey.

public static Slice varcharPartitionKey(String value, String name, Type columnType) {
    Slice partitionKey = Slices.utf8Slice(value);
    VarcharType varcharType = (VarcharType) columnType;
    if (SliceUtf8.countCodePoints(partitionKey) > varcharType.getLength()) {
        throw new PrestoException(HIVE_INVALID_PARTITION_VALUE, format("Invalid partition value '%s' for %s partition key: %s", value, columnType.toString(), name));
    }
    return partitionKey;
}
Also used : Varchars.isVarcharType(com.facebook.presto.common.type.Varchars.isVarcharType) VarcharType(com.facebook.presto.common.type.VarcharType) Slice(io.airlift.slice.Slice) PrestoException(com.facebook.presto.spi.PrestoException)

Example 20 with VarcharType

use of com.facebook.presto.common.type.VarcharType in project presto by prestodb.

the class HiveWriteUtils method getJavaObjectInspector.

public static ObjectInspector getJavaObjectInspector(Type type) {
    if (type.equals(BooleanType.BOOLEAN)) {
        return javaBooleanObjectInspector;
    } else if (type.equals(BigintType.BIGINT)) {
        return javaLongObjectInspector;
    } else if (type.equals(IntegerType.INTEGER)) {
        return javaIntObjectInspector;
    } else if (type.equals(SmallintType.SMALLINT)) {
        return javaShortObjectInspector;
    } else if (type.equals(TinyintType.TINYINT)) {
        return javaByteObjectInspector;
    } else if (type.equals(RealType.REAL)) {
        return javaFloatObjectInspector;
    } else if (type.equals(DoubleType.DOUBLE)) {
        return javaDoubleObjectInspector;
    } else if (type instanceof VarcharType) {
        return writableStringObjectInspector;
    } else if (type instanceof CharType) {
        return writableHiveCharObjectInspector;
    } else if (type.equals(VarbinaryType.VARBINARY)) {
        return javaByteArrayObjectInspector;
    } else if (type.equals(DateType.DATE)) {
        return javaDateObjectInspector;
    } else if (type.equals(TimestampType.TIMESTAMP)) {
        return javaTimestampObjectInspector;
    } else if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        return getPrimitiveJavaObjectInspector(new DecimalTypeInfo(decimalType.getPrecision(), decimalType.getScale()));
    } else if (isArrayType(type)) {
        return ObjectInspectorFactory.getStandardListObjectInspector(getJavaObjectInspector(type.getTypeParameters().get(0)));
    } else if (isMapType(type)) {
        ObjectInspector keyObjectInspector = getJavaObjectInspector(type.getTypeParameters().get(0));
        ObjectInspector valueObjectInspector = getJavaObjectInspector(type.getTypeParameters().get(1));
        return ObjectInspectorFactory.getStandardMapObjectInspector(keyObjectInspector, valueObjectInspector);
    } else if (isRowType(type)) {
        return ObjectInspectorFactory.getStandardStructObjectInspector(type.getTypeSignature().getParameters().stream().map(parameter -> parameter.getNamedTypeSignature().getName().get()).collect(toList()), type.getTypeParameters().stream().map(HiveWriteUtils::getJavaObjectInspector).collect(toList()));
    }
    throw new IllegalArgumentException("unsupported type: " + type);
}
Also used : DecimalTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo) FileSystem(org.apache.hadoop.fs.FileSystem) MetastoreContext(com.facebook.presto.hive.metastore.MetastoreContext) HiveSessionProperties.getTemporaryStagingDirectoryPath(com.facebook.presto.hive.HiveSessionProperties.getTemporaryStagingDirectoryPath) PrimitiveObjectInspectorFactory.javaByteObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaByteObjectInspector) Text(org.apache.hadoop.io.Text) PrimitiveObjectInspectorFactory.javaLongObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaLongObjectInspector) DateWritable(org.apache.hadoop.hive.serde2.io.DateWritable) Writable(org.apache.hadoop.io.Writable) PrimitiveObjectInspectorFactory.javaTimestampObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaTimestampObjectInspector) MATERIALIZED_VIEW(com.facebook.presto.hive.metastore.PrestoTableType.MATERIALIZED_VIEW) PrimitiveObjectInspectorFactory.javaDateObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaDateObjectInspector) PrimitiveObjectInspectorFactory.writableTimestampObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableTimestampObjectInspector) ExtendedRecordWriter(com.facebook.presto.hive.RecordFileWriter.ExtendedRecordWriter) Configuration(org.apache.hadoop.conf.Configuration) Map(java.util.Map) StructTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.StructTypeInfo) ObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector) TEMPORARY_TABLE(com.facebook.presto.hive.metastore.PrestoTableType.TEMPORARY_TABLE) IntWritable(org.apache.hadoop.io.IntWritable) MetastoreUtil.getField(com.facebook.presto.hive.metastore.MetastoreUtil.getField) PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector) MetastoreUtil.getHiveDecimal(com.facebook.presto.hive.metastore.MetastoreUtil.getHiveDecimal) PrimitiveObjectInspectorFactory.javaFloatObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaFloatObjectInspector) PrimitiveObjectInspectorFactory.javaDoubleObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaDoubleObjectInspector) HIVE_SERDE_NOT_FOUND(com.facebook.presto.hive.HiveErrorCode.HIVE_SERDE_NOT_FOUND) SemiTransactionalHiveMetastore(com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore) ConnectorSession(com.facebook.presto.spi.ConnectorSession) ReflectionUtil(org.apache.hive.common.util.ReflectionUtil) BooleanWritable(org.apache.hadoop.io.BooleanWritable) HIVE_DATABASE_LOCATION_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_DATABASE_LOCATION_ERROR) MetastoreUtil.getMetastoreHeaders(com.facebook.presto.hive.metastore.MetastoreUtil.getMetastoreHeaders) PrimitiveObjectInspectorFactory.javaIntObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaIntObjectInspector) StructField(org.apache.hadoop.hive.serde2.objectinspector.StructField) HadoopExtendedFileSystem(org.apache.hadoop.fs.HadoopExtendedFileSystem) DecimalType(com.facebook.presto.common.type.DecimalType) Table(com.facebook.presto.hive.metastore.Table) PrimitiveCategory(org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory) Chars.isCharType(com.facebook.presto.common.type.Chars.isCharType) Database(com.facebook.presto.hive.metastore.Database) PrimitiveObjectInspectorFactory.writableFloatObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableFloatObjectInspector) META_TABLE_COLUMNS(org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_COLUMNS) ArrayList(java.util.ArrayList) COMPRESSRESULT(org.apache.hadoop.hive.conf.HiveConf.ConfVars.COMPRESSRESULT) PrimitiveObjectInspectorFactory.javaShortObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaShortObjectInspector) CharType(com.facebook.presto.common.type.CharType) DoubleWritable(org.apache.hadoop.hive.serde2.io.DoubleWritable) PrimitiveObjectInspectorFactory.writableBooleanObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableBooleanObjectInspector) Properties(java.util.Properties) ViewFileSystem(org.apache.hadoop.fs.viewfs.ViewFileSystem) Reporter(org.apache.hadoop.mapred.Reporter) RCFile(org.apache.hadoop.hive.ql.io.RCFile) MetastoreUtil.isArrayType(com.facebook.presto.hive.metastore.MetastoreUtil.isArrayType) IOException(java.io.IOException) DecimalTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo) SettableStructObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.SettableStructObjectInspector) HIVE_FILESYSTEM_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_FILESYSTEM_ERROR) PrimitiveObjectInspectorFactory.writableBinaryObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableBinaryObjectInspector) PrimitiveObjectInspectorFactory.writableDoubleObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableDoubleObjectInspector) PrimitiveObjectInspectorFactory.writableLongObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableLongObjectInspector) SerDeException(org.apache.hadoop.hive.serde2.SerDeException) FloatWritable(org.apache.hadoop.io.FloatWritable) DoubleType(com.facebook.presto.common.type.DoubleType) RecordWriter(org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter) MetastoreUtil.isRowType(com.facebook.presto.hive.metastore.MetastoreUtil.isRowType) PrimitiveObjectInspectorFactory.writableByteObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableByteObjectInspector) LongWritable(org.apache.hadoop.io.LongWritable) MapTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.MapTypeInfo) PrimitiveObjectInspectorFactory.writableDateObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableDateObjectInspector) CompressionCodec(org.apache.hadoop.io.compress.CompressionCodec) SchemaTableName(com.facebook.presto.spi.SchemaTableName) SchemaNotFoundException(com.facebook.presto.spi.SchemaNotFoundException) MANAGED_TABLE(com.facebook.presto.hive.metastore.PrestoTableType.MANAGED_TABLE) Path(org.apache.hadoop.fs.Path) PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector) PrimitiveTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo) ShortWritable(org.apache.hadoop.hive.serde2.io.ShortWritable) TinyintType(com.facebook.presto.common.type.TinyintType) HIVE_WRITER_DATA_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_DATA_ERROR) BigintType(com.facebook.presto.common.type.BigintType) RCFileOutputFormat(org.apache.hadoop.hive.ql.io.RCFileOutputFormat) DefaultCodec(org.apache.hadoop.io.compress.DefaultCodec) VarcharType(com.facebook.presto.common.type.VarcharType) RealType(com.facebook.presto.common.type.RealType) HiveOutputFormat(org.apache.hadoop.hive.ql.io.HiveOutputFormat) String.format(java.lang.String.format) SmallintType(com.facebook.presto.common.type.SmallintType) List(java.util.List) PrestoTableType(com.facebook.presto.hive.metastore.PrestoTableType) NOT_SUPPORTED(com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED) MapredParquetOutputFormat(org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat) PrimitiveObjectInspectorFactory.writableHiveCharObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableHiveCharObjectInspector) VarbinaryType(com.facebook.presto.common.type.VarbinaryType) Optional(java.util.Optional) PrimitiveObjectInspectorFactory.writableShortObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableShortObjectInspector) TimestampType(com.facebook.presto.common.type.TimestampType) TypeInfoFactory.getCharTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getCharTypeInfo) TypeInfoFactory.getVarcharTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getVarcharTypeInfo) MetastoreUtil.getProtectMode(com.facebook.presto.hive.metastore.MetastoreUtil.getProtectMode) ParquetRecordWriterUtil.createParquetWriter(com.facebook.presto.hive.ParquetRecordWriterUtil.createParquetWriter) PrimitiveObjectInspectorFactory.javaBooleanObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaBooleanObjectInspector) BooleanType(com.facebook.presto.common.type.BooleanType) Shorts(com.google.common.primitives.Shorts) HashMap(java.util.HashMap) ProtectMode(org.apache.hadoop.hive.metastore.ProtectMode) PrestoException(com.facebook.presto.spi.PrestoException) Float.intBitsToFloat(java.lang.Float.intBitsToFloat) PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector) Partition(com.facebook.presto.hive.metastore.Partition) PrimitiveObjectInspectorFactory.writableStringObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableStringObjectInspector) HiveVarchar(org.apache.hadoop.hive.common.type.HiveVarchar) IntegerType(com.facebook.presto.common.type.IntegerType) ImmutableList(com.google.common.collect.ImmutableList) ByteWritable(org.apache.hadoop.io.ByteWritable) Objects.requireNonNull(java.util.Objects.requireNonNull) MetastoreUtil.verifyOnline(com.facebook.presto.hive.metastore.MetastoreUtil.verifyOnline) ListTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo) BytesWritable(org.apache.hadoop.io.BytesWritable) TimestampWritable(org.apache.hadoop.hive.serde2.io.TimestampWritable) Math.toIntExact(java.lang.Math.toIntExact) Type(com.facebook.presto.common.type.Type) MetastoreUtil.isMapType(com.facebook.presto.hive.metastore.MetastoreUtil.isMapType) Storage(com.facebook.presto.hive.metastore.Storage) HiveConf(org.apache.hadoop.hive.conf.HiveConf) SignedBytes(com.google.common.primitives.SignedBytes) MetastoreUtil.pathExists(com.facebook.presto.hive.metastore.MetastoreUtil.pathExists) PrestoS3FileSystem(com.facebook.presto.hive.s3.PrestoS3FileSystem) MetastoreUtil.createDirectory(com.facebook.presto.hive.metastore.MetastoreUtil.createDirectory) FileOutputFormat.getOutputCompressorClass(org.apache.hadoop.mapred.FileOutputFormat.getOutputCompressorClass) ConnectorIdentity(com.facebook.presto.spi.security.ConnectorIdentity) TypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo) JobConf(org.apache.hadoop.mapred.JobConf) UUID.randomUUID(java.util.UUID.randomUUID) Collectors.toList(java.util.stream.Collectors.toList) PrimitiveObjectInspectorFactory.writableIntObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableIntObjectInspector) ObjectInspectorFactory(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory) Serializer(org.apache.hadoop.hive.serde2.Serializer) MetastoreUtil.isUserDefinedTypeEncodingEnabled(com.facebook.presto.hive.metastore.MetastoreUtil.isUserDefinedTypeEncodingEnabled) Block(com.facebook.presto.common.block.Block) DateType(com.facebook.presto.common.type.DateType) HiveDecimalWritable(org.apache.hadoop.hive.serde2.io.HiveDecimalWritable) PrimitiveObjectInspectorFactory.javaByteObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaByteObjectInspector) PrimitiveObjectInspectorFactory.javaLongObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaLongObjectInspector) PrimitiveObjectInspectorFactory.javaTimestampObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaTimestampObjectInspector) PrimitiveObjectInspectorFactory.javaDateObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaDateObjectInspector) PrimitiveObjectInspectorFactory.writableTimestampObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableTimestampObjectInspector) ObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector) PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector) PrimitiveObjectInspectorFactory.javaFloatObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaFloatObjectInspector) PrimitiveObjectInspectorFactory.javaDoubleObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaDoubleObjectInspector) PrimitiveObjectInspectorFactory.javaIntObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaIntObjectInspector) PrimitiveObjectInspectorFactory.writableFloatObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableFloatObjectInspector) PrimitiveObjectInspectorFactory.javaShortObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaShortObjectInspector) PrimitiveObjectInspectorFactory.writableBooleanObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableBooleanObjectInspector) SettableStructObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.SettableStructObjectInspector) PrimitiveObjectInspectorFactory.writableBinaryObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableBinaryObjectInspector) PrimitiveObjectInspectorFactory.writableDoubleObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableDoubleObjectInspector) PrimitiveObjectInspectorFactory.writableLongObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableLongObjectInspector) PrimitiveObjectInspectorFactory.writableByteObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableByteObjectInspector) PrimitiveObjectInspectorFactory.writableDateObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableDateObjectInspector) PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector) PrimitiveObjectInspectorFactory.writableHiveCharObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableHiveCharObjectInspector) PrimitiveObjectInspectorFactory.writableShortObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableShortObjectInspector) PrimitiveObjectInspectorFactory.javaBooleanObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaBooleanObjectInspector) PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector) PrimitiveObjectInspectorFactory.writableStringObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableStringObjectInspector) PrimitiveObjectInspectorFactory.writableIntObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.writableIntObjectInspector) VarcharType(com.facebook.presto.common.type.VarcharType) DecimalType(com.facebook.presto.common.type.DecimalType) Chars.isCharType(com.facebook.presto.common.type.Chars.isCharType) CharType(com.facebook.presto.common.type.CharType)

Aggregations

VarcharType (com.facebook.presto.common.type.VarcharType)48 DecimalType (com.facebook.presto.common.type.DecimalType)30 Type (com.facebook.presto.common.type.Type)26 CharType (com.facebook.presto.common.type.CharType)23 PrestoException (com.facebook.presto.spi.PrestoException)16 Slice (io.airlift.slice.Slice)16 ArrayType (com.facebook.presto.common.type.ArrayType)14 RowType (com.facebook.presto.common.type.RowType)13 MapType (com.facebook.presto.common.type.MapType)12 ArrayList (java.util.ArrayList)12 ImmutableList (com.google.common.collect.ImmutableList)11 List (java.util.List)11 IntegerType (com.facebook.presto.common.type.IntegerType)10 TimestampType (com.facebook.presto.common.type.TimestampType)10 VarbinaryType (com.facebook.presto.common.type.VarbinaryType)10 BigintType (com.facebook.presto.common.type.BigintType)9 BooleanType (com.facebook.presto.common.type.BooleanType)9 DoubleType (com.facebook.presto.common.type.DoubleType)9 RealType (com.facebook.presto.common.type.RealType)9 SmallintType (com.facebook.presto.common.type.SmallintType)9