Search in sources :

Example 1 with TypeWithName

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

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

the class H2QueryRunner method rowMapper.

private static RowMapper<MaterializedRow> rowMapper(List<? extends Type> types) {
    return new RowMapper<MaterializedRow>() {

        private Object getValue(Type type, ResultSet resultSet, int position) throws SQLException {
            if (BOOLEAN.equals(type)) {
                boolean booleanValue = resultSet.getBoolean(position);
                return resultSet.wasNull() ? null : booleanValue;
            } else if (TINYINT.equals(type)) {
                byte byteValue = resultSet.getByte(position);
                return resultSet.wasNull() ? null : byteValue;
            } else if (SMALLINT.equals(type)) {
                short shortValue = resultSet.getShort(position);
                return resultSet.wasNull() ? null : shortValue;
            } else if (INTEGER.equals(type)) {
                int intValue = resultSet.getInt(position);
                return resultSet.wasNull() ? null : intValue;
            } else if (BIGINT.equals(type)) {
                long longValue = resultSet.getLong(position);
                return resultSet.wasNull() ? null : longValue;
            } else if (REAL.equals(type)) {
                float floatValue = resultSet.getFloat(position);
                return resultSet.wasNull() ? null : floatValue;
            } else if (DOUBLE.equals(type)) {
                double doubleValue = resultSet.getDouble(position);
                return resultSet.wasNull() ? null : doubleValue;
            } else if (isVarcharType(type)) {
                String stringValue = resultSet.getString(position);
                return resultSet.wasNull() ? null : stringValue;
            } else if (isCharType(type)) {
                String stringValue = resultSet.getString(position);
                return resultSet.wasNull() ? null : padEnd(stringValue, ((CharType) type).getLength(), ' ');
            } else if (VARBINARY.equals(type)) {
                byte[] binary = resultSet.getBytes(position);
                return resultSet.wasNull() ? null : binary;
            } else if (DATE.equals(type)) {
                // resultSet.getDate(i) doesn't work if JVM's zone skipped day being retrieved (e.g. 2011-12-30 and Pacific/Apia zone)
                LocalDate dateValue = resultSet.getObject(position, LocalDate.class);
                return resultSet.wasNull() ? null : dateValue;
            } else if (TIME.equals(type)) {
                // resultSet.getTime(i) doesn't work if JVM's zone had forward offset change during 1970-01-01 (e.g. America/Hermosillo zone)
                LocalTime timeValue = resultSet.getObject(position, LocalTime.class);
                return resultSet.wasNull() ? null : timeValue;
            } else if (TIME_WITH_TIME_ZONE.equals(type)) {
                throw new UnsupportedOperationException("H2 does not support TIME WITH TIME ZONE");
            } else if (TIMESTAMP.equals(type)) {
                // resultSet.getTimestamp(i) doesn't work if JVM's zone had forward offset at the date/time being retrieved
                LocalDateTime timestampValue;
                try {
                    timestampValue = resultSet.getObject(position, LocalDateTime.class);
                } catch (SQLException first) {
                    // H2 cannot convert DATE to LocalDateTime in their JDBC driver (even though it can convert to java.sql.Timestamp), we need to do this manually
                    try {
                        timestampValue = Optional.ofNullable(resultSet.getObject(position, LocalDate.class)).map(LocalDate::atStartOfDay).orElse(null);
                    } catch (RuntimeException e) {
                        first.addSuppressed(e);
                        throw first;
                    }
                }
                return resultSet.wasNull() ? null : timestampValue;
            } else if (TIMESTAMP_WITH_TIME_ZONE.equals(type)) {
                // This means H2 is unsuitable for testing TIMESTAMP WITH TIME ZONE-bearing queries. Those need to be tested manually.
                throw new UnsupportedOperationException();
            } else if (UNKNOWN.equals(type)) {
                Object objectValue = resultSet.getObject(position);
                checkState(resultSet.wasNull(), "Expected a null value, but got %s", objectValue);
                return null;
            } else if (type instanceof DecimalType) {
                DecimalType decimalType = (DecimalType) type;
                BigDecimal decimalValue = resultSet.getBigDecimal(position);
                return resultSet.wasNull() ? null : decimalValue.setScale(decimalType.getScale(), BigDecimal.ROUND_HALF_UP).round(new MathContext(decimalType.getPrecision()));
            } else if (type instanceof ArrayType) {
                Array array = resultSet.getArray(position);
                return resultSet.wasNull() ? null : newArrayList(mapArrayValues(((ArrayType) type), (Object[]) array.getArray()));
            } else if (type instanceof RowType) {
                Array array = resultSet.getArray(position);
                return resultSet.wasNull() ? null : newArrayList(mapRowValues((RowType) type, (Object[]) array.getArray()));
            } else if (type instanceof TypeWithName) {
                return getValue(((TypeWithName) type).getType(), resultSet, position);
            } else {
                throw new AssertionError("unhandled type: " + type);
            }
        }

        @Override
        public MaterializedRow map(ResultSet resultSet, StatementContext context) throws SQLException {
            int count = resultSet.getMetaData().getColumnCount();
            checkArgument(types.size() == count, "expected types count (%s) does not match actual column count (%s)", types.size(), count);
            List<Object> row = new ArrayList<>(count);
            for (int i = 1; i <= count; i++) {
                row.add(getValue(types.get(i - 1), resultSet, i));
            }
            return new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, row);
        }
    };
}
Also used : LocalDateTime(java.time.LocalDateTime) SQLException(java.sql.SQLException) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) ArrayList(java.util.ArrayList) RowType(com.facebook.presto.common.type.RowType) LocalDate(java.time.LocalDate) StatementContext(org.jdbi.v3.core.statement.StatementContext) ArrayType(com.facebook.presto.common.type.ArrayType) ResultSet(java.sql.ResultSet) RowMapper(org.jdbi.v3.core.mapper.RowMapper) TypeWithName(com.facebook.presto.common.type.TypeWithName) LocalTime(java.time.LocalTime) BigDecimal(java.math.BigDecimal) MathContext(java.math.MathContext) Array(java.sql.Array) Varchars.isVarcharType(com.facebook.presto.common.type.Varchars.isVarcharType) VarcharType(com.facebook.presto.common.type.VarcharType) TimestampType(com.facebook.presto.common.type.TimestampType) DecimalType(com.facebook.presto.common.type.DecimalType) Chars.isCharType(com.facebook.presto.common.type.Chars.isCharType) ArrayType(com.facebook.presto.common.type.ArrayType) CharType(com.facebook.presto.common.type.CharType) Type(com.facebook.presto.common.type.Type) RowType(com.facebook.presto.common.type.RowType) DecimalType(com.facebook.presto.common.type.DecimalType) Chars.isCharType(com.facebook.presto.common.type.Chars.isCharType) CharType(com.facebook.presto.common.type.CharType) MaterializedRow(com.facebook.presto.testing.MaterializedRow)

