Skip to content
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

Iceberg timestamptz should map to Presto TIMESTAMP WITH TIME ZONE type #23529

Open
tdcmeehan opened this issue Aug 27, 2024 · 1 comment · May be fixed by #23534
Open

Iceberg timestamptz should map to Presto TIMESTAMP WITH TIME ZONE type #23529

tdcmeehan opened this issue Aug 27, 2024 · 1 comment · May be fixed by #23534
Assignees
Labels
bug iceberg Apache Iceberg related

Comments

@tdcmeehan
Copy link
Contributor

Your Environment

  • Presto version used: Any
  • Storage (HDFS/S3/GCS..): NA
  • Data source and connector used: Iceberg
  • Deployment (Cloud or On-prem): NA
  • Pastebin link to the complete debug logs:

Expected Behavior

Currently, the Presto Iceberg connector does not differentiate between timestamp and timestamptz, mapping both to TIMESTAMP. This is incorrect, especially when deprecated.legacy-timestamp is set to false, because timestamptz represents a point in time value, whereas Presto's TIMESTAMP represents a timestamp that is not a point in time.

Current Behavior

All Iceberg timestamp and timestamptzs are being mapped to TIMESTAMP

Possible Solution

Improve the type mapping to use TIMESTAMP WITH TIME ZONE

Steps to Reproduce

Screenshots (if appropriate)

Context

@auden-woolfson
Copy link
Contributor

I think updating the timestamp case in TypeConverter toPrestoType to...

  case TIMESTAMP:
      Types.TimestampType timestampType = (Types.TimestampType) type.asPrimitiveType();
      if (timestampType.shouldAdjustToUTC()) {
          return TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE;
      }
      return TimestampType.TIMESTAMP;

should fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug iceberg Apache Iceberg related
Projects
Status: 🆕 Unprioritized
Status: 🆕 Unprioritized
2 participants