Search in sources :

Example 21 with CharType

use of io.trino.spi.type.CharType in project trino by trinodb.

the class TypeUtils method jdbcObjectToTrinoNative.

private static Object jdbcObjectToTrinoNative(ConnectorSession session, Object jdbcObject, Type type) {
    if (jdbcObject == null) {
        return null;
    }
    if (BOOLEAN.equals(type) || BIGINT.equals(type) || DOUBLE.equals(type)) {
        return jdbcObject;
    }
    if (TINYINT.equals(type)) {
        return (long) (byte) jdbcObject;
    }
    if (SMALLINT.equals(type)) {
        return (long) (short) jdbcObject;
    }
    if (INTEGER.equals(type)) {
        return (long) (int) jdbcObject;
    }
    if (type instanceof ArrayType) {
        return jdbcObjectArrayToBlock(session, ((ArrayType) type).getElementType(), (Object[]) jdbcObject);
    }
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        BigDecimal value = (BigDecimal) jdbcObject;
        if (decimalType.isShort()) {
            return encodeShortScaledValue(value, decimalType.getScale());
        }
        return encodeScaledValue(value, decimalType.getScale());
    }
    if (REAL.equals(type)) {
        return (long) floatToRawIntBits((float) jdbcObject);
    }
    if (DATE.equals(type)) {
        long localMillis = ((Date) jdbcObject).getTime();
        // Convert it to a ~midnight in UTC.
        long utcMillis = ISOChronology.getInstance().getZone().getMillisKeepLocal(UTC, localMillis);
        // convert to days
        return MILLISECONDS.toDays(utcMillis);
    }
    if (type instanceof VarcharType) {
        return utf8Slice((String) jdbcObject);
    }
    if (type instanceof CharType) {
        return utf8Slice(CharMatcher.is(' ').trimTrailingFrom((String) jdbcObject));
    }
    throw new TrinoException(NOT_SUPPORTED, format("Unsupported type %s and object type %s", type, jdbcObject.getClass()));
}
Also used : ArrayType(io.trino.spi.type.ArrayType) VarcharType(io.trino.spi.type.VarcharType) DecimalType(io.trino.spi.type.DecimalType) TrinoException(io.trino.spi.TrinoException) CharType(io.trino.spi.type.CharType) BigDecimal(java.math.BigDecimal) Date(java.sql.Date)

Example 22 with CharType

use of io.trino.spi.type.CharType in project trino by trinodb.

the class TypeUtils method trinoNativeToJdbcObject.

private static Object trinoNativeToJdbcObject(ConnectorSession session, Type type, Object object) {
    if (object == null) {
        return null;
    }
    if (DOUBLE.equals(type) || BOOLEAN.equals(type) || BIGINT.equals(type)) {
        return object;
    }
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        if (decimalType.isShort()) {
            BigInteger unscaledValue = BigInteger.valueOf((long) object);
            return new BigDecimal(unscaledValue, decimalType.getScale(), new MathContext(decimalType.getPrecision()));
        }
        BigInteger unscaledValue = ((Int128) object).toBigInteger();
        return new BigDecimal(unscaledValue, decimalType.getScale(), new MathContext(decimalType.getPrecision()));
    }
    if (REAL.equals(type)) {
        return intBitsToFloat(toIntExact((long) object));
    }
    if (TINYINT.equals(type)) {
        return SignedBytes.checkedCast((long) object);
    }
    if (SMALLINT.equals(type)) {
        return Shorts.checkedCast((long) object);
    }
    if (INTEGER.equals(type)) {
        return toIntExact((long) object);
    }
    if (DATE.equals(type)) {
        // convert to midnight in default time zone
        long millis = DAYS.toMillis((long) object);
        return new Date(UTC.getMillisKeepLocal(DateTimeZone.getDefault(), millis));
    }
    if (type instanceof VarcharType || type instanceof CharType) {
        return ((Slice) object).toStringUtf8();
    }
    if (type instanceof ArrayType) {
        // process subarray of multi-dimensional array
        return getJdbcObjectArray(session, ((ArrayType) type).getElementType(), (Block) object);
    }
    throw new TrinoException(NOT_SUPPORTED, "Unsupported type: " + type);
}
Also used : ArrayType(io.trino.spi.type.ArrayType) VarcharType(io.trino.spi.type.VarcharType) Slice(io.airlift.slice.Slice) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) DecimalType(io.trino.spi.type.DecimalType) BigInteger(java.math.BigInteger) TrinoException(io.trino.spi.TrinoException) CharType(io.trino.spi.type.CharType) Int128(io.trino.spi.type.Int128) BigDecimal(java.math.BigDecimal) MathContext(java.math.MathContext) Date(java.sql.Date)

Example 23 with CharType

use of io.trino.spi.type.CharType in project trino by trinodb.

the class TypeUtils method jdbcObjectToTrinoNative.

private static Object jdbcObjectToTrinoNative(ConnectorSession session, Object jdbcObject, Type type) {
    if (jdbcObject == null) {
        return null;
    }
    if (BOOLEAN.equals(type) || BIGINT.equals(type) || DOUBLE.equals(type)) {
        return jdbcObject;
    }
    if (TINYINT.equals(type)) {
        return (long) (byte) jdbcObject;
    }
    if (SMALLINT.equals(type)) {
        return (long) (short) jdbcObject;
    }
    if (INTEGER.equals(type)) {
        return (long) (int) jdbcObject;
    }
    if (type instanceof ArrayType) {
        return jdbcObjectArrayToBlock(session, ((ArrayType) type).getElementType(), (Object[]) jdbcObject);
    }
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        BigDecimal value = (BigDecimal) jdbcObject;
        if (decimalType.isShort()) {
            return encodeShortScaledValue(value, decimalType.getScale());
        }
        return encodeScaledValue(value, decimalType.getScale());
    }
    if (REAL.equals(type)) {
        return (long) floatToRawIntBits((float) jdbcObject);
    }
    if (DATE.equals(type)) {
        long localMillis = ((Date) jdbcObject).getTime();
        // Convert it to a ~midnight in UTC.
        long utcMillis = ISOChronology.getInstance().getZone().getMillisKeepLocal(UTC, localMillis);
        // convert to days
        return MILLISECONDS.toDays(utcMillis);
    }
    if (type instanceof VarcharType) {
        return utf8Slice((String) jdbcObject);
    }
    if (type instanceof CharType) {
        return utf8Slice(CharMatcher.is(' ').trimTrailingFrom((String) jdbcObject));
    }
    throw new TrinoException(NOT_SUPPORTED, format("Unsupported type %s and object type %s", type, jdbcObject.getClass()));
}
Also used : ArrayType(io.trino.spi.type.ArrayType) VarcharType(io.trino.spi.type.VarcharType) DecimalType(io.trino.spi.type.DecimalType) TrinoException(io.trino.spi.TrinoException) CharType(io.trino.spi.type.CharType) BigDecimal(java.math.BigDecimal) Date(java.sql.Date)

Example 24 with CharType

use of io.trino.spi.type.CharType in project trino by trinodb.

the class H2QueryRunner method rowMapper.

