-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Encounter "com.linkedin.coral.hive.hive2rel.parsetree.parser.ParseException" while querying Hive View. #8789
Comments
cc: @findepi @joshthoward Seems like Coral fails to translate |
@lxqfy for completeness, what does |
|
Actually, there are two issues in a view definition. The first is ※ The latest coral library hive> create view test_view_date as select date('2021-01-01') as c1;
trino:default> select * from test_view_date;
Query 20210818_080020_00051_27wm3 failed: java.lang.NoSuchFieldError: HIVE_SUPPORT_SQL11_RESERVED_KEYWORDS
java.lang.RuntimeException: java.lang.NoSuchFieldError: HIVE_SUPPORT_SQL11_RESERVED_KEYWORDS
at io.trino.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:144)
at io.trino.$gen.Trino_testversion____20210818_074312_3.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:829)
Caused by: java.lang.NoSuchFieldError: HIVE_SUPPORT_SQL11_RESERVED_KEYWORDS
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.useSQL11ReservedKeywordsForIdentifier(HiveParser.java:1000)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.useSQL11ReservedKeywordsForIdentifier(HiveParser_IdentifiersParser.java:726)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.identifier(HiveParser_IdentifiersParser.java:10107)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.functionIdentifier(HiveParser_IdentifiersParser.java:10547)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.synpred8_IdentifiersParser_fragment(HiveParser_IdentifiersParser.java:10978)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.synpred8_IdentifiersParser(HiveParser_IdentifiersParser.java:11162)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.functionName(HiveParser_IdentifiersParser.java:3378)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.synpred11_IdentifiersParser_fragment(HiveParser_IdentifiersParser.java:11022)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.synpred11_IdentifiersParser(HiveParser_IdentifiersParser.java:11260)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser$DFA32.specialStateTransition(HiveParser_IdentifiersParser.java)
at org.antlr.runtime.DFA.predict(DFA.java:80)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.atomExpression(HiveParser_IdentifiersParser.java:5394)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceFieldExpression(HiveParser_IdentifiersParser.java:5600)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceUnaryPrefixExpression(HiveParser_IdentifiersParser.java:5977)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceUnarySuffixExpression(HiveParser_IdentifiersParser.java:6037)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceBitwiseXorExpression(HiveParser_IdentifiersParser.java:6221)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceStarExpression(HiveParser_IdentifiersParser.java:6381)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedencePlusExpression(HiveParser_IdentifiersParser.java:6541)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceAmpersandExpression(HiveParser_IdentifiersParser.java:6692)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceBitwiseOrExpression(HiveParser_IdentifiersParser.java:6843)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceEqualExpression(HiveParser_IdentifiersParser.java:7371)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceNotExpression(HiveParser_IdentifiersParser.java:8380)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceAndExpression(HiveParser_IdentifiersParser.java:8499)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.precedenceOrExpression(HiveParser_IdentifiersParser.java:8656)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_IdentifiersParser.expression(HiveParser_IdentifiersParser.java:5322)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.expression(HiveParser.java:40409)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_SelectClauseParser.selectItem(HiveParser_SelectClauseParser.java:2414)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_SelectClauseParser.selectList(HiveParser_SelectClauseParser.java:1119)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser_SelectClauseParser.selectClause(HiveParser_SelectClauseParser.java:874)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.selectClause(HiveParser.java:40397)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.selectStatement(HiveParser.java:36231)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.regularBody(HiveParser.java:36138)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.queryStatementExpressionBody(HiveParser.java:35170)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.queryStatementExpression(HiveParser.java:35047)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.execStatement(HiveParser.java:1519)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.HiveParser.statement(HiveParser.java:1079)
at com.linkedin.coral.hive.hive2rel.parsetree.parser.CoralParseDriver.parse(CoralParseDriver.java:35)
at com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder.process(ParseTreeBuilder.java:165)
at com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder.processViewOrTable(ParseTreeBuilder.java:134)
at com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder.processView(ParseTreeBuilder.java:149)
at com.linkedin.coral.hive.hive2rel.HiveToRelConverter.convertView(HiveToRelConverter.java:105)
at io.trino.plugin.hive.ViewReaderUtil$HiveViewReader.decodeViewData(ViewReaderUtil.java:142)
at io.trino.plugin.hive.HiveMetadata.lambda$getView$59(HiveMetadata.java:1996)
at java.base/java.util.Optional.map(Optional.java:265)
at io.trino.plugin.hive.HiveMetadata.getView(HiveMetadata.java:1990)
at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.getView(ClassLoaderSafeConnectorMetadata.java:573)
at io.trino.metadata.MetadataManager.getView(MetadataManager.java:1229)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:1324)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitTable(StatementAnalyzer.java:361)
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:378)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.analyzeFrom(StatementAnalyzer.java:3184)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:1956)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuerySpecification(StatementAnalyzer.java:361)
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:378)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.process(StatementAnalyzer.java:388)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:1168)
at io.trino.sql.analyzer.StatementAnalyzer$Visitor.visitQuery(StatementAnalyzer.java:361)
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:378)
at io.trino.sql.analyzer.StatementAnalyzer.analyze(StatementAnalyzer.java:341)
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:269)
at io.trino.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:190)
at io.trino.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:806)
at io.trino.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:132)
... 7 more hive> create view test_view_parenthesis as (select 1 as c1);
trino:default> select * from test_view_parenthesis;
Query 20210818_075920_00050_27wm3 failed: Failed to translate Hive view 'default.test_view_parenthesis': com.linkedin.coral.hive.hive2rel.parsetree.parser.ParseException: line 1:0 cannot recognize input near '(' 'select' '1' |
Hi,
I am trying to upgrade from prestosql-332 to trino-356. One of the Hive views that used to work with the old version.
SHOW CREATE VIEW in trino-356:
SHOW CREATE VIEW in prestosql-332:
I am able to bypass the issue by
set session hive.legacy_hive_view_translation=true
;Seem that it is due to the brackets in the view definition.
The text was updated successfully, but these errors were encountered: