File tree 2 files changed +20
-3
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -4619,15 +4619,16 @@ JdbcNamedParameter JdbcNamedParameter() : {
4619
4619
}
4620
4620
4621
4621
OracleNamedFunctionParameter OracleNamedFunctionParameter() : {
4622
- String name;
4622
+ Token token = null;
4623
+ String name = null;
4623
4624
Expression expression;
4624
4625
}
4625
4626
{
4626
- name=RelObjectNameExt2()
4627
+ ( name=RelObjectNameExt2() | token=<K_OUTER> )
4627
4628
<K_ORACLE_NAMED_PARAMETER_ASSIGNMENT>
4628
4629
expression=Expression()
4629
4630
{
4630
- return new OracleNamedFunctionParameter(name, expression);
4631
+ return new OracleNamedFunctionParameter(name != null ? name : token.image , expression);
4631
4632
}
4632
4633
}
4633
4634
Original file line number Diff line number Diff line change @@ -31,4 +31,20 @@ void testLateralFlat() throws JSQLParserException {
31
31
TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
32
32
}
33
33
34
+ /**
35
+ * The SQL keyword "OUTER" is a valid parameter name for Snowflake's FLATTEN table function.
36
+ */
37
+ @ Test
38
+ void testTableFunctionWithNamedParameterWhereNameIsOuterKeyword () throws JSQLParserException {
39
+ String sqlStr =
40
+ "INSERT INTO db.schema.target\n " +
41
+ " (Name, FriendParent)\n " +
42
+ " SELECT\n " +
43
+ " i.DATA_VALUE:Name AS Name,\n " +
44
+ " f1.Value:Parent:Name AS FriendParent\n " +
45
+ " FROM\n " +
46
+ " db.schema.source AS i,\n " +
47
+ " lateral flatten(input => i.DATA_VALUE:Friends, outer => true) AS f1;" ;
48
+ TestUtils .assertSqlCanBeParsedAndDeparsed (sqlStr , true );
49
+ }
34
50
}
You can’t perform that action at this time.
0 commit comments