druid SQLUtils.parseSingleStatement解析PG语法失败

ru9i0ody  于 2021-11-27  发布在  Java
关注(0)|答案(0)|浏览(418)

https://www.postgresql.org/docs/10/ddl-partitioning.html
https://www.postgresql.org/docs/9.1/sql-createforeigntable.html
https://www.postgresql.org/docs/9.1/sql-dropforeigntable.html

BEGIN;
CREATE TABLE IF NOT EXISTS test_dim_segment
(
aid bigint
,segment_id bigint
,segment_name text
,ds text not null
)
PARTITION BY LIST(ds);
COMMIT;

BEGIN;
CREATE FOREIGN TABLE IF NOT EXISTS test_dim_segment_odps
(
aid bigint
,segment_id bigint
,segment_name text
,ds text
)
SERVER odps_server
OPTIONS (project_name 'test', table_name 'test_dim_segment');
COMMIT;

CREATE TABLE IF NOT EXISTS test_dim_segment_20201009 PARTITION OF test_dim_segment FOR VALUES IN ('20201009')

Exception in thread "main" com.alibaba.fastsql.sql.parser.ParserException: syntax error, error in :'1009 PARTITION OF test_dim_segment , pos 62, line 1, column 54, token IDENTIFIER PARTITION
at com.alibaba.fastsql.sql.parser.SQLParser.printError(SQLParser.java:430)
at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:580)
at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:97)
at com.alibaba.fastsql.sql.SQLUtils.parseSingleStatement(SQLUtils.java:569)
at com.alimama.FastSqlDemo.main(FastSqlDemo.java:26)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题