File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/expression Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -6902,12 +6902,13 @@ StructType StructType() #StruckType:
69026902 |
69036903 (
69046904 <OPENING_CURLY_BRACKET> { arguments= new ArrayList<SelectItem<?>>(); dialect = StructType.Dialect.DUCKDB;}
6905-
6906- id = RelObjectName() <DOUBLE_COLON> expression = Expression() { arguments.add( new SelectItem( expression, id) ); }
6905+ ( id = RelObjectNameExt2() | tk1=<S_CHAR_LITERAL> { id = tk1.image; } )
6906+ <DOUBLE_COLON> expression = Expression() { arguments.add( new SelectItem( expression, id) ); }
69076907
69086908 (
69096909 ","
6910- id = RelObjectName() <DOUBLE_COLON> expression = Expression() { arguments.add( new SelectItem( expression, id) ); }
6910+ ( id = RelObjectNameExt2() | tk1=<S_CHAR_LITERAL> { id = tk1.image; } )
6911+ <DOUBLE_COLON> expression = Expression() { arguments.add( new SelectItem( expression, id) ); }
69116912 )*
69126913 <CLOSING_CURLY_BRACKET>
69136914
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ void testStructTypeBigQuery() throws JSQLParserException {
3939
4040 @ Test
4141 void testStructTypeDuckDB () throws JSQLParserException {
42- // @todo: check why the white-space after the "{" is needed?!
4342 String sqlStr = "SELECT { t:'abc',len:5}" ;
4443 TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
4544
@@ -64,6 +63,12 @@ void testStructTypeConstructorDuckDB() throws JSQLParserException {
6463 TestUtils .assertStatementCanBeDeparsedAs (select , sqlStr , true );
6564 }
6665
66+ @ Test
67+ void testStructTypeConstructorDuckDBWithQuotesAndTypes () throws JSQLParserException {
68+ String sqlStr = "SELECT {'t':'abc'::STRING,'len':5::INT}" ;
69+ TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
70+ }
71+
6772 @ Test
6873 void testStructTypeWithArgumentsDuckDB () throws JSQLParserException {
6974 // @todo: check why the white-space after the "{" is needed?!
You can’t perform that action at this time.
0 commit comments