File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -8144,6 +8144,19 @@ ColDataType ColDataType():
8144
8144
}
8145
8145
{
8146
8146
(
8147
+ (
8148
+ <K_STRUCT>
8149
+ "("
8150
+ ( tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER> )
8151
+ colDataType = ColDataType() { argumentsStringList.add( tk.image + " " + colDataType.toString()); }
8152
+ [
8153
+ ","
8154
+ ( tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER> )
8155
+ colDataType = ColDataType() { argumentsStringList.add( tk.image + " " + colDataType.toString()); }
8156
+ ]
8157
+ ")" { colDataType = new ColDataType("STRUCT"); }
8158
+ )
8159
+ |
8147
8160
LOOKAHEAD(2) (
8148
8161
colDataType = DataType()
8149
8162
)
Original file line number Diff line number Diff line change @@ -25,4 +25,15 @@ void testFileTable() throws JSQLParserException {
25
25
26
26
Assertions .assertEquals ("'/tmp/test.parquet'" , table .getName ());
27
27
}
28
+
29
+ @ Test
30
+ void testCreateWithStruct () throws JSQLParserException {
31
+ String sqlStr =
32
+ "CREATE TABLE starbake.array_test (\n " +
33
+ " keys VARCHAR[] NOT NULL,\n " +
34
+ " values1 struct( field1 varchar(255), field2 double) NOT NULL,\n " +
35
+ " values2 struct( field1 varchar(255), field2 double) NOT NULL\n " +
36
+ ");" ;
37
+ TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
38
+ }
28
39
}
You can’t perform that action at this time.
0 commit comments