Open qianmoQ opened 4 years ago
Per @laurachenyu 's https://github.com/prestosql/presto/issues/5669#issuecomment-715571382
view containing current_timestamp
is not supported yet either.
We are looking into this. Fix is underway (currently reviewing internal patch).
Any progress on this one yet, @wmoustafa?
We are planning to check it in this week. cc: @kxu1026
Did this ever get checked in, @wmoustafa?
The patch is here https://github.com/linkedin/coral/pull/41. Sorry for the delay, but a few priorities came up. The patch should be checked in very soon as we reviewed internally.
Is there an ETA on this?
I'm checking this locally. Hive view having current_date
returns result without any error, but current_timestamp
throws below exception.
trino> select * from hive.default.current_timestamp_hive_view;
Query 20210429_030756_00001_rhtgq failed: line 1:15: View 'hive.default.current_timestamp_hive_view' is stale or in invalid state: column [cd] of type timestamp(3) with time zone projected from query view at position 0 cannot be coerced to column [cd] of type timestamp(3) stored in view definition
io.trino.spi.TrinoException: line 1:15: View 'hive.default.current_timestamp_hive_view' is stale or in invalid state: column [cd] of type timestamp(3) with time zone projected from query view at position 0 cannot be coerced to column [cd] of type timestamp(3) stored in view definition
at io.trino.sql.analyzer.SemanticExceptions.semanticException(SemanticExceptions.java:48)
at io.trino.sql.analyzer.SemanticExceptions.semanticException(SemanticExceptions.java:43)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.lambda$createScopeForView$21(StatementAnalyzer.java:1534)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.createScopeForView(StatementAnalyzer.java:1534)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.createScopeForView(StatementAnalyzer.java:1495)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:1304)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:366)
at io.trino.sql.tree.Table.accept(Table.java:53)
at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:383)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.analyzeFrom(StatementAnalyzer.java:3157)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:1952)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:366)
at io.trino.sql.tree.QuerySpecification.accept(QuerySpecification.java:155)
at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:383)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:393)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:1152)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:366)
at io.trino.sql.tree.Query.accept(Query.java:107)
at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:383)
at io.trino.sql.analyzer.StatementAnalyzer.analyze(StatementAnalyzer.java:346)
at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:91)
at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:83)
at io.trino.execution.SqlQueryExecution.analyze(SqlQueryExecution.java:267)
at io.trino.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:190)
at io.trino.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:800)
at io.trino.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:129)
at io.trino.$gen.Trino_dev____20210429_030557_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)
The patch is here linkedin/coral#41. I'm checking this locally. Hive view having current_date returns result without any error, but current_timestamp throws below exception.
Note that "View ... is stale or in invalid state" is Trino's StatementAnalyzer's logic and cannot be effectively test-covered on Coral side alone. That's why i consider this imperative that we have end-to-end tests on the Trino side, additionally to unit tests in Coral.
i'm Integrate Coral with Presto to enable querying hive views has error:
i'm create view script