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

create table statement can not support "partition" sqlkeywords #661

Closed
google-tmac opened this issue Aug 16, 2018 · 1 comment
Closed

create table statement can not support "partition" sqlkeywords #661

google-tmac opened this issue Aug 16, 2018 · 1 comment

Comments

@google-tmac
Copy link

Actual Behavior

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "partition" "PARTITION"
at line 1, column 1372.

Was expecting one of:
"("
"+"
"-"
";"
"="
"CASCADE"
"CHECK"
"COMMIT"
"CONSTRAINT"
"DELETE"
"EXCLUDE"
"FOREIGN"
"KEY"
"NOT"
"NULL"
"ON"
"PRIMARY"
"REFERENCES"
"ROWS"
"TABLESPACE"
"TEMP"
"TEMPORARY"
"UNIQUE"
"UNSIGNED"
"UPDATE"
"USING"
"WHERE"
"WITH"

<K_TIME_KEY_EXPR>
<S_CHAR_LITERAL>
<S_DOUBLE>
<S_IDENTIFIER>
<S_LONG>
<S_QUOTED_IDENTIFIER>

Expected Behavior

executing the statement such as CreateTable create = (CreateTable) CCJSqlParserUtil.parse(sql); successfully;
the parameter "sql" is a create table statement with "partition",for example:
create table T_TEST_PARTITION ( PART_COLUMN VARCHAR2(32) not null, OTHER_COLS VARCHAR2(10) not null ) tablespace TBS_DATA_01 partition by hash (PART_COLUMN) partitions 4 store in (TBS_DATA_01) compress;

Steps to Reproduce the Problem

1.Defining variable sql like this:
String sql = " create table T_TEST_PARTITION "+ " ("+ " PART_COLUMN VARCHAR2(32) not null,"+ " OTHER_COLS VARCHAR2(10) not null"+ " )"+ " tablespace TBS_DATA_01"+ " partition by hash (PART_COLUMN)"+ " partitions 4 store in (TBS_DATA_01) compress";
2.execute statement
CreateTable create = (CreateTable) CCJSqlParserUtil.parse(sql);

Specifications

  • Version: com.github.jsqlparser:jsqlparser:1.2 jdk1.8
  • Platform:windows eclipse
  • Subsystem:
@wumpz wumpz closed this as completed in 44ea8bd Aug 17, 2018
@wumpz
Copy link
Member

wumpz commented Aug 17, 2018

The snapshot is not yet compiled at sonatype.
thx for using JsqlParser

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

No branches or pull requests

2 participants