Search in sources :

Example 1 with CharType

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

the class OrcTester method preprocessWriteValueHive.

private static Object preprocessWriteValueHive(Type type, Object value) {
    if (value == null) {
        return null;
    }
    if (type.equals(BOOLEAN)) {
        return value;
    } else if (type.equals(TINYINT)) {
        return ((Number) value).byteValue();
    } else if (type.equals(SMALLINT)) {
        return ((Number) value).shortValue();
    } else if (type.equals(INTEGER)) {
        return ((Number) value).intValue();
    } else if (type.equals(BIGINT)) {
        return ((Number) value).longValue();
    } else if (type.equals(REAL)) {
        return ((Number) value).floatValue();
    } else if (type.equals(DOUBLE)) {
        return ((Number) value).doubleValue();
    } else if (type instanceof VarcharType) {
        return value;
    } else if (type instanceof CharType) {
        return new HiveChar((String) value, ((CharType) type).getLength());
    } else if (type.equals(VARBINARY)) {
        return ((SqlVarbinary) value).getBytes();
    } else if (type.equals(DATE)) {
        int days = ((SqlDate) value).getDays();
        LocalDate localDate = LocalDate.ofEpochDay(days);
        ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
        long millis = SECONDS.toMillis(zonedDateTime.toEpochSecond());
        Date date = new Date(0);
        // millis must be set separately to avoid masking
        date.setTime(millis);
        return date;
    } else if (type.equals(TIMESTAMP)) {
        long millisUtc = (int) ((SqlTimestamp) value).getMillisUtc();
        return new Timestamp(millisUtc);
    } else if (type instanceof DecimalType) {
        return HiveDecimal.create(((SqlDecimal) value).toBigDecimal());
    } else if (type.getTypeSignature().getBase().equals(StandardTypes.ARRAY)) {
        Type elementType = type.getTypeParameters().get(0);
        return ((List<?>) value).stream().map(element -> preprocessWriteValueHive(elementType, element)).collect(toList());
    } else if (type.getTypeSignature().getBase().equals(StandardTypes.MAP)) {
        Type keyType = type.getTypeParameters().get(0);
        Type valueType = type.getTypeParameters().get(1);
        Map<Object, Object> newMap = new HashMap<>();
        for (Entry<?, ?> entry : ((Map<?, ?>) value).entrySet()) {
            newMap.put(preprocessWriteValueHive(keyType, entry.getKey()), preprocessWriteValueHive(valueType, entry.getValue()));
        }
        return newMap;
    } else if (type.getTypeSignature().getBase().equals(StandardTypes.ROW)) {
        List<?> fieldValues = (List<?>) value;
        List<Type> fieldTypes = type.getTypeParameters();
        List<Object> newStruct = new ArrayList<>();
        for (int fieldId = 0; fieldId < fieldValues.size(); fieldId++) {
            newStruct.add(preprocessWriteValueHive(fieldTypes.get(fieldId), fieldValues.get(fieldId)));
        }
        return newStruct;
    }
    throw new IllegalArgumentException("unsupported type: " + type);
}
Also used : VarcharType(com.facebook.presto.common.type.VarcharType) HashMap(java.util.HashMap) HiveChar(org.apache.hadoop.hive.common.type.HiveChar) SqlTimestamp(com.facebook.presto.common.type.SqlTimestamp) LocalDate(java.time.LocalDate) SqlTimestamp(com.facebook.presto.common.type.SqlTimestamp) Timestamp(java.sql.Timestamp) SqlDate(com.facebook.presto.common.type.SqlDate) LocalDate(java.time.LocalDate) Date(java.sql.Date) DecimalType(com.facebook.presto.common.type.DecimalType) ArrayType(com.facebook.presto.common.type.ArrayType) CharType(com.facebook.presto.common.type.CharType) RowType(com.facebook.presto.common.type.RowType) VarcharType(com.facebook.presto.common.type.VarcharType) VarbinaryType(com.facebook.presto.common.type.VarbinaryType) MapType(com.facebook.presto.common.type.MapType) Type(com.facebook.presto.common.type.Type) ZonedDateTime(java.time.ZonedDateTime) SqlDate(com.facebook.presto.common.type.SqlDate) DecimalType(com.facebook.presto.common.type.DecimalType) OrcLazyObject(com.facebook.hive.orc.lazy.OrcLazyObject) Arrays.asList(java.util.Arrays.asList) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) Collectors.toList(java.util.stream.Collectors.toList) CharType(com.facebook.presto.common.type.CharType) Map(java.util.Map) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) ImmutableMap(com.google.common.collect.ImmutableMap) HashMap(java.util.HashMap)

