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

Timezone not supported +DDDD #4490

Closed
janevelger opened this issue Jul 19, 2020 · 3 comments · Fixed by #4506
Closed

Timezone not supported +DDDD #4490

janevelger opened this issue Jul 19, 2020 · 3 comments · Fixed by #4506
Labels
bug Something isn't working
Milestone

Comments

@janevelger
Copy link

janevelger commented Jul 19, 2020

Hello, starting from 338 version (it works on 335) we are getting the following error on the query:

select timestamp '2019-01-05 23:59:59.999 +0000';

Error: Timezone not supported +0000
But when changing the query to : select timestamp '2019-01-05 23:59:59.999 +00:00';
it works.

@findepi findepi changed the title Timezone not supported +0000 Timezone not supported +DDDD Jul 19, 2020
@findepi
Copy link
Member

findepi commented Jul 19, 2020

I am confirming this is a behavior change introduced in 62cf151 (Presto 337).

@findepi findepi added the bug Something isn't working label Jul 19, 2020
@martint
Copy link
Member

martint commented Jul 20, 2020

Query 20200720_201203_00009_qgcxc failed: line 1:8: Time zone not supported: +0000
io.prestosql.spi.PrestoException: line 1:8: Time zone not supported: +0000
	at io.prestosql.sql.analyzer.ExpressionAnalyzer$Visitor.visitTimestampLiteral(ExpressionAnalyzer.java:885)
	at io.prestosql.sql.analyzer.ExpressionAnalyzer$Visitor.visitTimestampLiteral(ExpressionAnalyzer.java:340)
	at io.prestosql.sql.tree.TimestampLiteral.accept(TimestampLiteral.java:52)
	at io.prestosql.sql.tree.StackableAstVisitor.process(StackableAstVisitor.java:27)
	at io.prestosql.sql.analyzer.ExpressionAnalyzer$Visitor.process(ExpressionAnalyzer.java:363)
	at io.prestosql.sql.analyzer.ExpressionAnalyzer.analyze(ExpressionAnalyzer.java:301)
	at io.prestosql.sql.analyzer.ExpressionAnalyzer.analyzeExpression(ExpressionAnalyzer.java:1693)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.analyzeExpression(StatementAnalyzer.java:2361)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.analyzeSelectSingleColumn(StatementAnalyzer.java:2201)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.analyzeSelect(StatementAnalyzer.java:2025)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:1285)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:303)
	at io.prestosql.sql.tree.QuerySpecification.accept(QuerySpecification.java:144)
	at io.prestosql.sql.tree.AstVisitor.process(AstVisitor.java:27)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:320)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:330)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:915)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:303)
	at io.prestosql.sql.tree.Query.accept(Query.java:107)
	at io.prestosql.sql.tree.AstVisitor.process(AstVisitor.java:27)
	at io.prestosql.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:320)
	at io.prestosql.sql.analyzer.StatementAnalyzer.analyze(StatementAnalyzer.java:289)
	at io.prestosql.sql.analyzer.Analyzer.analyze(Analyzer.java:83)
	at io.prestosql.sql.analyzer.Analyzer.analyze(Analyzer.java:75)
	at io.prestosql.execution.SqlQueryExecution.analyze(SqlQueryExecution.java:246)
	at io.prestosql.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:180)
	at io.prestosql.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:746)
	at io.prestosql.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:121)
	at io.prestosql.$gen.Presto_unknown____20200720_183506_2.call(Unknown Source)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: io.prestosql.spi.type.TimeZoneNotSupportedException: Time zone not supported: +0000
	at io.prestosql.spi.type.TimeZoneKey.getTimeZoneKey(TimeZoneKey.java:133)
	at io.prestosql.spi.type.DateTimeEncoding.packDateTimeWithZone(DateTimeEncoding.java:38)
	at io.prestosql.type.Timestamps.parseShortTimestampWithTimeZone(Timestamps.java:441)
	at io.prestosql.type.Timestamps.parseTimestampWithTimeZone(Timestamps.java:340)
	at io.prestosql.sql.analyzer.ExpressionAnalyzer$Visitor.visitTimestampLiteral(ExpressionAnalyzer.java:871)
	... 34 more

@martint
Copy link
Member

martint commented Jul 20, 2020

This looks like a latent bug in TimeZoneKey.getTimeZoneKey the became visible once we got rid of Joda for parsing timestamps. That method attempts to do some normalization, but doesn't handle that pattern properly. My guess is Joda was normalizing that form so the downstream code never saw that pattern.

Java ZoneId understands that form alright, too.

@martint martint mentioned this issue Jul 21, 2020
8 tasks
@martint martint added this to the 339 milestone Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants