-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partitioned table tests and fixed #9757
Partitioned table tests and fixed #9757
Conversation
5c41002
to
0664901
Compare
" 'a_short_decimal', " + | ||
" 'a_long_decimal', " + | ||
" 'a_varchar', " + | ||
// " 'a_varbinary', " + TODO (https://github.com/trinodb/trino/issues/9755) this yields incorrect query results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when those are fixed it would be (maybe) nice to merge testCreatePartitionedTable
and testAllAvailableTypes
and just paramtrize with boolean partitioned
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, maybe. the assertions will be different...
and since we already cover all iceberg types except "fixed", it won't add much more value
plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java
Outdated
Show resolved
Hide resolved
4c33ce5
to
93f35a7
Compare
@@ -76,7 +75,7 @@ public static Object convertIcebergValueToTrino(Type icebergType, Object value) | |||
if (icebergType instanceof Types.TimestampType) { | |||
long epochMicros = (long) value; | |||
if (((Types.TimestampType) icebergType).shouldAdjustToUTC()) { | |||
return timestampTzFromMicros(epochMicros, TimeZoneKey.UTC_KEY); | |||
return timestampTzFromMicros(epochMicros); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does shouldAdjustToUTC
mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it means "this is timestamptz
, not timestamp
type".
seems the two are conflated into Types.TimestampType
class
58de93f
to
d43ec65
Compare
Since it's reused, it doesn't belong to `PartitionTable`. This also sorts the cases in the method.
* merge `testPartitionedTableWithNullValues` into `testCreatePartitionedTable`. This not only reduces test verbosity, but also improves coverage for predicate application. * synchronize `testAllAvailableTypes` and `testCreatePartitionedTable` -- use consistent column naming, use consistent style for SQL, use consistent test structure * cover all supported types in these tests * exercise time/timestamp microsecond precision
This also adds test coverage for `SHOW STATS` and `$partitions` for all types in Iceberg.
Do not assume that unrecognized type has same Iceberg and Trino representation, under all circumstances.
Before the change, partition key of `timestamp with time zone` type was returned in session zone, unlike regular data columns. This caused representability problems for values within session zone's DST change backwards. This commit makes partition values to be returned with UTC zone, just like regular data columns are.
d43ec65
to
73e214b
Compare
previous CI run -- #8432 |
Includes
Convert from Iceberg to Trino representation strictly
Fills outstanding TODO in
PartitionedTable.convert
(method moved)Fix handling of Iceberg timestamptz partition key
Before the change, partition key of
timestamp with time zone
type wasreturned in session zone, unlike regular data columns. This caused
representability problems for values within session zone's DST change
backwards. This commit makes partition values to be returned with UTC
zone, just like regular data columns are.
Fixes #9704
Fixes #9703