Example 2 with CharType

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

the class TestJdbcQueryBuilder method setup.

@BeforeMethod
public void setup() throws SQLException {
    database = new TestingDatabase();
    jdbcClient = database.getJdbcClient();
    CharType charType = CharType.createCharType(0);
    session = new TestingConnectorSession(ImmutableList.of());
    columns = ImmutableList.of(new JdbcColumnHandle("test_id", "col_0", JDBC_BIGINT, BIGINT, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_1", JDBC_DOUBLE, DOUBLE, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_2", JDBC_BOOLEAN, BOOLEAN, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_3", JDBC_VARCHAR, VARCHAR, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_4", JDBC_DATE, DATE, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_5", JDBC_TIME, TIME, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_6", JDBC_TIMESTAMP, TIMESTAMP, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_7", JDBC_TINYINT, TINYINT, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_8", JDBC_SMALLINT, SMALLINT, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_9", JDBC_INTEGER, INTEGER, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_10", JDBC_REAL, REAL, true, Optional.empty()), new JdbcColumnHandle("test_id", "col_11", JDBC_CHAR, charType, true, Optional.empty()));
    Connection connection = database.getConnection();
    try (PreparedStatement preparedStatement = connection.prepareStatement("create table \"test_table\" (" + "" + "\"col_0\" BIGINT, " + "\"col_1\" DOUBLE, " + "\"col_2\" BOOLEAN, " + "\"col_3\" VARCHAR(128), " + "\"col_4\" DATE, " + "\"col_5\" TIME, " + "\"col_6\" TIMESTAMP, " + "\"col_7\" TINYINT, " + "\"col_8\" SMALLINT, " + "\"col_9\" INTEGER, " + "\"col_10\" REAL, " + "\"col_11\" CHAR(128) " + ")")) {
        preparedStatement.execute();
        StringBuilder stringBuilder = new StringBuilder("insert into \"test_table\" values ");
        int len = 1000;
        LocalDateTime dateTime = LocalDateTime.of(2016, 3, 23, 12, 23, 37);
        for (int i = 0; i < len; i++) {
            stringBuilder.append(format(Locale.ENGLISH, "(%d, %f, %b, 'test_str_%d', '%s', '%s', '%s', %d, %d, %d, %f, 'test_str_%d')", i, 200000.0 + i / 2.0, i % 2 == 0, i, Date.valueOf(dateTime.toLocalDate()), Time.valueOf(dateTime.toLocalTime()), Timestamp.valueOf(dateTime), i % 128, -i, i - 100, 100.0f + i, i));
            dateTime = dateTime.plusHours(26);
            if (i != len - 1) {
                stringBuilder.append(",");
            }
        }
        try (PreparedStatement preparedStatement2 = connection.prepareStatement(stringBuilder.toString())) {
            preparedStatement2.execute();
        }
    }
}
Also used : LocalDateTime(java.time.LocalDateTime) TestingConnectorSession(com.facebook.presto.testing.TestingConnectorSession) Connection(java.sql.Connection) PreparedStatement(java.sql.PreparedStatement) CharType(com.facebook.presto.common.type.CharType) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with CharType

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

the class QueryBuilder method buildSql.

public PreparedStatement buildSql(JdbcClient client, ConnectorSession session, Connection connection, String catalog, String schema, String table, List<JdbcColumnHandle> columns, TupleDomain<ColumnHandle> tupleDomain, Optional<JdbcExpression> additionalPredicate) throws SQLException {
    StringBuilder sql = new StringBuilder();
    String columnNames = columns.stream().map(JdbcColumnHandle::getColumnName).map(this::quote).collect(joining(", "));
    sql.append("SELECT ");
    sql.append(columnNames);
    if (columns.isEmpty()) {
        sql.append("null");
    }
    sql.append(" FROM ");
    if (!isNullOrEmpty(catalog)) {
        sql.append(quote(catalog)).append('.');
    }
    if (!isNullOrEmpty(schema)) {
        sql.append(quote(schema)).append('.');
    }
    sql.append(quote(table));
    List<TypeAndValue> accumulator = new ArrayList<>();
    List<String> clauses = toConjuncts(columns, tupleDomain, accumulator);
    if (additionalPredicate.isPresent()) {
        clauses = ImmutableList.<String>builder().addAll(clauses).add(additionalPredicate.get().getExpression()).build();
        accumulator.addAll(additionalPredicate.get().getBoundConstantValues().stream().map(constantExpression -> new TypeAndValue(constantExpression.getType(), constantExpression.getValue())).collect(ImmutableList.toImmutableList()));
    }
    if (!clauses.isEmpty()) {
        sql.append(" WHERE ").append(Joiner.on(" AND ").join(clauses));
    }
    sql.append(String.format("/* %s : %s */", session.getUser(), session.getQueryId()));
    PreparedStatement statement = client.getPreparedStatement(connection, sql.toString());
    for (int i = 0; i < accumulator.size(); i++) {
        TypeAndValue typeAndValue = accumulator.get(i);
        if (typeAndValue.getType().equals(BigintType.BIGINT)) {
            statement.setLong(i + 1, (long) typeAndValue.getValue());
        } else if (typeAndValue.getType().equals(IntegerType.INTEGER)) {
            statement.setInt(i + 1, ((Number) typeAndValue.getValue()).intValue());
        } else if (typeAndValue.getType().equals(SmallintType.SMALLINT)) {
            statement.setShort(i + 1, ((Number) typeAndValue.getValue()).shortValue());
        } else if (typeAndValue.getType().equals(TinyintType.TINYINT)) {
            statement.setByte(i + 1, ((Number) typeAndValue.getValue()).byteValue());
        } else if (typeAndValue.getType().equals(DoubleType.DOUBLE)) {
            statement.setDouble(i + 1, (double) typeAndValue.getValue());
        } else if (typeAndValue.getType().equals(RealType.REAL)) {
            statement.setFloat(i + 1, intBitsToFloat(((Number) typeAndValue.getValue()).intValue()));
        } else if (typeAndValue.getType().equals(BooleanType.BOOLEAN)) {
            statement.setBoolean(i + 1, (boolean) typeAndValue.getValue());
        } else if (typeAndValue.getType().equals(DateType.DATE)) {
            long millis = DAYS.toMillis((long) typeAndValue.getValue());
            statement.setDate(i + 1, new Date(UTC.getMillisKeepLocal(DateTimeZone.getDefault(), millis)));
        } else if (typeAndValue.getType().equals(TimeType.TIME)) {
            statement.setTime(i + 1, new Time((long) typeAndValue.getValue()));
        } else if (typeAndValue.getType().equals(TimeWithTimeZoneType.TIME_WITH_TIME_ZONE)) {
            statement.setTime(i + 1, new Time(unpackMillisUtc((long) typeAndValue.getValue())));
        } else if (typeAndValue.getType().equals(TimestampType.TIMESTAMP)) {
            statement.setTimestamp(i + 1, new Timestamp((long) typeAndValue.getValue()));
        } else if (typeAndValue.getType().equals(TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE)) {
            statement.setTimestamp(i + 1, new Timestamp(unpackMillisUtc((long) typeAndValue.getValue())));
        } else if (typeAndValue.getType() instanceof VarcharType) {
            statement.setString(i + 1, ((Slice) typeAndValue.getValue()).toStringUtf8());
        } else if (typeAndValue.getType() instanceof CharType) {
            statement.setString(i + 1, ((Slice) typeAndValue.getValue()).toStringUtf8());
        } else {
            throw new UnsupportedOperationException("Can't handle type: " + typeAndValue.getType());
        }
    }
    return statement;
}
Also used : VarcharType(com.facebook.presto.common.type.VarcharType) ArrayList(java.util.ArrayList) PreparedStatement(java.sql.PreparedStatement) Time(java.sql.Time) Timestamp(java.sql.Timestamp) Date(java.sql.Date) Slice(io.airlift.slice.Slice) CharType(com.facebook.presto.common.type.CharType)

