Search in sources :

Example 16 with TimestampType

use of io.trino.spi.type.TimestampType in project TiBigData by tidb-incubator.

the class TypeHelpers method toSqlString.

public static String toSqlString(Type type) {
    if (type instanceof TimeWithTimeZoneType || type instanceof TimestampWithTimeZoneType) {
        throw new TrinoException(NOT_SUPPORTED, "Unsupported column type: " + type.getDisplayName());
    }
    if (type instanceof TimestampType) {
        return format("timestamp(%s)", ((TimestampType) type).getPrecision());
    }
    if (type instanceof VarcharType) {
        VarcharType varcharType = (VarcharType) type;
        if (varcharType.isUnbounded()) {
            return "longtext";
        }
        Integer length = varcharType.getLength().orElseThrow(IllegalStateException::new);
        if (length <= 255) {
            return "tinytext";
        }
        if (length <= 65535) {
            return "text";
        }
        if (length <= 16777215) {
            return "mediumtext";
        }
        return "longtext";
    }
    if (type instanceof CharType) {
        int length = ((CharType) type).getLength();
        if (length <= 255) {
            return "char(" + length + ")";
        }
        return "text";
    }
    if (type instanceof DecimalType) {
        return format("decimal(%s, %s)", ((DecimalType) type).getPrecision(), ((DecimalType) type).getScale());
    }
    if (type instanceof TimeType) {
        return format("time(%s)", ((TimeType) type).getPrecision());
    }
    String sqlType = SQL_TYPES.get(type);
    if (sqlType != null) {
        return sqlType;
    }
    return type.getDisplayName();
}
Also used : VarcharType(io.trino.spi.type.VarcharType) TimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType) TimeWithTimeZoneType(io.trino.spi.type.TimeWithTimeZoneType) TrinoException(io.trino.spi.TrinoException) TimestampType(io.trino.spi.type.TimestampType) DecimalType(io.trino.spi.type.DecimalType) DecimalType.createDecimalType(io.trino.spi.type.DecimalType.createDecimalType) CharType(io.trino.spi.type.CharType) TimeType(io.trino.spi.type.TimeType)

Example 17 with TimestampType

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

the class HiveWriteUtils method getJavaObjectInspector.

public static ObjectInspector getJavaObjectInspector(Type type) {
    if (type.equals(BOOLEAN)) {
        return javaBooleanObjectInspector;
    }
    if (type.equals(BIGINT)) {
        return javaLongObjectInspector;
    }
    if (type.equals(INTEGER)) {
        return javaIntObjectInspector;
    }
    if (type.equals(SMALLINT)) {
        return javaShortObjectInspector;
    }
    if (type.equals(TINYINT)) {
        return javaByteObjectInspector;
    }
    if (type.equals(REAL)) {
        return javaFloatObjectInspector;
    }
    if (type.equals(DOUBLE)) {
        return javaDoubleObjectInspector;
    }
    if (type instanceof VarcharType) {
        return writableStringObjectInspector;
    }
    if (type instanceof CharType) {
        return writableHiveCharObjectInspector;
    }
    if (type.equals(VARBINARY)) {
        return javaByteArrayObjectInspector;
    }
    if (type.equals(DATE)) {
        return javaDateObjectInspector;
    }
    if (type instanceof TimestampType) {
        return javaTimestampObjectInspector;
    }
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        return getPrimitiveJavaObjectInspector(new DecimalTypeInfo(decimalType.getPrecision(), decimalType.getScale()));
    }
    if (isArrayType(type)) {
        return ObjectInspectorFactory.getStandardListObjectInspector(getJavaObjectInspector(type.getTypeParameters().get(0)));
    }
    if (isMapType(type)) {
        ObjectInspector keyObjectInspector = getJavaObjectInspector(type.getTypeParameters().get(0));
        ObjectInspector valueObjectInspector = getJavaObjectInspector(type.getTypeParameters().get(1));
        return ObjectInspectorFactory.getStandardMapObjectInspector(keyObjectInspector, valueObjectInspector);
    }
    if (isRowType(type)) {
        return ObjectInspectorFactory.getStandardStructObjectInspector(type.getTypeSignature().getParameters().stream().map(parameter -> parameter.getNamedTypeSignature().getName().get()).collect(toImmutableList()), type.getTypeParameters().stream().map(HiveWriteUtils::getJavaObjectInspector).collect(toImmutableList()));
    }
    throw new IllegalArgumentException("unsupported type: " + type);
}
Also used : DecimalTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo) 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) 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(io.trino.spi.type.VarcharType) TimestampType(io.trino.spi.type.TimestampType) DecimalType(io.trino.spi.type.DecimalType) CharType(io.trino.spi.type.CharType)

Example 18 with TimestampType

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

the class HiveWriteUtils method getRowColumnInspector.

public static ObjectInspector getRowColumnInspector(Type type) {
    if (type.equals(BOOLEAN)) {
        return writableBooleanObjectInspector;
    }
    if (type.equals(BIGINT)) {
        return writableLongObjectInspector;
    }
    if (type.equals(INTEGER)) {
        return writableIntObjectInspector;
    }
    if (type.equals(SMALLINT)) {
        return writableShortObjectInspector;
    }
    if (type.equals(TINYINT)) {
        return writableByteObjectInspector;
    }
    if (type.equals(REAL)) {
        return writableFloatObjectInspector;
    }
    if (type.equals(DOUBLE)) {
        return writableDoubleObjectInspector;
    }
    if (type instanceof VarcharType) {
        VarcharType varcharType = (VarcharType) type;
        if (varcharType.isUnbounded()) {
            // Values for such columns must be stored as STRING in Hive
            return writableStringObjectInspector;
        }
        if (varcharType.getBoundedLength() <= HiveVarchar.MAX_VARCHAR_LENGTH) {
            // VARCHAR columns with the length less than or equal to 65535 are supported natively by Hive
            return getPrimitiveWritableObjectInspector(getVarcharTypeInfo(varcharType.getBoundedLength()));
        }
    }
    if (type instanceof CharType) {
        CharType charType = (CharType) type;
        int charLength = charType.getLength();
        return getPrimitiveWritableObjectInspector(getCharTypeInfo(charLength));
    }
    if (type.equals(VARBINARY)) {
        return writableBinaryObjectInspector;
    }
    if (type.equals(DATE)) {
        return writableDateObjectInspector;
    }
    if (type instanceof TimestampType) {
        return writableTimestampObjectInspector;
    }
    if (type instanceof DecimalType) {
        DecimalType decimalType = (DecimalType) type;
        return getPrimitiveWritableObjectInspector(new DecimalTypeInfo(decimalType.getPrecision(), decimalType.getScale()));
    }
    if (isArrayType(type) || isMapType(type) || isRowType(type)) {
        return getJavaObjectInspector(type);
    }
    throw new IllegalArgumentException("unsupported type: " + type);
}
Also used : DecimalTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo) VarcharType(io.trino.spi.type.VarcharType) TimestampType(io.trino.spi.type.TimestampType) DecimalType(io.trino.spi.type.DecimalType) CharType(io.trino.spi.type.CharType)

Example 19 with TimestampType

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

the class TestHiveBucketing method testHashingCompare.

@Test
public void testHashingCompare() {
    assertBucketEquals("string", "Trino rocks", 1132136730, -399107423);
    assertEquals(HiveBucketing.getBucketNumber(1132136730, 4), 2);
    assertEquals(HiveBucketing.getBucketNumber(-399107423, 4), 1);
    assertBucketEquals("boolean", null, 0, 0);
    assertBucketEquals("boolean", true, 1, 1);
    assertBucketEquals("boolean", false, 0, 0);
    assertBucketEquals("tinyint", null, 0, 0);
    assertBucketEquals("tinyint", (byte) 5, 5, 5);
    assertBucketEquals("tinyint", Byte.MIN_VALUE, -128, -128);
    assertBucketEquals("tinyint", Byte.MAX_VALUE, 127, 127);
    assertBucketEquals("smallint", null, 0, 0);
    assertBucketEquals("smallint", (short) 300, 300, 2107031704);
    assertBucketEquals("smallint", Short.MIN_VALUE, -32768, 1342976838);
    assertBucketEquals("smallint", Short.MAX_VALUE, 32767, -684075052);
    assertBucketEquals("int", null, 0, 0);
    assertBucketEquals("int", 300_000, 300000, -678663480);
    assertBucketEquals("int", Integer.MIN_VALUE, -2147483648, 1194881028);
    assertBucketEquals("int", Integer.MAX_VALUE, 2147483647, 1133859967);
    assertBucketEquals("bigint", null, 0, 0);
    assertBucketEquals("bigint", 300_000_000_000L, -647710651, -888935297);
    assertBucketEquals("bigint", Long.MIN_VALUE, -2147483648, 1728983947);
    assertBucketEquals("bigint", Long.MAX_VALUE, -2147483648, -536577852);
    assertBucketEquals("float", null, 0, 0);
    assertBucketEquals("float", 12.34F, 1095069860, -381747602);
    assertBucketEquals("float", -Float.MAX_VALUE, -8388609, 470252243);
    assertBucketEquals("float", Float.MIN_VALUE, 1, 1206721797);
    assertBucketEquals("float", Float.POSITIVE_INFINITY, 2139095040, -292175804);
    assertBucketEquals("float", Float.NEGATIVE_INFINITY, -8388608, -1433270801);
    assertBucketEquals("float", Float.NaN, 2143289344, -480354314);
    // also a NaN
    assertBucketEquals("float", intBitsToFloat(0xffc00000), 2143289344, -480354314);
    // also a NaN
    assertBucketEquals("float", intBitsToFloat(0x7fc00000), 2143289344, -480354314);
    // also a NaN
    assertBucketEquals("float", intBitsToFloat(0x7fc01234), 2143289344, -480354314);
    // also a NaN
    assertBucketEquals("float", intBitsToFloat(0xffc01234), 2143289344, -480354314);
    assertBucketEquals("double", null, 0, 0);
    assertBucketEquals("double", 12.34, 986311098, -2070733568);
    assertBucketEquals("double", -Double.MAX_VALUE, 1048576, 14392725);
    assertBucketEquals("double", Double.MIN_VALUE, 1, -8838199);
    assertBucketEquals("double", Double.POSITIVE_INFINITY, 2146435072, 1614292060);
    assertBucketEquals("double", Double.NEGATIVE_INFINITY, -1048576, 141388605);
    assertBucketEquals("double", Double.NaN, 2146959360, 1138026565);
    // also a NaN
    assertBucketEquals("double", longBitsToDouble(0xfff8000000000000L), 2146959360, 1138026565);
    // also a NaN
    assertBucketEquals("double", longBitsToDouble(0x7ff8123412341234L), 2146959360, 1138026565);
    // also a NaN
    assertBucketEquals("double", longBitsToDouble(0xfff8123412341234L), 2146959360, 1138026565);
    assertBucketEquals("varchar(15)", null, 0, 0);
    assertBucketEquals("varchar(15)", "", 1, -965378730);
    assertBucketEquals("varchar(15)", "test string", -189841218, -138301454);
    // 3-byte UTF-8 sequences (in Basic Plane, i.e. Plane 0)
    assertBucketEquals("varchar(15)", "\u5f3a\u5927\u7684Trino\u5f15\u64ce", 1899852420, 1784416344);
    // 4 code points: 20FFC - 20FFF. 4-byte UTF-8 sequences in Supplementary Plane 2
    assertBucketEquals("varchar(15)", "\uD843\uDFFC\uD843\uDFFD\uD843\uDFFE\uD843\uDFFF", -457487557, -697348811);
    assertBucketEquals("string", null, 0, 0);
    assertBucketEquals("string", "", 0, -965378730);
    assertBucketEquals("string", "test string", -318923937, -138301454);
    // 3-byte UTF-8 sequences (in Basic Plane, i.e. Plane 0)
    assertBucketEquals("string", "\u5f3a\u5927\u7684Trino\u5f15\u64ce", 1688501507, 1784416344);
    // 4 code points: 20FFC - 20FFF. 4-byte UTF-8 sequences in Supplementary Plane 2
    assertBucketEquals("string", "\uD843\uDFFC\uD843\uDFFD\uD843\uDFFE\uD843\uDFFF", -1810797254, -697348811);
    assertBucketEquals("date", null, 0, 0);
    assertBucketEquals("date", Date.valueOf("1970-01-01"), 0, 1362653161);
    assertBucketEquals("date", Date.valueOf("2015-11-19"), 16758, 8542395);
    assertBucketEquals("date", Date.valueOf("1950-11-19"), -6983, -431619185);
    for (BucketingVersion version : BucketingVersion.values()) {
        List<TypeInfo> typeInfos = ImmutableList.of(timestampTypeInfo);
        assertThatThrownBy(() -> version.getBucketHashCode(typeInfos, new Object[] { 0 })).hasMessage("Computation of Hive bucket hashCode is not supported for Hive primitive category: TIMESTAMP");
        TimestampType timestampType = createTimestampType(3);
        BlockBuilder builder = timestampType.createBlockBuilder(null, 1);
        timestampType.writeLong(builder, 0);
        Page page = new Page(builder.build());
        assertThatThrownBy(() -> version.getBucketHashCode(typeInfos, page, 0)).hasMessage("Computation of Hive bucket hashCode is not supported for Hive primitive category: TIMESTAMP");
    }
    assertBucketEquals("array<double>", null, 0, 0);
    assertBucketEquals("array<boolean>", ImmutableList.of(), 0, 0);
    assertBucketEquals("array<smallint>", ImmutableList.of((short) 5, (short) 8, (short) 13), 5066, -905011156);
    assertBucketEquals("array<string>", ImmutableList.of("test1", "test2", "test3", "test4"), 957612994, 1305539282);
    assertBucketEquals("array<array<bigint>>", ImmutableList.of(ImmutableList.of(10L, 20L), ImmutableList.of(-10L, -20L), asList((Object) null)), 326368, 611324477);
    assertBucketEquals("map<float,date>", null, 0, 0);
    assertBucketEquals("map<double,timestamp>", ImmutableMap.of(), 0, 0);
    assertBucketEquals("map<string,bigint>", ImmutableMap.of("key", 123L, "key2", 123456789L, "key3", -123456L), 127880789, -1910999650);
    assertBucketEquals("map<array<double>,map<int,string>>", ImmutableMap.of(ImmutableList.of(12.3, 45.7), ImmutableMap.of(123, "test99")), -34001111, -1565874874);
    // multiple bucketing columns
    assertBucketEquals(ImmutableList.of("float", "array<smallint>", "map<string,bigint>"), ImmutableList.of(12.34F, ImmutableList.of((short) 5, (short) 8, (short) 13), ImmutableMap.of("key", 123L)), 95411006, 932898434);
    assertBucketEquals(ImmutableList.of("double", "array<smallint>", "boolean", "map<string,bigint>", "tinyint"), asList(null, ImmutableList.of((short) 5, (short) 8, (short) 13), null, ImmutableMap.of("key", 123L), null), 154207826, -1120812524);
}
Also used : BucketingVersion(io.trino.plugin.hive.util.HiveBucketing.BucketingVersion) TimestampType.createTimestampType(io.trino.spi.type.TimestampType.createTimestampType) TimestampType(io.trino.spi.type.TimestampType) Page(io.trino.spi.Page) TypeInfoFactory.timestampTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.timestampTypeInfo) TypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo) BlockBuilder(io.trino.spi.block.BlockBuilder) Test(org.testng.annotations.Test)

