A CREATE statement with default values that are negative are not handled correctly. Please see the example below where the default value for MONTH is -1.
With <<QUERY>> =
CREATE TABLE dim_date(
date DATE NOT NULL,
year INTEGER NOT NULL,
quarter INTEGER NOT NULL,
month INTEGER NOT NULL DEFAULT -1,
day INTEGER NOT NULL
);
This test fails:
private CCJSqlParserManager sqlParser = new CCJSqlParserManager();
Statement stmt = sqlParser.parse(new StringReader(<<QUERY>>);
assertTrue(stmt instanceof CreateTable);