Example 4 with CharType

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

the class HiveTypeTranslator method translate.

@Override
public TypeInfo translate(Type type, Optional<HiveType> defaultHiveType) {
    if (BOOLEAN.equals(type)) {
        return HIVE_BOOLEAN.getTypeInfo();
    }
    if (BIGINT.equals(type)) {
        return HIVE_LONG.getTypeInfo();
    }
    if (INTEGER.equals(type)) {
        return HIVE_INT.getTypeInfo();
    }
    if (SMALLINT.equals(type)) {
        return HIVE_SHORT.getTypeInfo();
    }
    if (TINYINT.equals(type)) {
        return HIVE_BYTE.getTypeInfo();
    }
    if (REAL.equals(type)) {
        return HIVE_FLOAT.getTypeInfo();
    }
    if (DOUBLE.equals(type)) {
        return HIVE_DOUBLE.getTypeInfo();
    }
    if (type instanceof VarcharType) {
        VarcharType varcharType = (VarcharType) type;
        int varcharLength = varcharType.getLength();
        if (varcharLength <= HiveVarchar.MAX_VARCHAR_LENGTH) {
            return getVarcharTypeInfo(varcharLength);
        } else if (varcharLength == VarcharType.UNBOUNDED_LENGTH) {
            return HIVE_STRING.getTypeInfo();
        } else {
            throw new PrestoException(NOT_SUPPORTED, format("Unsupported Hive type: %s. Supported VARCHAR types: VARCHAR(<=%d), VARCHAR.", type, HiveVarchar.MAX_VARCHAR_LENGTH));
        }
    }
    if (type instanceof EnumType<?>) {
        return translate(((EnumType<?>) type).getValueType());
    }
    if (type instanceof CharType) {
        CharType charType = (CharType) type;
        int charLength = charType.getLength();
        if (charLength <= HiveChar.MAX_CHAR_LENGTH) {
            return getCharTypeInfo(charLength);
        }
        throw new PrestoException(NOT_SUPPORTED, format("Unsupported Hive type: %s. Supported CHAR types: CHAR(<=%d).", type, HiveChar.MAX_CHAR_LENGTH));
    }
    if (type instanceof TypeWithName) {
        return translate(((TypeWithName) type).getType());
    }
    if (VARBINARY.equals(type)) {
        return HIVE_BINARY.getTypeInfo();
    }
    if (DATE.equals(type)) {
        return HIVE_DATE.getTypeInfo();
    }
    if (TIMESTAMP.equals(type)) {
        return HIVE_TIMESTAMP.getTypeInfo();
    }
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        return new DecimalTypeInfo(decimalType.getPrecision(), decimalType.getScale());
    }
    if (isArrayType(type)) {
        TypeInfo elementType = translate(type.getTypeParameters().get(0), defaultHiveType);
        return getListTypeInfo(elementType);
    }
    if (isMapType(type)) {
        TypeInfo keyType = translate(type.getTypeParameters().get(0), defaultHiveType);
        TypeInfo valueType = translate(type.getTypeParameters().get(1), defaultHiveType);
        return getMapTypeInfo(keyType, valueType);
    }
    if (isRowType(type)) {
        ImmutableList.Builder<String> fieldNames = ImmutableList.builder();
        for (TypeSignatureParameter parameter : type.getTypeSignature().getParameters()) {
            if (!parameter.isNamedTypeSignature()) {
                throw new IllegalArgumentException(format("Expected all parameters to be named type, but got %s", parameter));
            }
            NamedTypeSignature namedTypeSignature = parameter.getNamedTypeSignature();
            if (!namedTypeSignature.getName().isPresent()) {
                throw new PrestoException(NOT_SUPPORTED, format("Anonymous row type is not supported in Hive. Please give each field a name: %s", type));
            }
            fieldNames.add(namedTypeSignature.getName().get());
        }
        return getStructTypeInfo(fieldNames.build(), type.getTypeParameters().stream().map(t -> translate(t, defaultHiveType)).collect(toList()));
    }
    return defaultHiveType.orElseThrow(() -> new PrestoException(NOT_SUPPORTED, format("No default Hive type provided for unsupported Hive type: %s", type))).getTypeInfo();
}
Also used : TypeWithName(com.facebook.presto.common.type.TypeWithName) VarcharType(com.facebook.presto.common.type.VarcharType) ImmutableList(com.google.common.collect.ImmutableList) NamedTypeSignature(com.facebook.presto.common.type.NamedTypeSignature) PrestoException(com.facebook.presto.spi.PrestoException) TypeInfoFactory.getCharTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getCharTypeInfo) TypeInfoFactory.getStructTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getStructTypeInfo) TypeInfoFactory.getVarcharTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getVarcharTypeInfo) TypeInfoFactory.getMapTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getMapTypeInfo) DecimalTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo) TypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo) TypeInfoFactory.getListTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getListTypeInfo) DecimalTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo) TypeSignatureParameter(com.facebook.presto.common.type.TypeSignatureParameter) EnumType(com.facebook.presto.common.type.EnumType) DecimalType(com.facebook.presto.common.type.DecimalType) CharType(com.facebook.presto.common.type.CharType)

Example 5 with CharType

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

the class ParquetTester method writeValue.

private static void writeValue(Type type, BlockBuilder blockBuilder, Object value) {
    if (value == null) {
        blockBuilder.appendNull();
    } else {
        if (BOOLEAN.equals(type)) {
            type.writeBoolean(blockBuilder, (Boolean) value);
        } else if (TINYINT.equals(type) || SMALLINT.equals(type) || INTEGER.equals(type) || BIGINT.equals(type)) {
            type.writeLong(blockBuilder, ((Number) value).longValue());
        } else if (Decimals.isShortDecimal(type)) {
            type.writeLong(blockBuilder, ((SqlDecimal) value).getUnscaledValue().longValue());
        } else if (Decimals.isLongDecimal(type)) {
            if (Decimals.overflows(((SqlDecimal) value).getUnscaledValue(), MAX_PRECISION_INT64)) {
                type.writeSlice(blockBuilder, Decimals.encodeUnscaledValue(((SqlDecimal) value).toBigDecimal().unscaledValue()));
            } else {
                type.writeSlice(blockBuilder, Decimals.encodeUnscaledValue(((SqlDecimal) value).getUnscaledValue().longValue()));
            }
        } else if (DOUBLE.equals(type)) {
            type.writeDouble(blockBuilder, ((Number) value).doubleValue());
        } else if (REAL.equals(type)) {
            float floatValue = ((Number) value).floatValue();
            type.writeLong(blockBuilder, Float.floatToIntBits(floatValue));
        } else if (type instanceof VarcharType) {
            Slice slice = truncateToLength(utf8Slice((String) value), type);
            type.writeSlice(blockBuilder, slice);
        } else if (type instanceof CharType) {
            Slice slice = truncateToLengthAndTrimSpaces(utf8Slice((String) value), type);
            type.writeSlice(blockBuilder, slice);
        } else if (VARBINARY.equals(type)) {
            type.writeSlice(blockBuilder, Slices.wrappedBuffer(((SqlVarbinary) value).getBytes()));
        } else if (DATE.equals(type)) {
            long days = ((SqlDate) value).getDays();
            type.writeLong(blockBuilder, days);
        } else if (TIMESTAMP.equals(type)) {
            long millis = ((SqlTimestamp) value).getMillisUtc();
            type.writeLong(blockBuilder, millis);
        } else {
            if (type instanceof ArrayType) {
                List<?> array = (List<?>) value;
                Type elementType = type.getTypeParameters().get(0);
                BlockBuilder arrayBlockBuilder = blockBuilder.beginBlockEntry();
                for (Object elementValue : array) {
                    writeValue(elementType, arrayBlockBuilder, elementValue);
                }
                blockBuilder.closeEntry();
            } else if (type instanceof MapType) {
                Map<?, ?> map = (Map<?, ?>) value;
                Type keyType = type.getTypeParameters().get(0);
                Type valueType = type.getTypeParameters().get(1);
                BlockBuilder mapBlockBuilder = blockBuilder.beginBlockEntry();
                for (Map.Entry<?, ?> entry : map.entrySet()) {
                    writeValue(keyType, mapBlockBuilder, entry.getKey());
                    writeValue(valueType, mapBlockBuilder, entry.getValue());
                }
                blockBuilder.closeEntry();
            } else if (type instanceof RowType) {
                List<?> array = (List<?>) value;
                List<Type> fieldTypes = type.getTypeParameters();
                BlockBuilder rowBlockBuilder = blockBuilder.beginBlockEntry();
                for (int fieldId = 0; fieldId < fieldTypes.size(); fieldId++) {
                    Type fieldType = fieldTypes.get(fieldId);
                    writeValue(fieldType, rowBlockBuilder, array.get(fieldId));
                }
                blockBuilder.closeEntry();
            } else {
                throw new IllegalArgumentException("Unsupported type " + type);
            }
        }
    }
}
Also used : Varchars.isVarcharType(com.facebook.presto.common.type.Varchars.isVarcharType) VarcharType(com.facebook.presto.common.type.VarcharType) SqlVarbinary(com.facebook.presto.common.type.SqlVarbinary) RowType(com.facebook.presto.common.type.RowType) MetastoreUtil.isRowType(com.facebook.presto.hive.metastore.MetastoreUtil.isRowType) SqlDecimal(com.facebook.presto.common.type.SqlDecimal) SqlTimestamp(com.facebook.presto.common.type.SqlTimestamp) MapType(com.facebook.presto.common.type.MapType) MetastoreUtil.isMapType(com.facebook.presto.hive.metastore.MetastoreUtil.isMapType) ArrayType(com.facebook.presto.common.type.ArrayType) MetastoreUtil.isArrayType(com.facebook.presto.hive.metastore.MetastoreUtil.isArrayType) Varchars.isVarcharType(com.facebook.presto.common.type.Varchars.isVarcharType) DecimalType(com.facebook.presto.common.type.DecimalType) HiveUtil.isStructuralType(com.facebook.presto.hive.HiveUtil.isStructuralType) ArrayType(com.facebook.presto.common.type.ArrayType) CharType(com.facebook.presto.common.type.CharType) MetastoreUtil.isArrayType(com.facebook.presto.hive.metastore.MetastoreUtil.isArrayType) RowType(com.facebook.presto.common.type.RowType) MetastoreUtil.isRowType(com.facebook.presto.hive.metastore.MetastoreUtil.isRowType) VarcharType(com.facebook.presto.common.type.VarcharType) MessageType(org.apache.parquet.schema.MessageType) MapType(com.facebook.presto.common.type.MapType) Type(com.facebook.presto.common.type.Type) MetastoreUtil.isMapType(com.facebook.presto.hive.metastore.MetastoreUtil.isMapType) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) Slice(io.airlift.slice.Slice) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) CharType(com.facebook.presto.common.type.CharType) Map(java.util.Map) HashMap(java.util.HashMap) BlockBuilder(com.facebook.presto.common.block.BlockBuilder)

Aggregations

CharType (com.facebook.presto.common.type.CharType)29 DecimalType (com.facebook.presto.common.type.DecimalType)23 VarcharType (com.facebook.presto.common.type.VarcharType)22 Type (com.facebook.presto.common.type.Type)16 Slice (io.airlift.slice.Slice)11 ArrayType (com.facebook.presto.common.type.ArrayType)9 RowType (com.facebook.presto.common.type.RowType)9 TimestampType (com.facebook.presto.common.type.TimestampType)9 PrestoException (com.facebook.presto.spi.PrestoException)9 ArrayList (java.util.ArrayList)9 VarbinaryType (com.facebook.presto.common.type.VarbinaryType)8 BigintType (com.facebook.presto.common.type.BigintType)7 BooleanType (com.facebook.presto.common.type.BooleanType)7 Chars.isCharType (com.facebook.presto.common.type.Chars.isCharType)7 DateType (com.facebook.presto.common.type.DateType)7 DoubleType (com.facebook.presto.common.type.DoubleType)7 IntegerType (com.facebook.presto.common.type.IntegerType)7 MapType (com.facebook.presto.common.type.MapType)7 RealType (com.facebook.presto.common.type.RealType)7 SmallintType (com.facebook.presto.common.type.SmallintType)7