Skip to content

Conversation

skyglass
Copy link
Member

@skyglass skyglass commented Sep 14, 2025

Description

Improved version of the previous PR: #26259
Added Exasol Trino connector support for Timestamp and Timestamp With Local Time Zone JDBC data types

Additional context and related issues

  • Exasol TIMESTAMP type is mapped to Trino TIMESTAMP type
  • Exasol TIMESTAMP WITH LOCAL TIME ZONE type is mapped to Trino TIMESTAMP type
  • added correspondent tests for timestamp with precision data type
  • added correspondent tests for timestamp with local time zone with precision data type
  • added tests for DST gap and DST overlap times in "America/Bahia_Bandera" JVM time zone

Release notes

## Exasol Connect
* Add support for `timestamp` and `timestamp with local time zone` types. 

@cla-bot cla-bot bot added the cla-signed label Sep 14, 2025
@github-actions github-actions bot added docs exasol Exasol connector labels Sep 14, 2025
@skyglass skyglass force-pushed the feature/724_timestamp_data_types_more_simple branch 5 times, most recently from 17207a2 to fbab6f8 Compare September 14, 2025 19:23
@skyglass skyglass changed the title Add support for TIMESTAMP types in Exasol connector (improved) [Improved] Add support for TIMESTAMP types in Exasol connector Sep 14, 2025
Copy link
Member Author

@skyglass skyglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improved PR, with more simple and less error-prone solution.
The previous PR is moved to DRAFT, please discard it: #26259

Please, review the new PR, @ebyhr , @chenjian2664 ! 🙏

After reviewing the previous implementation, I believe the previous approach - mapping Exasol TIMESTAMP WITH LOCAL TIME ZONE to Trino TIMESTAMP WITH TIME ZONE - adds unnecessary complexity and potential pitfalls.

Exasol TIMESTAMP WITH LOCAL TIME ZONE does not actually persist any time zone information. Apart from some minor edge cases, its semantics is very close to a plain Exasol TIMESTAMP.

Mapping to Trino TIMESTAMP WITH TIME ZONE requires hardcoding the JVM time zone, which introduces fragility. For example, values valid in the Exasol DB time zone but invalid in the JVM time zone (e.g., during DST gaps) may cause Trino to throw exceptions, potentially breaking queries.

A simpler mapping to Trino TIMESTAMP avoids these problems, is more efficient, and aligns better with how Exasol handles this type internally.

Given this, I created a new PR proposing the TIMESTAMP WITH LOCAL TIME ZONE → TIMESTAMP mapping, which I believe will result in a cleaner, simpler and more reliable solution.

@skyglass skyglass force-pushed the feature/724_timestamp_data_types_more_simple branch from fbab6f8 to f28a06f Compare September 15, 2025 07:53
@skyglass skyglass force-pushed the feature/724_timestamp_data_types_more_simple branch from f28a06f to 8f6e43c Compare September 15, 2025 19:32
@ebyhr ebyhr changed the title [Improved] Add support for TIMESTAMP types in Exasol connector Add support for TIMESTAMP types in Exasol connector Sep 16, 2025
@skyglass skyglass force-pushed the feature/724_timestamp_data_types_more_simple branch from 8f6e43c to e0bd02e Compare September 16, 2025 23:58
Copy link
Member Author

@skyglass skyglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your review, @ebyhr ! 👍

The changes have been applied.

@skyglass skyglass requested a review from ebyhr September 17, 2025 00:00
@skyglass skyglass force-pushed the feature/724_timestamp_data_types_more_simple branch from e0bd02e to 8c9bdc7 Compare September 17, 2025 00:06
Copy link

github-actions bot commented Oct 8, 2025

This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack.

@github-actions github-actions bot added the stale label Oct 8, 2025
return Optional.of(dateColumnMapping());
case Types.TIMESTAMP:
case EXASOL_TIMESTAMP_WITH_TIMEZONE:
return Optional.of(timestampColumnMapping(typeHandle));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The https://docs.exasol.com/db/latest/sql_references/data_types/datatypedetails.htm#Dateandtimedatatypes shows that timestamp with local time zone type actually has timezone concept, but just store as UTC.

How about support only TIMESTAMP type first in this single pr?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The https://docs.exasol.com/db/latest/sql_references/data_types/datatypedetails.htm#Dateandtimedatatypes shows that timestamp with local time zone type actually has timezone concept, but just store as UTC.

Yes, it has some differences in the time zone behavior, than usual TIMESTAMP, which are reflected in the tests, but when we get the actual column value with trino connector reader we don't know, in which time zone it was saved. So if we map to Trino "Timestamp With Time Zone" we must provide some time zone, which could be hardcoded UTC or JVM Time Zone. But this approach is more fragile and in some extreme cases like DLT, could even provide incorrect mapping. So the solution of mapping to Trino Timestamp is more simple and less error-prone.

How about support only TIMESTAMP type first in this single pr?

The implementations are actually very similar and the second PR would be a change of just two lines of code in the main source and one line in documentation (the tests are also very similar for each type).
This is due to a more simple solution, which maps to Trino Timestamp for both Exasol Types.

Copy link
Member Author

@skyglass skyglass Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your review, @chenjian2664 👍

The new PR, which contains only TIMESTAMP changes, has been created:
#26963

I will close this PR

@github-actions github-actions bot removed the stale label Oct 13, 2025
@skyglass skyglass changed the title Add support for TIMESTAMP types in Exasol connector [DRAFT] Add support for TIMESTAMP types in Exasol connector Oct 15, 2025
@skyglass skyglass marked this pull request as draft October 15, 2025 09:24
@skyglass
Copy link
Member Author

skyglass commented Oct 15, 2025

Closed as Draft.
The new PR, which contains only TIMESTAMP changes has been created
#26963

@skyglass skyglass closed this Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants