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

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

Open
loevingerx opened this issue Dec 5, 2024 · 1 comment

Comments

@loevingerx
Copy link

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)
@manticore-projects
Copy link
Contributor

manticore-projects commented Dec 6, 2024

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?

tt20061904 added a commit to tt20061904/JSqlParser that referenced this issue Jan 2, 2025
tt20061904 added a commit to tt20061904/JSqlParser that referenced this issue Jan 3, 2025
tt20061904 added a commit to tt20061904/JSqlParser that referenced this issue Jan 3, 2025
manticore-projects pushed a commit that referenced this issue Jan 6, 2025
* #2119 add support INSERT OVERWRITE PARTITION

* #2119 fix test case

* #2119 add reserved keyword

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

No branches or pull requests

2 participants