Skip to content

[BUG] JSQLParser Version : 5.0 RDBMS : Hive syntax is not supported INSERT OVERWRITE PARTITION (dtime = '20220403')CASE WHEN condition THEN END ELSE ... #2119

Closed

Description

@loevingerx

Grammar or Syntax Description

-Hive syntax is not supported: INSERT OVERWRITE And PARTITION (dtime = '20220403')
-Hive syntax is not supported: CASE WHEN condition THEN END ELSE ...

SQL Example

  • Simplified Query Example, focusing on the failing feature
INSERT OVERWRITE TABLE sjzt.dws_country_orders PARTITION (dtime = '20220403')
SELECT
code,
name,
last30day_country_order_count,
last30day_country_sales_amount,
last30day_country_average_amount
FROM fact_order_detail

Additional context

Test JSQLParser Version 5.0

error info

Exception in thread "main" net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "dws_country_orders" <S_IDENTIFIER>
at line 1, column 24.

Was expecting one of:

"("
"OUTPUT"
"SET"
"VALUE"
"VALUES"
"WITH"
<K_SELECT>

at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:350)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:123)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:89)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:62)
at com.ctsi.CCJSqlParserUtilTest.main(CCJSqlParserUtilTest.java:23)

Caused by: java.util.concurrent.ExecutionException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "dws_country_orders" <S_IDENTIFIER>
at line 1, column 24.

Was expecting one of:

"("
"OUTPUT"
"SET"
"VALUE"
"VALUES"
"WITH"
<K_SELECT>

at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:206)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:343)
... 4 more

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "dws_country_orders" <S_IDENTIFIER>
at line 1, column 24.

Was expecting one of:

"("
"OUTPUT"
"SET"
"VALUE"
"VALUES"
"WITH"
<K_SELECT>

at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:39603)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:39427)
at net.sf.jsqlparser.parser.CCJSqlParser.Insert(CCJSqlParser.java:4439)
at net.sf.jsqlparser.parser.CCJSqlParser.SingleStatement(CCJSqlParser.java:383)
at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:296)
at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:339)
at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:336)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)

Activity

  1. manticore-projects commented on Dec 6, 2024

    @manticore-projects
    Contributor

    Greetings!

    HIVE has many exotic syntax and is not too well supported in JSQLParser right now. You will have to provide or sponsor an implementation for improving the Hive support.

    What is you concern about the CASE ... expression?

  2. added 3 commits that reference this issue on Jan 2, 2025
  3. added a commit that references this issue on Jan 6, 2025
  4. fudianchn commented on Aug 23, 2026

    @fudianchn
    Contributor

    Verified on current master (1e4e92b): the INSERT OVERWRITE TABLE sjzt.dws_country_orders PARTITION (dtime = '20220403') SELECT ... FROM fact_order_detail statement from this issue parses and round-trips. Multi-column partitions such as PARTITION (dtime = '20220403', hour = '10') work as well. Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions