`LOAD` statement
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" ...
Greetings.
LOAD statement is not supported and you will need to provide or sponsor an implementation when you are interested in this.
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
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?
See UnsupportedStatements as explain in #1945 (unless you will sponsor or provide a specific implementation of this feature.)