Skip to content

Commit

Permalink
Remove unused method from PostgreSqlClient
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Sep 14, 2024
1 parent 2a11039 commit fc3ef8a
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
import io.trino.spi.type.CharType;
import io.trino.spi.type.DecimalType;
import io.trino.spi.type.Decimals;
import io.trino.spi.type.LongTimestamp;
import io.trino.spi.type.LongTimestampWithTimeZone;
import io.trino.spi.type.MapType;
import io.trino.spi.type.StandardTypes;
Expand Down Expand Up @@ -220,7 +219,6 @@
import static io.trino.spi.type.Timestamps.NANOSECONDS_PER_DAY;
import static io.trino.spi.type.Timestamps.NANOSECONDS_PER_MILLISECOND;
import static io.trino.spi.type.Timestamps.PICOSECONDS_PER_DAY;
import static io.trino.spi.type.Timestamps.PICOSECONDS_PER_MICROSECOND;
import static io.trino.spi.type.Timestamps.PICOSECONDS_PER_NANOSECOND;
import static io.trino.spi.type.Timestamps.round;
import static io.trino.spi.type.TinyintType.TINYINT;
Expand Down Expand Up @@ -1271,21 +1269,6 @@ private static void shortTimestampWriteFunction(PreparedStatement statement, int
statement.setObject(index, toPgTimestamp(localDateTime));
}

private static ObjectWriteFunction longTimestampWriteFunction()
{
return ObjectWriteFunction.of(LongTimestamp.class, (statement, index, timestamp) -> {
// PostgreSQL supports up to 6 digits of precision
//noinspection ConstantConditions
verify(POSTGRESQL_MAX_SUPPORTED_TIMESTAMP_PRECISION == 6);

long epochMicros = timestamp.getEpochMicros();
if (timestamp.getPicosOfMicro() >= PICOSECONDS_PER_MICROSECOND / 2) {
epochMicros++;
}
shortTimestampWriteFunction(statement, index, epochMicros);
});
}

@Override
public void setColumnComment(ConnectorSession session, JdbcTableHandle handle, JdbcColumnHandle column, Optional<String> comment)
{
Expand Down

0 comments on commit fc3ef8a

Please sign in to comment.