Search in sources :

Example 16 with DecimalType

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

the class KuduClientSession method setTypeAttributes.

private void setTypeAttributes(ColumnMetadata columnMetadata, ColumnSchema.ColumnSchemaBuilder builder) {
    if (columnMetadata.getType() instanceof DecimalType) {
        DecimalType type = (DecimalType) columnMetadata.getType();
        ColumnTypeAttributes attributes = new ColumnTypeAttributes.ColumnTypeAttributesBuilder().precision(type.getPrecision()).scale(type.getScale()).build();
        builder.typeAttributes(attributes);
    }
}
Also used : ColumnTypeAttributes(org.apache.kudu.ColumnTypeAttributes) DecimalType(com.facebook.presto.common.type.DecimalType)

Example 17 with DecimalType

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

the class KuduPageSink method appendColumn.

private void appendColumn(PartialRow row, Page page, int position, int channel, int destChannel) {
    Block block = page.getBlock(channel);
    Type type = columnTypes.get(destChannel);
    if (block.isNull(position)) {
        row.setNull(destChannel);
    } else if (TIMESTAMP.equals(type)) {
        row.addLong(destChannel, type.getLong(block, position) * 1000);
    } else if (REAL.equals(type)) {
        row.addFloat(destChannel, intBitsToFloat((int) type.getLong(block, position)));
    } else if (BIGINT.equals(type)) {
        row.addLong(destChannel, type.getLong(block, position));
    } else if (INTEGER.equals(type)) {
        row.addInt(destChannel, (int) type.getLong(block, position));
    } else if (SMALLINT.equals(type)) {
        row.addShort(destChannel, (short) type.getLong(block, position));
    } else if (TINYINT.equals(type)) {
        row.addByte(destChannel, (byte) type.getLong(block, position));
    } else if (BOOLEAN.equals(type)) {
        row.addBoolean(destChannel, type.getBoolean(block, position));
    } else if (DOUBLE.equals(type)) {
        row.addDouble(destChannel, type.getDouble(block, position));
    } else if (isVarcharType(type)) {
        Type originalType = originalColumnTypes.get(destChannel);
        if (DATE.equals(originalType)) {
            SqlDate date = (SqlDate) originalType.getObjectValue(connectorSession.getSqlFunctionProperties(), block, position);
            LocalDateTime ldt = LocalDateTime.ofEpochSecond(TimeUnit.DAYS.toSeconds(date.getDays()), 0, ZoneOffset.UTC);
            byte[] bytes = ldt.format(DateTimeFormatter.ISO_LOCAL_DATE).getBytes(StandardCharsets.UTF_8);
            row.addStringUtf8(destChannel, bytes);
        } else {
            row.addString(destChannel, type.getSlice(block, position).toStringUtf8());
        }
    } else if (VARBINARY.equals(type)) {
        row.addBinary(destChannel, type.getSlice(block, position).toByteBuffer());
    } else if (type instanceof DecimalType) {
        SqlDecimal sqlDecimal = (SqlDecimal) type.getObjectValue(connectorSession.getSqlFunctionProperties(), block, position);
        row.addDecimal(destChannel, sqlDecimal.toBigDecimal());
    } else {
        throw new UnsupportedOperationException("Type is not supported: " + type);
    }
}
Also used : LocalDateTime(java.time.LocalDateTime) DecimalType(com.facebook.presto.common.type.DecimalType) Varchars.isVarcharType(com.facebook.presto.common.type.Varchars.isVarcharType) Type(com.facebook.presto.common.type.Type) SqlDate(com.facebook.presto.common.type.SqlDate) Block(com.facebook.presto.common.block.Block) DecimalType(com.facebook.presto.common.type.DecimalType) SqlDecimal(com.facebook.presto.common.type.SqlDecimal)

Example 18 with DecimalType

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

the class TestChecksumAggregation method testLongDecimal.

@Test
public void testLongDecimal() {
    InternalAggregationFunction decimalAgg = getAggregation(createDecimalType(19, 2));
    Block block = createLongDecimalsBlock("11.11", "22.22", null, "33.33", "44.44");
    DecimalType longDecimalType = createDecimalType(19);
    assertAggregation(decimalAgg, expectedChecksum(longDecimalType, block), block);
}
Also used : BlockAssertions.createLongsBlock(com.facebook.presto.block.BlockAssertions.createLongsBlock) BlockAssertions.createShortDecimalsBlock(com.facebook.presto.block.BlockAssertions.createShortDecimalsBlock) BlockAssertions.createLongDecimalsBlock(com.facebook.presto.block.BlockAssertions.createLongDecimalsBlock) BlockAssertions.createStringsBlock(com.facebook.presto.block.BlockAssertions.createStringsBlock) BlockAssertions.createArrayBigintBlock(com.facebook.presto.block.BlockAssertions.createArrayBigintBlock) BlockAssertions.createBooleansBlock(com.facebook.presto.block.BlockAssertions.createBooleansBlock) BlockAssertions.createDoublesBlock(com.facebook.presto.block.BlockAssertions.createDoublesBlock) Block(com.facebook.presto.common.block.Block) DecimalType(com.facebook.presto.common.type.DecimalType) DecimalType.createDecimalType(com.facebook.presto.common.type.DecimalType.createDecimalType) Test(org.testng.annotations.Test)

Example 19 with DecimalType

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

the class HiveUtil method parsePartitionValue.

public static NullableValue parsePartitionValue(String partitionName, String value, Type type, DateTimeZone timeZone) {
    verifyPartitionTypeSupported(partitionName, type);
    boolean isNull = HIVE_DEFAULT_DYNAMIC_PARTITION.equals(value);
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        if (isNull) {
            return NullableValue.asNull(decimalType);
        }
        if (decimalType.isShort()) {
            if (value.isEmpty()) {
                return NullableValue.of(decimalType, 0L);
            }
            return NullableValue.of(decimalType, shortDecimalPartitionKey(value, decimalType, partitionName));
        } else {
            if (value.isEmpty()) {
                return NullableValue.of(decimalType, Decimals.encodeUnscaledValue(BigInteger.ZERO));
            }
            return NullableValue.of(decimalType, longDecimalPartitionKey(value, decimalType, partitionName));
        }
    }
    if (BOOLEAN.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(BOOLEAN);
        }
        if (value.isEmpty()) {
            return NullableValue.of(BOOLEAN, false);
        }
        return NullableValue.of(BOOLEAN, booleanPartitionKey(value, partitionName));
    }
    if (TINYINT.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(TINYINT);
        }
        if (value.isEmpty()) {
            return NullableValue.of(TINYINT, 0L);
        }
        return NullableValue.of(TINYINT, tinyintPartitionKey(value, partitionName));
    }
    if (SMALLINT.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(SMALLINT);
        }
        if (value.isEmpty()) {
            return NullableValue.of(SMALLINT, 0L);
        }
        return NullableValue.of(SMALLINT, smallintPartitionKey(value, partitionName));
    }
    if (INTEGER.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(INTEGER);
        }
        if (value.isEmpty()) {
            return NullableValue.of(INTEGER, 0L);
        }
        return NullableValue.of(INTEGER, integerPartitionKey(value, partitionName));
    }
    if (BIGINT.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(BIGINT);
        }
        if (value.isEmpty()) {
            return NullableValue.of(BIGINT, 0L);
        }
        return NullableValue.of(BIGINT, bigintPartitionKey(value, partitionName));
    }
    if (DATE.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(DATE);
        }
        return NullableValue.of(DATE, datePartitionKey(value, partitionName));
    }
    if (TIMESTAMP.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(TIMESTAMP);
        }
        return NullableValue.of(TIMESTAMP, timestampPartitionKey(value, timeZone, partitionName));
    }
    if (REAL.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(REAL);
        }
        if (value.isEmpty()) {
            return NullableValue.of(REAL, (long) floatToRawIntBits(0.0f));
        }
        return NullableValue.of(REAL, floatPartitionKey(value, partitionName));
    }
    if (DOUBLE.equals(type)) {
        if (isNull) {
            return NullableValue.asNull(DOUBLE);
        }
        if (value.isEmpty()) {
            return NullableValue.of(DOUBLE, 0.0);
        }
        return NullableValue.of(DOUBLE, doublePartitionKey(value, partitionName));
    }
    if (isVarcharType(type)) {
        if (isNull) {
            return NullableValue.asNull(type);
        }
        return NullableValue.of(type, varcharPartitionKey(value, partitionName, type));
    }
    if (isCharType(type)) {
        if (isNull) {
            return NullableValue.asNull(type);
        }
        return NullableValue.of(type, charPartitionKey(value, partitionName, type));
    }
    throw new VerifyException(format("Unhandled type [%s] for partition: %s", type, partitionName));
}
Also used : VerifyException(com.google.common.base.VerifyException) DecimalType(com.facebook.presto.common.type.DecimalType) DecimalType.createDecimalType(com.facebook.presto.common.type.DecimalType.createDecimalType)

Example 20 with DecimalType

use of com.facebook.presto.common.type.DecimalType 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

DecimalType (com.facebook.presto.common.type.DecimalType)55 VarcharType (com.facebook.presto.common.type.VarcharType)28 Type (com.facebook.presto.common.type.Type)23 CharType (com.facebook.presto.common.type.CharType)20 Block (com.facebook.presto.common.block.Block)15 ArrayType (com.facebook.presto.common.type.ArrayType)15 RowType (com.facebook.presto.common.type.RowType)14 Slice (io.airlift.slice.Slice)14 ArrayList (java.util.ArrayList)13 PrestoException (com.facebook.presto.spi.PrestoException)12 TimestampType (com.facebook.presto.common.type.TimestampType)11 BigDecimal (java.math.BigDecimal)11 MapType (com.facebook.presto.common.type.MapType)10 Chars.isCharType (com.facebook.presto.common.type.Chars.isCharType)9 DateType (com.facebook.presto.common.type.DateType)9 IntegerType (com.facebook.presto.common.type.IntegerType)9 VarbinaryType (com.facebook.presto.common.type.VarbinaryType)9 ImmutableList (com.google.common.collect.ImmutableList)9 BigintType (com.facebook.presto.common.type.BigintType)8 BooleanType (com.facebook.presto.common.type.BooleanType)8