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

稍微复杂点的hql,解析报错 #2

Open
Level1Accelerator opened this issue Jun 29, 2021 · 4 comments
Open

稍微复杂点的hql,解析报错 #2

Level1Accelerator opened this issue Jun 29, 2021 · 4 comments

Comments

@Level1Accelerator
Copy link

HivesqlParser class中的stmt() 方法

ine 1:877 no viable alternative at input

@webgjc
Copy link
Owner

webgjc commented Jun 29, 2021

HivesqlParser是Hivesql.g4产生的,
这边使用的 Hivesql.g4 是hive github中的解析文件,
https://github.com/apache/hive/blob/master/hplsql/src/main/antlr4/org/apache/hive/hplsql/Hplsql.g4
这个其实很多不全和错误,还需要自行对解析文件做修改,
可以网上找找有没有更全的,个人目前还无法给到优化后的

@Level1Accelerator
Copy link
Author

HivesqlParser是Hivesql.g4产生的,
这边使用的 Hivesql.g4 是hive github中的解析文件,
https://github.com/apache/hive/blob/master/hplsql/src/main/antlr4/org/apache/hive/hplsql/Hplsql.g4
这个其实很多不全和错误,还需要自行对解析文件做修改,
可以网上找找有没有更全的,个人目前还无法给到优化后的

感谢回复,我之前用了官方给g4文件也是一样的问题

@stormrise
Copy link

stormrise commented Jul 12, 2021

你这用的是hpl/sql,是一个面向存储过程的
https://github.com/antlr/grammars-v4/tree/master/sql/hive
我猜这个才是hive sql的,
plus,你的maven plugin貌似没有配好,应该mvn install的时候就把所有的g4生成成java到相应的目录

@Alen-lv
Copy link

Alen-lv commented Aug 25, 2021

mysql的.g4文件生成代码后,类中不能使用是怎么回事啊?另外mysql为什么是两个文件啊

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

4 participants