Package io.trino.plugin.jdbc
Class StandardColumnMappings
java.lang.Object
io.trino.plugin.jdbc.StandardColumnMappings
-
Method Summary
Modifier and TypeMethodDescriptionstatic ColumnMappingstatic LongWriteFunctionstatic ColumnMappingstatic BooleanWriteFunctionstatic ColumnMappingcharColumnMapping(CharType charType, boolean isRemoteCaseSensitive) static SliceReadFunctioncharReadFunction(CharType charType) static SliceWriteFunctionstatic ColumnMappingstatic ColumnMappingDeprecated.This method leads to incorrect result when the date value is before 1582 Oct 14.static LongReadFunctionstatic LongReadFunctionDeprecated.If driver supportsLocalDate, usedateReadFunctionUsingLocalDate()instead.static LongWriteFunctionstatic LongWriteFunctionDeprecated.If driver supportsLocalDate, usedateWriteFunctionUsingLocalDate()instead.static ColumnMappingdecimalColumnMapping(DecimalType decimalType) static ColumnMappingdecimalColumnMapping(DecimalType decimalType, RoundingMode roundingMode) static ColumnMappingdefaultCharColumnMapping(int columnSize, boolean isRemoteCaseSensitive) static ColumnMappingdefaultVarcharColumnMapping(int columnSize, boolean isRemoteCaseSensitive) static ColumnMappingstatic DoubleWriteFunctionstatic LocalDateTimefromLongTrinoTimestamp(LongTimestamp timestamp, int precision) static LocalTimefromTrinoTime(long value) static LocalDateTimefromTrinoTimestamp(long epochMicros) static ColumnMappingstatic LongWriteFunctionstatic ObjectReadFunctionlongDecimalReadFunction(DecimalType decimalType) static ObjectReadFunctionlongDecimalReadFunction(DecimalType decimalType, RoundingMode roundingMode) static ObjectWriteFunctionlongDecimalWriteFunction(DecimalType decimalType) static ObjectReadFunctionlongTimestampReadFunction(TimestampType timestampType) static ObjectWriteFunctionlongTimestampWriteFunction(TimestampType timestampType, int roundToPrecision) static ColumnMappingstatic LongWriteFunctionstatic LongReadFunctionshortDecimalReadFunction(DecimalType decimalType) static LongReadFunctionshortDecimalReadFunction(DecimalType decimalType, RoundingMode roundingMode) static LongWriteFunctionshortDecimalWriteFunction(DecimalType decimalType) static ColumnMappingstatic LongWriteFunctionstatic ColumnMappingtimeColumnMapping(TimeType timeType) static ColumnMappingDeprecated.This method usesTimeand the class cannot represent time value when JVM zone had forward offset change (a 'gap') at given time on 1970-01-01.static LongReadFunctiontimeReadFunction(TimeType timeType) static ColumnMappingtimestampColumnMapping(TimestampType timestampType) static ColumnMappingtimestampColumnMappingUsingSqlTimestampWithRounding(TimestampType timestampType) Deprecated.This method usesTimestampand the class cannot represent date-time value when JVM zone had forward offset change (a 'gap').static LongReadFunctiontimestampReadFunction(TimestampType timestampType) static LongWriteFunctiontimestampWriteFunction(TimestampType timestampType) static LongWriteFunctiontimestampWriteFunctionUsingSqlTimestamp(TimestampType timestampType) Deprecated.This method usesTimestampand the class cannot represent date-time value when JVM zone had forward offset change (a 'gap').static LongWriteFunctiontimeWriteFunction(int precision) static LongWriteFunctionDeprecated.This method usesTimeand the class cannot represent time value when JVM zone had forward offset change (a 'gap') at given time on 1970-01-01.static ColumnMappingstatic LongWriteFunctionstatic LongTimestamptoLongTrinoTimestamp(TimestampType timestampType, LocalDateTime localDateTime) static longtoTrinoTimestamp(TimestampType timestampType, LocalDateTime localDateTime) static ColumnMappingstatic SliceReadFunctionstatic SliceWriteFunctionstatic ColumnMappingvarcharColumnMapping(VarcharType varcharType, boolean isRemoteCaseSensitive) static SliceReadFunctionvarcharReadFunction(VarcharType varcharType) static SliceWriteFunction
-
Method Details
-
booleanColumnMapping
-
booleanWriteFunction
-
tinyintColumnMapping
-
tinyintWriteFunction
-
smallintColumnMapping
-
smallintWriteFunction
-
integerColumnMapping
-
integerWriteFunction
-
bigintColumnMapping
-
bigintWriteFunction
-
realColumnMapping
-
realWriteFunction
-
doubleColumnMapping
-
doubleWriteFunction
-
decimalColumnMapping
-
decimalColumnMapping
public static ColumnMapping decimalColumnMapping(DecimalType decimalType, RoundingMode roundingMode) -
shortDecimalReadFunction
-
shortDecimalReadFunction
public static LongReadFunction shortDecimalReadFunction(DecimalType decimalType, RoundingMode roundingMode) -
shortDecimalWriteFunction
-
longDecimalReadFunction
-
longDecimalReadFunction
public static ObjectReadFunction longDecimalReadFunction(DecimalType decimalType, RoundingMode roundingMode) -
longDecimalWriteFunction
-
defaultCharColumnMapping
-
charColumnMapping
-
charReadFunction
-
charWriteFunction
-
defaultVarcharColumnMapping
public static ColumnMapping defaultVarcharColumnMapping(int columnSize, boolean isRemoteCaseSensitive) -
varcharColumnMapping
public static ColumnMapping varcharColumnMapping(VarcharType varcharType, boolean isRemoteCaseSensitive) -
varcharReadFunction
-
varcharWriteFunction
-
varbinaryColumnMapping
-
varbinaryReadFunction
-
varbinaryWriteFunction
-
dateColumnMappingUsingSqlDate
Deprecated.This method leads to incorrect result when the date value is before 1582 Oct 14. If driver supportsLocalDate, usedateColumnMappingUsingLocalDate()instead. -
dateReadFunctionUsingSqlDate
Deprecated.If driver supportsLocalDate, usedateReadFunctionUsingLocalDate()instead. -
dateWriteFunctionUsingSqlDate
Deprecated.If driver supportsLocalDate, usedateWriteFunctionUsingLocalDate()instead. -
dateColumnMappingUsingLocalDate
-
dateReadFunctionUsingLocalDate
-
dateWriteFunctionUsingLocalDate
-
timeColumnMappingUsingSqlTime
Deprecated.This method usesTimeand the class cannot represent time value when JVM zone had forward offset change (a 'gap') at given time on 1970-01-01. If driver only supportsLocalTime, usetimeColumnMapping(io.trino.spi.type.TimeType)instead. -
timeWriteFunctionUsingSqlTime
Deprecated.This method usesTimeand the class cannot represent time value when JVM zone had forward offset change (a 'gap') at given time on 1970-01-01. If driver only supportsLocalTime, usetimeWriteFunction(int)instead. -
timeColumnMapping
-
timeReadFunction
-
timeWriteFunction
-
timestampColumnMappingUsingSqlTimestampWithRounding
@Deprecated public static ColumnMapping timestampColumnMappingUsingSqlTimestampWithRounding(TimestampType timestampType) Deprecated.This method usesTimestampand the class cannot represent date-time value when JVM zone had forward offset change (a 'gap'). This includes regular DST changes (e.g. Europe/Warsaw) and one-time policy changes (Asia/Kathmandu's shift by 15 minutes on January 1, 1986, 00:00:00). This mapping also disables pushdown by default to ensure correctness because rounding happens within Trino and won't apply to remote system. If driver supportsLocalDateTime, usetimestampColumnMapping(io.trino.spi.type.TimestampType)instead. -
timestampColumnMapping
-
timestampReadFunction
-
longTimestampReadFunction
-
timestampWriteFunctionUsingSqlTimestamp
@Deprecated public static LongWriteFunction timestampWriteFunctionUsingSqlTimestamp(TimestampType timestampType) Deprecated.This method usesTimestampand the class cannot represent date-time value when JVM zone had forward offset change (a 'gap'). This includes regular DST changes (e.g. Europe/Warsaw) and one-time policy changes (Asia/Kathmandu's shift by 15 minutes on January 1, 1986, 00:00:00). If driver only supportsLocalDateTime, usetimestampWriteFunction(io.trino.spi.type.TimestampType)instead. -
timestampWriteFunction
-
longTimestampWriteFunction
public static ObjectWriteFunction longTimestampWriteFunction(TimestampType timestampType, int roundToPrecision) -
toTrinoTimestamp
-
toLongTrinoTimestamp
public static LongTimestamp toLongTrinoTimestamp(TimestampType timestampType, LocalDateTime localDateTime) -
fromTrinoTimestamp
-
fromLongTrinoTimestamp
-
fromTrinoTime
-