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

Fix timestamp mapping in Elasticsearch for non-legacy timestamp #3742

Closed
findepi opened this issue May 15, 2020 · 1 comment · Fixed by #4799
Closed

Fix timestamp mapping in Elasticsearch for non-legacy timestamp #3742

findepi opened this issue May 15, 2020 · 1 comment · Fixed by #4799
Assignees

Comments

@findepi
Copy link
Member

findepi commented May 15, 2020

https://github.com/prestosql/presto/blob/13a3c523f2739a2373c251697f6826daaf193266/presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/decoders/TimestampDecoder.java#L82

should use UTC for non-legacy timestamp semantics.

Relates to #3741

@combineads
Copy link

I use Phoenix and Elasticsearch connector, but there is a difference in the value of the timestamp column. Until the TIMESTAMP behavior of presto is decided, I try to solve this problem with the following code. Thank you for your efforts.

            if (value instanceof String) {
                timestamp = LocalDateTime.from(Instant.from(ISO_DATE_TIME.parse((String) value)).atZone(zoneId));
            }
            else if (value instanceof Number) {
                timestamp = LocalDateTime.ofInstant(Instant.ofEpochMilli(((Number) value).longValue()), zoneId);
            }

@dain dain self-assigned this Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants