Skip to content

Add support for TIMESTAMP and TIMESTAMP WITH TIME ZONE types in Exasol connector #26259

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

skyglass
Copy link
Member

Description

Added Exasol Trino connector support for Timestamp and Timestamp With Local Time Zone JDBC data types

Additional context and related issues

  • added correspondent tests for timestamp with precision data type
  • added correspondent tests for timestamp with local time zone with precision data type
  • implemented special addRoundTrip method with additional column expression parameter for the predicate to fix the test predicate assumption
  • all timestamp with timezone tests use input literal timestamp string, which is interpreted as a JVM timestamp string ("America/Bahia_Banderas") but expected literal strings are interpreted as UTC strings. Therefore the difference between these timestamps is 6 hours (with DST) or 5 (without DST); for some historical values, like 1970 for example, the difference can be 7, which is expected behaviour for timestamp with local time zone

Release notes

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

Copy link

cla-bot bot commented Jul 22, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@github-actions github-actions bot added the exasol Exasol connector label Jul 22, 2025
Copy link

cla-bot bot commented Jul 22, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from 37a2fe5 to 78d1495 Compare July 22, 2025 10:03
Copy link

cla-bot bot commented Jul 22, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass changed the title Add support for TIMESTAMP and TIMESTAMP WITH TIME ZONE types in Exasol connector [Closed Duplicate] Add support for TIMESTAMP and TIMESTAMP WITH TIME ZONE types in Exasol connector Jul 22, 2025
@skyglass skyglass changed the title [Closed Duplicate] Add support for TIMESTAMP and TIMESTAMP WITH TIME ZONE types in Exasol connector Add support for TIMESTAMP and TIMESTAMP WITH TIME ZONE types in Exasol connector Jul 22, 2025
@dekimir dekimir mentioned this pull request Jul 22, 2025
Copy link

cla-bot bot commented Jul 22, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from c950205 to d7ff56f Compare July 23, 2025 08:59
Copy link

cla-bot bot commented Jul 23, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

1 similar comment
Copy link

cla-bot bot commented Jul 23, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@github-actions github-actions bot added the docs label Jul 23, 2025
@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from ef6b95a to 07a421f Compare July 23, 2025 14:12
Copy link

cla-bot bot commented Jul 23, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from 07a421f to 0d4b20a Compare July 24, 2025 12:14
Copy link

cla-bot bot commented Jul 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from 0d4b20a to bd554f9 Compare July 24, 2025 12:16
Copy link

cla-bot bot commented Jul 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from bd554f9 to 4ff3087 Compare July 24, 2025 14:52
Copy link

cla-bot bot commented Jul 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

3 similar comments
Copy link

cla-bot bot commented Jul 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Jul 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Jul 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from 2a722d5 to 2c0b293 Compare July 24, 2025 15:05
Copy link

cla-bot bot commented Jul 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from 2c0b293 to cb525e5 Compare July 25, 2025 08:41
Copy link

cla-bot bot commented Jul 25, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from cb525e5 to b5ca512 Compare July 25, 2025 09:36
Copy link

cla-bot bot commented Jul 25, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from b5ca512 to 14ff13d Compare July 25, 2025 18:31
@cla-bot cla-bot bot added the cla-signed label Jul 25, 2025
throws SQLException
{
LocalDateTime localDateTime = fromTrinoTimestamp(epochMicros);
Timestamp timestampValue = Timestamp.valueOf(localDateTime);
long epochMillis = unpackMillisUtc(dateTimeWithTimeZone);
Copy link
Member Author

Choose a reason for hiding this comment

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

During final debugging it was discovered that longTimestampWithTimeZoneWriteFunction is never called. Therefore, I had to fix the tests, which fixed the calling of longTimestampWithTimeZoneWriteFunction.
After fixing the test, the bug with longTimestampWithTimeZoneWriteFunction has been discovered and fixed.

I have created additional commit, but will squash it into the main commit after the review.

.addRoundTrip("timestamp(3) with local time zone", "TIMESTAMP '2018-10-28 01:33:17.456'", createTimestampWithTimeZoneType(3), "TIMESTAMP '2018-10-28 07:33:17.456 UTC'")
.addRoundTrip("timestamp(3) with local time zone", "TIMESTAMP '2018-10-28 03:33:33.333'", createTimestampWithTimeZoneType(3), "TIMESTAMP '2018-10-28 09:33:33.333 UTC'")
.addRoundTrip("timestamp(3) with local time zone", "TIMESTAMP '1970-01-01 00:13:42.000'", createTimestampWithTimeZoneType(3), "TIMESTAMP '1970-01-01 07:13:42.000 UTC'")
//'2018-04-01 02:13:55.123' is a DST gap time, which doesn't "exist" in the session time zone
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 issue with "DST gap time" has been discovered by the fixed test, which might point to the incorrect conversion in exasol core db server, or it might be the issue with the testing framework. The test is disabled until further research.

Copy link
Member Author

@skyglass skyglass Jul 29, 2025

Choose a reason for hiding this comment

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

In practice, the dst gap times should not happen, unless the timestamp is invalid, so this test case is not relevant and can be safely ignored

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch 2 times, most recently from 54b2f89 to 41f8576 Compare July 29, 2025 18:36
}

@Override
public void set(PreparedStatement statement, int index, long dateTimeWithTimeZone)
Copy link
Member Author

Choose a reason for hiding this comment

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

Any updates on the review?
I kept the separate commit to explain the latest changes and the bug, which was revealed by tests and fixed in this commit. I will combine this commit with the main one, as soon as you confirm the last changes.

@skyglass skyglass force-pushed the feature/724_timestamp_data_types branch from 41f8576 to 7ad796f Compare July 30, 2025 13:53
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