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

[Coral-Trino] cannot recognize input near 'select' 'max' '(' in expression specification #469

Open
findinpath opened this issue Oct 24, 2023 · 0 comments

Comments

@findinpath
Copy link
Contributor

findinpath commented Oct 24, 2023

Repro steps

Hive

create table mytable(snapshot integer);
insert into mytable values (1), (2), (3);
create view myview as select * from (select * from mytable where snapshot = (select max(snapshot) from mytable)) as t;
select * from myview;
-- return 3

Trino with coral-trino 2.2.14

trino> select * from hive.default.myview;
Query 20231024_073428_00001_ue4sy failed: Failed to translate Hive view 'default.myview': com.linkedin.coral.hive.hive2rel.parsetree.parser.ParseException: line 1:111 cannot recognize input near 'select' 'max' '(' in expression specification
io.trino.spi.TrinoException: Failed to translate Hive view 'default.myview': com.linkedin.coral.hive.hive2rel.parsetree.parser.ParseException: line 1:111 cannot recognize input near 'select' 'max' '(' in expression specification
	at io.trino.plugin.hive.ViewReaderUtil$HiveViewReader.decodeViewData(ViewReaderUtil.java:266)
	at io.trino.plugin.hive.HiveMetadata.lambda$toConnectorViewDefinition$84(HiveMetadata.java:2826)
	at java.base/java.util.Optional.flatMap(Optional.java:289)
	at io.trino.plugin.hive.HiveMetadata.toConnectorViewDefinition(HiveMetadata.java:2810)
	at io.trino.plugin.hive.HiveMetadata.getView(HiveMetadata.java:2804)
....
Caused by: java.lang.RuntimeException: com.linkedin.coral.hive.hive2rel.parsetree.parser.ParseException: line 1:111 cannot recognize input near 'select' 'max' '(' in expression specification
	at com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder.process(ParseTreeBuilder.java:111)
	at com.linkedin.coral.hive.hive2rel.HiveToRelConverter.toSqlNode(HiveToRelConverter.java:100)
	at com.linkedin.coral.common.ToRelConverter.processView(ToRelConverter.java:152)
	at com.linkedin.coral.common.ToRelConverter.convertView(ToRelConverter.java:123)
	at io.trino.plugin.hive.ViewReaderUtil$HiveViewReader.decodeViewData(ViewReaderUtil.java:244)
	... 41 more
Caused by: com.linkedin.coral.hive.hive2rel.parsetree.parser.ParseException: line 1:111 cannot recognize input near 'select' 'max' '(' in expression specification
	at com.linkedin.coral.hive.hive2rel.parsetree.parser.CoralParseDriver.parse(CoralParseDriver.java:38)
	at com.linkedin.coral.hive.hive2rel.parsetree.ParseTreeBuilder.process(ParseTreeBuilder.java:108)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant