X Tutup
The Wayback Machine - https://web.archive.org/web/20201011185301/https://github.com/JSQLParser/JSqlParser/issues/946
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

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "(" #946

Open
WangHone opened this issue Feb 10, 2020 · 1 comment

Comments

@WangHone
Copy link

@WangHone WangHone commented Feb 10, 2020

Describe the bug
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("
at line 7, column 37.

To Reproduce
Example SQL
with rount as (select es.expense_account_id,s.name as site_name,es.seq from gwcx_expense_site es left join gwcx_site s on es.site_id = s.id) select t.id,t.expense_time,s.name as departure_site,t.expense_category, d.dict_value as reason,t.remark,t.cost,t.status,t.creation_time, s.name || '->' || string_agg(r.site_name,'->' ) AS trip_route from (select * from gwcx_expense_account where creator_user_id = 2) t left join gwcx_site s on t.departure_site_id = s.id left join blade_dict d on t.reason_id = d.id left join rount r on t.id = r.expense_account_id group by t.id,t.expense_time,s.name,t.expense_category, d.dict_value,t.remark,t.cost,t.status,t.creation_time order by t.creation_time desc
Exception
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "(" at line 7, column 37. Was expecting one of: "&" "," "::" ";" "<<" ">>" "ACTION" "ANY" "AS" "BYTE" "CASCADE" "CAST" "CHANGE" "CHAR" "CHARACTER" "COLLATE" "COLUMN" "COLUMNS" "COMMENT" "COMMIT" "CONNECT" "DESCRIBE" "DO" "DUPLICATE" "ENABLE" "END" "EXCEPT" "EXTRACT" "FALSE" "FIRST" "FN" "FOLLOWING" "FOR" "FROM" "GROUP" "HAVING" "INDEX" "INSERT" "INTERSECT" "INTERVAL" "INTO" "ISNULL" "KEY" "LAST" "MATERIALIZED" "MINUS" "NEXTVAL" "NO" "NULLS" "OPEN" "ORDER" "OVER" "PARTITION" "PATH" "PERCENT" "PRECISION" "PRIMARY" "PRIOR" "RANGE" "READ" "REPLACE" "ROW" "ROWS" "SEPARATOR" "SESSION" "SIBLINGS" "SIZE" "START" "TABLE" "TEMP" "TEMPORARY" "TOP" "TRUE" "TRUNCATE" "TYPE" "UNION" "UNSIGNED" "VALUE" "VALUES" "WHERE" "WINDOW" "XML" "ZONE" "[" "^" "|" <EOF> <K_DATETIMELITERAL> <K_DATE_LITERAL> <S_CHAR_LITERAL> <S_IDENTIFIER> <S_QUOTED_IDENTIFIER> at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:22439) ~[jsqlparser-3.1.jar:na] at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:22286) ~[jsqlparser-3.1.jar:na] at net.sf.jsqlparser.parser.CCJSqlParser.Statements(CCJSqlParser.java:577) ~[jsqlparser-3.1.jar:na] at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:135) ~[jsqlparser-3.1.jar:na] ... 133 common frames omitted
Expected behavior

System

  • PostgreSQL 11.6
  • jdk 1.8
  • jsqlparser3.1
@AnEmortalKid
Copy link
Contributor

@AnEmortalKid AnEmortalKid commented Jun 25, 2020

@WangHone this doesn't seem like an issue now (using master)

image

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.
X Tutup