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

LOAD statement #1908

Closed
LeBronChen1 opened this issue Dec 5, 2023 · 4 comments
Closed

LOAD statement #1908

LeBronChen1 opened this issue Dec 5, 2023 · 4 comments

Comments

@LeBronChen1
Copy link

Hi:
when use JSqlParser to parse sql then occur exception

Test load data into table code like below:

@test
public void testLoadDataTable() throws JSQLParserException {
String sqlString = “load data hdfs bulkload into table dbtest.HTTP options('inpath'='..')";
Statement statement = CCJSqlParserUtil.parse(sqlString);
}

Exception like blew:

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

Was expecting one of:
"("
"ALTER"
"CALL"
"COMMENT"
"COMMIT"
"CREATE"
"DECLARE"
"DELETE"
...

@manticore-projects manticore-projects changed the title parse sql of load data into table occur exception LOAD statement Dec 5, 2023
@manticore-projects
Copy link
Contributor

Greetings.

LOAD statement is not supported and you will need to provide or sponsor an implementation when you are interested in this.

@SheldonKubor
Copy link
Contributor

SheldonKubor commented Feb 7, 2024

Hi: when use JSqlParser to parse sql then occur exception

Test load data into table code like below:

@test public void testLoadDataTable() throws JSQLParserException { String sqlString = “load data hdfs bulkload into table dbtest.HTTP options('inpath'='..')"; Statement statement = CCJSqlParserUtil.parse(sqlString); }

Exception like blew:

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

Was expecting one of: "(" "ALTER" "CALL" "COMMENT" "COMMIT" "CREATE" "DECLARE" "DELETE" ...

Can you provide more SQL statement and more infomation like which db or which db version? @LeBronChen1

@manticore-projects
Copy link
Contributor

manticore-projects commented Feb 7, 2024

LOAD is a Postgres specific statement to read data in bulk into a table (from CSV, flatfile etc.).
Its a kind of data pump.

In general I am not a big fan of implementing and/or maintaining such very specific DDL statements because I don't understand why its AST was needed. In which scenario would you like to traverse the AST of this statement?

@manticore-projects
Copy link
Contributor

See UnsupportedStatements as explain in #1945 (unless you will sponsor or provide a specific implementation of this feature.)

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

3 participants