private static RowMapper<MaterializedRow> rowMapper(List<? extends Type> types) {
    return (resultSet, context) -> {
        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++) {
            Type type = types.get(i - 1);
            if (BOOLEAN.equals(type)) {
                boolean booleanValue = resultSet.getBoolean(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(booleanValue);
                }
            } else if (TINYINT.equals(type)) {
                byte byteValue = resultSet.getByte(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(byteValue);
                }
            } else if (SMALLINT.equals(type)) {
                short shortValue = resultSet.getShort(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(shortValue);
                }
            } else if (INTEGER.equals(type)) {
                int intValue = resultSet.getInt(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(intValue);
                }
            } else if (BIGINT.equals(type)) {
                long longValue = resultSet.getLong(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(longValue);
                }
            } else if (REAL.equals(type)) {
                float floatValue = resultSet.getFloat(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(floatValue);
                }
            } else if (DOUBLE.equals(type)) {
                double doubleValue = resultSet.getDouble(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(doubleValue);
                }
            } else if (JSON.equals(type)) {
                String stringValue = resultSet.getString(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(jsonParse(utf8Slice(stringValue)).toStringUtf8());
                }
            } else if (type instanceof VarcharType) {
                String stringValue = resultSet.getString(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(stringValue);
                }
            } else if (type instanceof CharType) {
                String stringValue = resultSet.getString(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(padSpaces(stringValue, (CharType) type));
                }
            } else if (VARBINARY.equals(type)) {
                byte[] bytes = resultSet.getBytes(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(bytes);
                }
            } 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(i, LocalDate.class);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(dateValue);
                }
            } else if (type instanceof TimeType) {
                // 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(i, LocalTime.class);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(timeValue);
                }
            } else if (TIME_WITH_TIME_ZONE.equals(type)) {
                throw new UnsupportedOperationException("H2 does not support TIME WITH TIME ZONE");
            } else if (type instanceof TimestampType) {
                // 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(i, 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(i, LocalDate.class)).map(LocalDate::atStartOfDay).orElse(null);
                    } catch (RuntimeException e) {
                        first.addSuppressed(e);
                        throw first;
                    }
                }
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(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 (UUID.equals(type)) {
                java.util.UUID value = (java.util.UUID) resultSet.getObject(i);
                row.add(value);
            } else if (UNKNOWN.equals(type)) {
                Object objectValue = resultSet.getObject(i);
                checkState(resultSet.wasNull(), "Expected a null value, but got %s", objectValue);
                row.add(null);
            } else if (type instanceof DecimalType) {
                DecimalType decimalType = (DecimalType) type;
                BigDecimal decimalValue = resultSet.getBigDecimal(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(decimalValue.setScale(decimalType.getScale(), BigDecimal.ROUND_HALF_UP).round(new MathContext(decimalType.getPrecision())));
                }
            } else if (type instanceof ArrayType) {
                Array array = resultSet.getArray(i);
                if (resultSet.wasNull()) {
                    row.add(null);
                } else {
                    row.add(newArrayList((Object[]) array.getArray()));
                }
            } else {
                throw new AssertionError("unhandled type: " + type);
            }
        }
        return new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, row);
    };
}
Also used : DateTimeZone(org.joda.time.DateTimeZone) PreparedBatch(org.jdbi.v3.core.statement.PreparedBatch) TpchRecordSet.createTpchRecordSet(io.trino.plugin.tpch.TpchRecordSet.createTpchRecordSet) UNKNOWN(io.trino.type.UnknownType.UNKNOWN) Array(java.sql.Array) CUSTOMER(io.trino.tpch.TpchTable.CUSTOMER) BigDecimal(java.math.BigDecimal) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) TpchTableHandle(io.trino.plugin.tpch.TpchTableHandle) ParsedSql(org.jdbi.v3.core.statement.ParsedSql) Handle(org.jdbi.v3.core.Handle) LocalTime(java.time.LocalTime) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) TIMESTAMP_WITH_TIME_ZONE(io.trino.spi.type.TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE) INTEGER(io.trino.spi.type.IntegerType.INTEGER) UUID(io.trino.spi.type.UuidType.UUID) SMALLINT(io.trino.spi.type.SmallintType.SMALLINT) TpchTable(io.trino.tpch.TpchTable) PART(io.trino.tpch.TpchTable.PART) MathContext(java.math.MathContext) Collections.nCopies(java.util.Collections.nCopies) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) REGION(io.trino.tpch.TpchTable.REGION) ArrayType(io.trino.spi.type.ArrayType) SchemaTableName(io.trino.spi.connector.SchemaTableName) String.format(java.lang.String.format) StatementContext(org.jdbi.v3.core.statement.StatementContext) Preconditions.checkState(com.google.common.base.Preconditions.checkState) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) BIGINT(io.trino.spi.type.BigintType.BIGINT) LocalDate(java.time.LocalDate) RecordSet(io.trino.spi.connector.RecordSet) Optional(java.util.Optional) DecimalType(io.trino.spi.type.DecimalType) DATE(io.trino.spi.type.DateType.DATE) REAL(io.trino.spi.type.RealType.REAL) LINE_ITEM(io.trino.tpch.TpchTable.LINE_ITEM) Joiner(com.google.common.base.Joiner) Session(io.trino.Session) NATION(io.trino.tpch.TpchTable.NATION) TimeType(io.trino.spi.type.TimeType) ColumnMetadata(io.trino.spi.connector.ColumnMetadata) Type(io.trino.spi.type.Type) LocalDateTime(java.time.LocalDateTime) BOOLEAN(io.trino.spi.type.BooleanType.BOOLEAN) ConnectorTableMetadata(io.trino.spi.connector.ConnectorTableMetadata) JsonFunctions.jsonParse(io.trino.operator.scalar.JsonFunctions.jsonParse) TimestampType(io.trino.spi.type.TimestampType) ORDERS(io.trino.tpch.TpchTable.ORDERS) ArrayList(java.util.ArrayList) VarcharType(io.trino.spi.type.VarcharType) TIME_WITH_TIME_ZONE(io.trino.spi.type.TimeWithTimeZoneType.TIME_WITH_TIME_ZONE) SQLException(java.sql.SQLException) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Chars.padSpaces(io.trino.spi.type.Chars.padSpaces) VARBINARY(io.trino.spi.type.VarbinaryType.VARBINARY) Math.toIntExact(java.lang.Math.toIntExact) RowMapper(org.jdbi.v3.core.mapper.RowMapper) Jdbi(org.jdbi.v3.core.Jdbi) TINY_SCHEMA_NAME(io.trino.plugin.tpch.TpchMetadata.TINY_SCHEMA_NAME) RecordCursor(io.trino.spi.connector.RecordCursor) Language(org.intellij.lang.annotations.Language) Date(java.sql.Date) TimeUnit(java.util.concurrent.TimeUnit) DOUBLE(io.trino.spi.type.DoubleType.DOUBLE) CharType(io.trino.spi.type.CharType) Closeable(java.io.Closeable) TpchMetadata(io.trino.plugin.tpch.TpchMetadata) SqlParser(org.jdbi.v3.core.statement.SqlParser) TINYINT(io.trino.spi.type.TinyintType.TINYINT) JSON(io.trino.type.JsonType.JSON) LocalDateTime(java.time.LocalDateTime) VarcharType(io.trino.spi.type.VarcharType) SQLException(java.sql.SQLException) LocalDate(java.time.LocalDate) TimeType(io.trino.spi.type.TimeType) ArrayType(io.trino.spi.type.ArrayType) TimestampType(io.trino.spi.type.TimestampType) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) ArrayList(java.util.ArrayList) UUID(io.trino.spi.type.UuidType.UUID) LocalTime(java.time.LocalTime) BigDecimal(java.math.BigDecimal) MathContext(java.math.MathContext) Array(java.sql.Array) ArrayType(io.trino.spi.type.ArrayType) DecimalType(io.trino.spi.type.DecimalType) TimeType(io.trino.spi.type.TimeType) Type(io.trino.spi.type.Type) TimestampType(io.trino.spi.type.TimestampType) VarcharType(io.trino.spi.type.VarcharType) CharType(io.trino.spi.type.CharType) DecimalType(io.trino.spi.type.DecimalType) CharType(io.trino.spi.type.CharType)

Example 25 with CharType

use of io.trino.spi.type.CharType in project trino by trinodb.

the class PostgreSqlClient method toWriteMapping.

@Override
public WriteMapping toWriteMapping(ConnectorSession session, Type type) {
    if (type == BOOLEAN) {
        return WriteMapping.booleanMapping("boolean", booleanWriteFunction());
    }
    if (type == TINYINT) {
        // PostgreSQL has no type corresponding to tinyint
        return WriteMapping.longMapping("smallint", tinyintWriteFunction());
    }
    if (type == SMALLINT) {
        return WriteMapping.longMapping("smallint", smallintWriteFunction());
    }
    if (type == INTEGER) {
        return WriteMapping.longMapping("integer", integerWriteFunction());
    }
    if (type == BIGINT) {
        return WriteMapping.longMapping("bigint", bigintWriteFunction());
    }
    if (type == REAL) {
        return WriteMapping.longMapping("real", realWriteFunction());
    }
    if (type == DOUBLE) {
        return WriteMapping.doubleMapping("double precision", doubleWriteFunction());
    }
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        String dataType = format("decimal(%s, %s)", decimalType.getPrecision(), decimalType.getScale());
        if (decimalType.isShort()) {
            return WriteMapping.longMapping(dataType, shortDecimalWriteFunction(decimalType));
        }
        return WriteMapping.objectMapping(dataType, longDecimalWriteFunction(decimalType));
    }
    if (type instanceof CharType) {
        return WriteMapping.sliceMapping("char(" + ((CharType) type).getLength() + ")", charWriteFunction());
    }
    if (type instanceof VarcharType) {
        VarcharType varcharType = (VarcharType) type;
        String dataType;
        if (varcharType.isUnbounded()) {
            dataType = "varchar";
        } else {
            dataType = "varchar(" + varcharType.getBoundedLength() + ")";
        }
        return WriteMapping.sliceMapping(dataType, varcharWriteFunction());
    }
    if (VARBINARY.equals(type)) {
        return WriteMapping.sliceMapping("bytea", varbinaryWriteFunction());
    }
    if (type == DATE) {
        return WriteMapping.longMapping("date", dateWriteFunctionUsingLocalDate());
    }
    if (type instanceof TimeType) {
        TimeType timeType = (TimeType) type;
        if (timeType.getPrecision() <= POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION) {
            return WriteMapping.longMapping(format("time(%s)", timeType.getPrecision()), timeWriteFunction(timeType.getPrecision()));
        }
        return WriteMapping.longMapping(format("time(%s)", POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION), timeWriteFunction(POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION));
    }
    if (type instanceof TimestampType) {
        TimestampType timestampType = (TimestampType) type;
        if (timestampType.getPrecision() <= POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION) {
            verify(timestampType.getPrecision() <= TimestampType.MAX_SHORT_PRECISION);
            return WriteMapping.longMapping(format("timestamp(%s)", timestampType.getPrecision()), PostgreSqlClient::shortTimestampWriteFunction);
        }
        verify(timestampType.getPrecision() > TimestampType.MAX_SHORT_PRECISION);
        return WriteMapping.objectMapping(format("timestamp(%s)", POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION), longTimestampWriteFunction());
    }
    if (type instanceof TimestampWithTimeZoneType) {
        TimestampWithTimeZoneType timestampWithTimeZoneType = (TimestampWithTimeZoneType) type;
        if (timestampWithTimeZoneType.getPrecision() <= POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION) {
            String dataType = format("timestamptz(%d)", timestampWithTimeZoneType.getPrecision());
            if (timestampWithTimeZoneType.getPrecision() <= TimestampWithTimeZoneType.MAX_SHORT_PRECISION) {
                return WriteMapping.longMapping(dataType, shortTimestampWithTimeZoneWriteFunction());
            }
            return WriteMapping.objectMapping(dataType, longTimestampWithTimeZoneWriteFunction());
        }
        return WriteMapping.objectMapping(format("timestamptz(%d)", POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION), longTimestampWithTimeZoneWriteFunction());
    }
    if (type.equals(jsonType)) {
        return WriteMapping.sliceMapping("jsonb", typedVarcharWriteFunction("json"));
    }
    if (type.equals(uuidType)) {
        return WriteMapping.sliceMapping("uuid", uuidWriteFunction());
    }
    if (type instanceof ArrayType && getArrayMapping(session) == AS_ARRAY) {
        Type elementType = ((ArrayType) type).getElementType();
        String elementDataType = toWriteMapping(session, elementType).getDataType();
        return WriteMapping.objectMapping(elementDataType + "[]", arrayWriteFunction(session, elementType, getArrayElementPgTypeName(session, this, elementType)));
    }
    throw new TrinoException(NOT_SUPPORTED, "Unsupported column type: " + type.getDisplayName());
}
Also used : ArrayType(io.trino.spi.type.ArrayType) TimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType) TypeSignature.mapType(io.trino.spi.type.TypeSignature.mapType) TimestampType(io.trino.spi.type.TimestampType) MapType(io.trino.spi.type.MapType) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) TimestampType.createTimestampType(io.trino.spi.type.TimestampType.createTimestampType) DecimalType(io.trino.spi.type.DecimalType) TimeType(io.trino.spi.type.TimeType) TimestampWithTimeZoneType.createTimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType.createTimestampWithTimeZoneType) CharType.createCharType(io.trino.spi.type.CharType.createCharType) DecimalType.createDecimalType(io.trino.spi.type.DecimalType.createDecimalType) CharType(io.trino.spi.type.CharType) ArrayType(io.trino.spi.type.ArrayType) Type(io.trino.spi.type.Type) VarcharType.createUnboundedVarcharType(io.trino.spi.type.VarcharType.createUnboundedVarcharType) TimeType.createTimeType(io.trino.spi.type.TimeType.createTimeType) VarcharType(io.trino.spi.type.VarcharType) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) VarcharType.createUnboundedVarcharType(io.trino.spi.type.VarcharType.createUnboundedVarcharType) VarcharType(io.trino.spi.type.VarcharType) TimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType) TimestampWithTimeZoneType.createTimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType.createTimestampWithTimeZoneType) DecimalType(io.trino.spi.type.DecimalType) DecimalType.createDecimalType(io.trino.spi.type.DecimalType.createDecimalType) TimestampType(io.trino.spi.type.TimestampType) TimestampType.createTimestampType(io.trino.spi.type.TimestampType.createTimestampType) TrinoException(io.trino.spi.TrinoException) CharType.createCharType(io.trino.spi.type.CharType.createCharType) CharType(io.trino.spi.type.CharType) TimeType(io.trino.spi.type.TimeType) TimeType.createTimeType(io.trino.spi.type.TimeType.createTimeType)

Aggregations

CharType (io.trino.spi.type.CharType)50 VarcharType (io.trino.spi.type.VarcharType)45 DecimalType (io.trino.spi.type.DecimalType)39 TrinoException (io.trino.spi.TrinoException)28 ArrayType (io.trino.spi.type.ArrayType)20 TimestampType (io.trino.spi.type.TimestampType)20 Type (io.trino.spi.type.Type)19 DecimalType.createDecimalType (io.trino.spi.type.DecimalType.createDecimalType)16 Slice (io.airlift.slice.Slice)13 TimeType (io.trino.spi.type.TimeType)12 VarbinaryType (io.trino.spi.type.VarbinaryType)12 VarcharType.createUnboundedVarcharType (io.trino.spi.type.VarcharType.createUnboundedVarcharType)12 MapType (io.trino.spi.type.MapType)11 RowType (io.trino.spi.type.RowType)11 ImmutableList (com.google.common.collect.ImmutableList)10 TimestampWithTimeZoneType (io.trino.spi.type.TimestampWithTimeZoneType)10 Slices.utf8Slice (io.airlift.slice.Slices.utf8Slice)9 ArrayList (java.util.ArrayList)9 List (java.util.List)9 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)8