Example 3 with TypeWithName

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

the class SignatureBinder method applyBoundVariables.

public static Type applyBoundVariables(FunctionAndTypeManager functionAndTypeManager, TypeSignature typeSignature, BoundVariables boundVariables) {
    String baseType = typeSignature.getBase();
    if (boundVariables.containsTypeVariable(baseType)) {
        checkState(typeSignature.getParameters().isEmpty(), "Type parameters cannot have parameters");
        Type type = boundVariables.getTypeVariable(baseType);
        if (type instanceof TypeWithName) {
            return ((TypeWithName) type).getType();
        }
        return type;
    }
    List<TypeSignatureParameter> parameters = typeSignature.getParameters().stream().map(typeSignatureParameter -> applyBoundVariables(typeSignatureParameter, boundVariables)).collect(toList());
    return functionAndTypeManager.getParameterizedType(baseType, parameters);
}
Also used : StandardTypes(com.facebook.presto.common.type.StandardTypes) TypeSignatureParameter(com.facebook.presto.common.type.TypeSignatureParameter) LongVariableConstraint(com.facebook.presto.spi.function.LongVariableConstraint) HashMap(java.util.HashMap) TypeSignatureProvider.fromTypes(com.facebook.presto.sql.analyzer.TypeSignatureProvider.fromTypes) TypeSignature(com.facebook.presto.common.type.TypeSignature) HashSet(java.util.HashSet) TypeCalculation.calculateLiteralValue(com.facebook.presto.type.TypeCalculation.calculateLiteralValue) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) ImmutableList(com.google.common.collect.ImmutableList) Collectors.toMap(java.util.stream.Collectors.toMap) Verify.verify(com.google.common.base.Verify.verify) Map(java.util.Map) Objects.requireNonNull(java.util.Objects.requireNonNull) ParameterKind(com.facebook.presto.common.type.ParameterKind) Type(com.facebook.presto.common.type.Type) TypeWithName(com.facebook.presto.common.type.TypeWithName) NamedTypeSignature(com.facebook.presto.common.type.NamedTypeSignature) VerifyException(com.google.common.base.VerifyException) ImmutableSet(com.google.common.collect.ImmutableSet) TypeVariableConstraint(com.facebook.presto.spi.function.TypeVariableConstraint) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) FunctionType(com.facebook.presto.common.type.FunctionType) String.format(java.lang.String.format) Preconditions.checkState(com.google.common.base.Preconditions.checkState) Objects(java.util.Objects) List(java.util.List) UNKNOWN(com.facebook.presto.common.type.UnknownType.UNKNOWN) Collectors.toList(java.util.stream.Collectors.toList) Signature(com.facebook.presto.spi.function.Signature) Function.identity(java.util.function.Function.identity) TypeSignatureProvider(com.facebook.presto.sql.analyzer.TypeSignatureProvider) Optional(java.util.Optional) Collections(java.util.Collections) Type(com.facebook.presto.common.type.Type) FunctionType(com.facebook.presto.common.type.FunctionType) TypeWithName(com.facebook.presto.common.type.TypeWithName) TypeSignatureParameter(com.facebook.presto.common.type.TypeSignatureParameter)

Example 4 with TypeWithName

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

the class TestingPrestoClient method convertToRowValue.

private static Object convertToRowValue(Type type, Object value) {
    if (value == null) {
        return null;
    }
    if (BOOLEAN.equals(type)) {
        return value;
    } else if (TINYINT.equals(type)) {
        return ((Number) value).byteValue();
    } else if (SMALLINT.equals(type)) {
        return ((Number) value).shortValue();
    } else if (INTEGER.equals(type)) {
        return ((Number) value).intValue();
    } else if (BIGINT.equals(type)) {
        return ((Number) value).longValue();
    } else if (DOUBLE.equals(type)) {
        return ((Number) value).doubleValue();
    } else if (REAL.equals(type)) {
        return ((Number) value).floatValue();
    } else if (type instanceof VarcharType) {
        return value;
    } else if (isCharType(type)) {
        return value;
    } else if (VARBINARY.equals(type)) {
        return value;
    } else if (DATE.equals(type)) {
        return DateTimeFormatter.ISO_LOCAL_DATE.parse(((String) value), LocalDate::from);
    } else if (TIME.equals(type)) {
        return DateTimeFormatter.ISO_LOCAL_TIME.parse(((String) value), LocalTime::from);
    } else if (TIME_WITH_TIME_ZONE.equals(type)) {
        // Only zone-offset timezones are supported (TODO remove political timezones support for TIME WITH TIME ZONE)
        try {
            return timeWithUtcZoneFormat.parse(((String) value), LocalTime::from).atOffset(ZoneOffset.UTC);
        } catch (DateTimeParseException e) {
            return timeWithZoneOffsetFormat.parse(((String) value), OffsetTime::from);
        }
    } else if (TIMESTAMP.equals(type)) {
        return SqlTimestamp.JSON_FORMATTER.parse((String) value, LocalDateTime::from);
    } else if (TIMESTAMP_WITH_TIME_ZONE.equals(type)) {
        return timestampWithTimeZoneFormat.parse((String) value, ZonedDateTime::from);
    } else if (INTERVAL_DAY_TIME.equals(type)) {
        return new SqlIntervalDayTime(IntervalDayTime.parseMillis(String.valueOf(value)));
    } else if (INTERVAL_YEAR_MONTH.equals(type)) {
        return new SqlIntervalYearMonth(IntervalYearMonth.parseMonths(String.valueOf(value)));
    } else if (IPADDRESS.equals(type)) {
        return value;
    } else if (type instanceof ArrayType) {
        return ((List<Object>) value).stream().map(element -> convertToRowValue(((ArrayType) type).getElementType(), element)).collect(toList());
    } else if (type instanceof MapType) {
        return ((Map<Object, Object>) value).entrySet().stream().collect(Collectors.toMap(e -> convertToRowValue(((MapType) type).getKeyType(), e.getKey()), e -> convertToRowValue(((MapType) type).getValueType(), e.getValue())));
    } else if (type instanceof RowType) {
        Map<String, Object> data = (Map<String, Object>) value;
        RowType rowType = (RowType) type;
        return rowType.getFields().stream().map(field -> convertToRowValue(field.getType(), data.get(field.getName().get()))).collect(toList());
    } else if (type instanceof DecimalType) {
        return new BigDecimal((String) value);
    } else if (type instanceof JsonType) {
        return value;
    } else if (type instanceof VarcharEnumType) {
        return value;
    } else if (type instanceof BigintEnumType) {
        return ((Number) value).longValue();
    } else if (type instanceof TypeWithName) {
        return convertToRowValue(((TypeWithName) type).getType(), value);
    } else if (type.getTypeSignature().getBase().equals("ObjectId")) {
        return value;
    } else {
        throw new AssertionError("unhandled type: " + type);
    }
}
Also used : Iterables.transform(com.google.common.collect.Iterables.transform) TestingPrestoServer(com.facebook.presto.server.testing.TestingPrestoServer) ZonedDateTime(java.time.ZonedDateTime) BigintEnumType(com.facebook.presto.common.type.BigintEnumType) QueryData(com.facebook.presto.client.QueryData) JsonType(com.facebook.presto.common.type.JsonType) BigDecimal(java.math.BigDecimal) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) DEFAULT_PRECISION(com.facebook.presto.testing.MaterializedResult.DEFAULT_PRECISION) Map(java.util.Map) LocalTime(java.time.LocalTime) ZoneOffset(java.time.ZoneOffset) VarcharEnumType(com.facebook.presto.common.type.VarcharEnumType) OffsetTime(java.time.OffsetTime) TIME(com.facebook.presto.common.type.TimeType.TIME) Function(com.google.common.base.Function) IntervalYearMonth(com.facebook.presto.client.IntervalYearMonth) DOUBLE(com.facebook.presto.common.type.DoubleType.DOUBLE) Set(java.util.Set) VarcharType(com.facebook.presto.common.type.VarcharType) Collectors(java.util.stream.Collectors) Preconditions.checkState(com.google.common.base.Preconditions.checkState) DateTimeParseException(java.time.format.DateTimeParseException) List(java.util.List) SqlTimestamp(com.facebook.presto.common.type.SqlTimestamp) INTEGER(com.facebook.presto.common.type.IntegerType.INTEGER) LocalDate(java.time.LocalDate) SqlIntervalDayTime(com.facebook.presto.type.SqlIntervalDayTime) Optional(java.util.Optional) TIME_WITH_TIME_ZONE(com.facebook.presto.common.type.TimeWithTimeZoneType.TIME_WITH_TIME_ZONE) INTERVAL_YEAR_MONTH(com.facebook.presto.type.IntervalYearMonthType.INTERVAL_YEAR_MONTH) MapType(com.facebook.presto.common.type.MapType) DecimalType(com.facebook.presto.common.type.DecimalType) Chars.isCharType(com.facebook.presto.common.type.Chars.isCharType) TIMESTAMP_WITH_TIME_ZONE(com.facebook.presto.common.type.TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE) TINYINT(com.facebook.presto.common.type.TinyintType.TINYINT) LocalDateTime(java.time.LocalDateTime) TIMESTAMP(com.facebook.presto.common.type.TimestampType.TIMESTAMP) AtomicReference(java.util.concurrent.atomic.AtomicReference) DATE(com.facebook.presto.common.type.DateType.DATE) REAL(com.facebook.presto.common.type.RealType.REAL) ArrayList(java.util.ArrayList) OptionalLong(java.util.OptionalLong) ImmutableList(com.google.common.collect.ImmutableList) INTERVAL_DAY_TIME(com.facebook.presto.type.IntervalDayTimeType.INTERVAL_DAY_TIME) PrestoWarning(com.facebook.presto.spi.PrestoWarning) SqlIntervalYearMonth(com.facebook.presto.type.SqlIntervalYearMonth) BOOLEAN(com.facebook.presto.common.type.BooleanType.BOOLEAN) ArrayType(com.facebook.presto.common.type.ArrayType) Type(com.facebook.presto.common.type.Type) TypeWithName(com.facebook.presto.common.type.TypeWithName) BIGINT(com.facebook.presto.common.type.BigintType.BIGINT) Session(com.facebook.presto.Session) SqlTimestampWithTimeZone(com.facebook.presto.common.type.SqlTimestampWithTimeZone) QueryStatusInfo(com.facebook.presto.client.QueryStatusInfo) VARBINARY(com.facebook.presto.common.type.VarbinaryType.VARBINARY) MaterializedResult(com.facebook.presto.testing.MaterializedResult) Collectors.toList(java.util.stream.Collectors.toList) SMALLINT(com.facebook.presto.common.type.SmallintType.SMALLINT) MaterializedRow(com.facebook.presto.testing.MaterializedRow) DateTimeFormatter(java.time.format.DateTimeFormatter) IntervalDayTime(com.facebook.presto.client.IntervalDayTime) IPADDRESS(com.facebook.presto.type.IpAddressType.IPADDRESS) RowType(com.facebook.presto.common.type.RowType) JsonType(com.facebook.presto.common.type.JsonType) TypeWithName(com.facebook.presto.common.type.TypeWithName) VarcharType(com.facebook.presto.common.type.VarcharType) SqlIntervalYearMonth(com.facebook.presto.type.SqlIntervalYearMonth) RowType(com.facebook.presto.common.type.RowType) LocalDate(java.time.LocalDate) MapType(com.facebook.presto.common.type.MapType) BigDecimal(java.math.BigDecimal) ArrayType(com.facebook.presto.common.type.ArrayType) DateTimeParseException(java.time.format.DateTimeParseException) ZonedDateTime(java.time.ZonedDateTime) VarcharEnumType(com.facebook.presto.common.type.VarcharEnumType) SqlIntervalDayTime(com.facebook.presto.type.SqlIntervalDayTime) DecimalType(com.facebook.presto.common.type.DecimalType) List(java.util.List) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) Collectors.toList(java.util.stream.Collectors.toList) BigintEnumType(com.facebook.presto.common.type.BigintEnumType) Map(java.util.Map)

Aggregations

TypeWithName (com.facebook.presto.common.type.TypeWithName)4 DecimalType (com.facebook.presto.common.type.DecimalType)3 Type (com.facebook.presto.common.type.Type)3 VarcharType (com.facebook.presto.common.type.VarcharType)3 ArrayType (com.facebook.presto.common.type.ArrayType)2 CharType (com.facebook.presto.common.type.CharType)2 Chars.isCharType (com.facebook.presto.common.type.Chars.isCharType)2 NamedTypeSignature (com.facebook.presto.common.type.NamedTypeSignature)2 RowType (com.facebook.presto.common.type.RowType)2 TypeSignatureParameter (com.facebook.presto.common.type.TypeSignatureParameter)2 MaterializedRow (com.facebook.presto.testing.MaterializedRow)2 ImmutableList (com.google.common.collect.ImmutableList)2 Session (com.facebook.presto.Session)1 IntervalDayTime (com.facebook.presto.client.IntervalDayTime)1 IntervalYearMonth (com.facebook.presto.client.IntervalYearMonth)1 QueryData (com.facebook.presto.client.QueryData)1 QueryStatusInfo (com.facebook.presto.client.QueryStatusInfo)1 BigintEnumType (com.facebook.presto.common.type.BigintEnumType)1 BIGINT (com.facebook.presto.common.type.BigintType.BIGINT)1 BOOLEAN (com.facebook.presto.common.type.BooleanType.BOOLEAN)1