net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "SELECT" <K_SELECT>

See original GitHub issue

Describe the bug

net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "SELECT" <K_SELECT>
    at line 11, column 9.

Was expecting one of:

    "!"
    "("
    "+"
    "-"
    "?"
    "@"
    "@@"
    "ACTION"
    "ANY"
    "BYTE"
    "CASCADE"
    "CASE"
    "CAST"
    "CHANGE"
    "CHAR"
    "CHARACTER"
    "COLUMN"
    "COLUMNS"
    "COMMENT"
    "COMMIT"
    "DESCRIBE"
    "DO"
    "DUPLICATE"
    "ENABLE"
    "END"
    "EXTRACT"
    "FALSE"
    "FIRST"
    "FN"
    "FOLLOWING"
    "GROUP_CONCAT"
    "INDEX"
    "INSERT"
    "INTERVAL"
    "ISNULL"
    "KEY"
    "LAST"
    "MATERIALIZED"
    "NEXTVAL"
    "NO"
    "NOT"
    "NULL"
    "NULLS"
    "OPEN"
    "OVER"
    "PARTITION"
    "PATH"
    "PERCENT"
    "PRECISION"
    "PRIMARY"
    "PRIOR"
    "RANGE"
    "READ"
    "REPLACE"
    "ROW"
    "ROWS"
    "SEPARATOR"
    "SESSION"
    "SIBLINGS"
    "SIZE"
    "START"
    "TABLE"
    "TEMP"
    "TEMPORARY"
    "TOP"
    "TRUE"
    "TRUNCATE"
    "TYPE"
    "UNSIGNED"
    "VALUE"
    "VALUES"
    "XML"
    "ZONE"
    "{d"
    "{t"
    "{ts"
    "~"
    <K_DATETIMELITERAL>
    <K_DATE_LITERAL>
    <K_TIME_KEY_EXPR>
    <S_CHAR_LITERAL>
    <S_DOUBLE>
    <S_HEX>
    <S_IDENTIFIER>
    <S_LONG>
    <S_QUOTED_IDENTIFIER>

To Reproduce

INSERT INTO a.new_table(
	stat_date
	,game_id
	,live_num
	,insert_time
	,agg_code
	,platform
	,channel_id
	,area_id
	)
VALUES (SELECT area_id
        ,area_id
        ,area_id
        ,area_id
        ,area_id
        ,area_id
        ,area_id
        ,area_id
        FROM kudu.old_table
        WHERE event_time >= date_parse('2019-10-09 05:29:00', '%Y-%m-%d %H:%i:%s')
        	AND event_time < date_parse('2019-10-09 05:30:00', '%Y-%m-%d %H:%i:%s')
        	AND game_id IN (
        		'1'
        		,'2'
        		)
        GROUP BY area_id
        	,game_id);

System

  • Java Version 1,8
  • JSqlParser version 3.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wumpzcommented, Nov 22, 2020

Which database is this? Is this actually a valid SQL? I only know this version without the values keyword:

insert into mytable (a, b) (select a, b from mytable2)
0reactions
wumpzcommented, Dec 30, 2020

No answer?

Read more comments on GitHub >

github_iconTop Results From Across the Web

net.sf.jsqlparser.parser.ParseException - java - Stack Overflow
This seemed to be a dependency issue for me. This is the query I ran with the older version of the jsqlparser library:...
Read more >
Caused by: net.sf.jsqlparser.parser.ParseException ... - GitHub
Describe the bug. Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "(" at line 7, column 37. To Reproduce Example SQL
Read more >
Caused by: net.sf.jsqlparser.parser.ParseException ...
重点看报错信息里面的那个Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: ":" ":".
Read more >
net.sf.jsqlparser.parser.ParseException java code examples
startsWith("Encountered unexpected token: \"=\" \"=\"")) { return new ParseException("unable to parse complete sql string. one reason for this is the use of ...
Read more >
net.sf.jsqlparser.parser.ParseException - 博客园
net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: ":" ":". at line 5, column 82. Was expecting one of:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found