Example 20 with TimestampType

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

the class TypeCoercion method compatibility.

private TypeCompatibility compatibility(Type fromType, Type toType) {
    if (fromType.equals(toType)) {
        return TypeCompatibility.compatible(toType, true);
    }
    if (fromType.equals(UnknownType.UNKNOWN)) {
        return TypeCompatibility.compatible(toType, true);
    }
    if (toType.equals(UnknownType.UNKNOWN)) {
        return TypeCompatibility.compatible(fromType, false);
    }
    String fromTypeBaseName = fromType.getBaseName();
    String toTypeBaseName = toType.getBaseName();
    if (fromTypeBaseName.equals(toTypeBaseName)) {
        if (fromTypeBaseName.equals(StandardTypes.DECIMAL)) {
            Type commonSuperType = getCommonSuperTypeForDecimal((DecimalType) fromType, (DecimalType) toType);
            return TypeCompatibility.compatible(commonSuperType, commonSuperType.equals(toType));
        }
        if (fromTypeBaseName.equals(StandardTypes.VARCHAR)) {
            Type commonSuperType = getCommonSuperTypeForVarchar((VarcharType) fromType, (VarcharType) toType);
            return TypeCompatibility.compatible(commonSuperType, commonSuperType.equals(toType));
        }
        if (fromTypeBaseName.equals(StandardTypes.CHAR)) {
            Type commonSuperType = getCommonSuperTypeForChar((CharType) fromType, (CharType) toType);
            return TypeCompatibility.compatible(commonSuperType, commonSuperType.equals(toType));
        }
        if (fromTypeBaseName.equals(StandardTypes.ROW)) {
            return typeCompatibilityForRow((RowType) fromType, (RowType) toType);
        }
        if (fromTypeBaseName.equals(StandardTypes.TIMESTAMP)) {
            Type commonSuperType = createTimestampType(Math.max(((TimestampType) fromType).getPrecision(), ((TimestampType) toType).getPrecision()));
            return TypeCompatibility.compatible(commonSuperType, commonSuperType.equals(toType));
        }
        if (fromTypeBaseName.equals(StandardTypes.TIMESTAMP_WITH_TIME_ZONE)) {
            Type commonSuperType = createTimestampWithTimeZoneType(Math.max(((TimestampWithTimeZoneType) fromType).getPrecision(), ((TimestampWithTimeZoneType) toType).getPrecision()));
            return TypeCompatibility.compatible(commonSuperType, commonSuperType.equals(toType));
        }
        if (fromTypeBaseName.equals(StandardTypes.TIME)) {
            Type commonSuperType = createTimeType(Math.max(((TimeType) fromType).getPrecision(), ((TimeType) toType).getPrecision()));
            return TypeCompatibility.compatible(commonSuperType, commonSuperType.equals(toType));
        }
        if (fromTypeBaseName.equals(StandardTypes.TIME_WITH_TIME_ZONE)) {
            Type commonSuperType = createTimeWithTimeZoneType(Math.max(((TimeWithTimeZoneType) fromType).getPrecision(), ((TimeWithTimeZoneType) toType).getPrecision()));
            return TypeCompatibility.compatible(commonSuperType, commonSuperType.equals(toType));
        }
        if (isCovariantParametrizedType(fromType)) {
            return typeCompatibilityForCovariantParametrizedType(fromType, toType);
        }
        return TypeCompatibility.incompatible();
    }
    Optional<Type> coercedType = coerceTypeBase(fromType, toType.getBaseName());
    if (coercedType.isPresent()) {
        return compatibility(coercedType.get(), toType);
    }
    coercedType = coerceTypeBase(toType, fromType.getBaseName());
    if (coercedType.isPresent()) {
        TypeCompatibility typeCompatibility = compatibility(fromType, coercedType.get());
        if (!typeCompatibility.isCompatible()) {
            return TypeCompatibility.incompatible();
        }
        return TypeCompatibility.compatible(typeCompatibility.getCommonSuperType(), false);
    }
    return TypeCompatibility.incompatible();
}
Also used : TimeType(io.trino.spi.type.TimeType) Type(io.trino.spi.type.Type) VarcharType.createUnboundedVarcharType(io.trino.spi.type.VarcharType.createUnboundedVarcharType) TimeWithTimeZoneType.createTimeWithTimeZoneType(io.trino.spi.type.TimeWithTimeZoneType.createTimeWithTimeZoneType) TimeType.createTimeType(io.trino.spi.type.TimeType.createTimeType) TimestampType(io.trino.spi.type.TimestampType) CharType.createCharType(io.trino.spi.type.CharType.createCharType) VarcharType(io.trino.spi.type.VarcharType) TimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType) TimestampType.createTimestampType(io.trino.spi.type.TimestampType.createTimestampType) SetDigestType(io.trino.type.setdigest.SetDigestType) RowType(io.trino.spi.type.RowType) DecimalType.createDecimalType(io.trino.spi.type.DecimalType.createDecimalType) MapType(io.trino.spi.type.MapType) ArrayType(io.trino.spi.type.ArrayType) TimestampWithTimeZoneType.createTimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType.createTimestampWithTimeZoneType) CharType(io.trino.spi.type.CharType) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) DecimalType(io.trino.spi.type.DecimalType) TimeWithTimeZoneType(io.trino.spi.type.TimeWithTimeZoneType) TimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType) TimestampWithTimeZoneType.createTimestampWithTimeZoneType(io.trino.spi.type.TimestampWithTimeZoneType.createTimestampWithTimeZoneType) TimestampType(io.trino.spi.type.TimestampType) TimestampType.createTimestampType(io.trino.spi.type.TimestampType.createTimestampType) TimeWithTimeZoneType.createTimeWithTimeZoneType(io.trino.spi.type.TimeWithTimeZoneType.createTimeWithTimeZoneType) TimeWithTimeZoneType(io.trino.spi.type.TimeWithTimeZoneType) TimeType(io.trino.spi.type.TimeType) TimeType.createTimeType(io.trino.spi.type.TimeType.createTimeType)

Aggregations

TimestampType (io.trino.spi.type.TimestampType)32 DecimalType (io.trino.spi.type.DecimalType)24 VarcharType (io.trino.spi.type.VarcharType)24 CharType (io.trino.spi.type.CharType)23 TrinoException (io.trino.spi.TrinoException)16 TimeType (io.trino.spi.type.TimeType)14 Type (io.trino.spi.type.Type)14 TimestampType.createTimestampType (io.trino.spi.type.TimestampType.createTimestampType)12 DecimalType.createDecimalType (io.trino.spi.type.DecimalType.createDecimalType)10 TimestampWithTimeZoneType (io.trino.spi.type.TimestampWithTimeZoneType)10 ArrayType (io.trino.spi.type.ArrayType)8 List (java.util.List)8 ImmutableList (com.google.common.collect.ImmutableList)7 BIGINT (io.trino.spi.type.BigintType.BIGINT)6 BOOLEAN (io.trino.spi.type.BooleanType.BOOLEAN)6 DATE (io.trino.spi.type.DateType.DATE)6 DOUBLE (io.trino.spi.type.DoubleType.DOUBLE)6 INTEGER (io.trino.spi.type.IntegerType.INTEGER)6 REAL (io.trino.spi.type.RealType.REAL)6 SMALLINT (io.trino.spi.type.SmallintType.SMALLINT)6