snuyanzin commented on code in PR #27251:
URL: https://github.com/apache/flink/pull/27251#discussion_r2553116051
##########
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -3519,6 +3675,55 @@ SqlCreate SqlCreateModel(Span s, boolean isTemporary) :
}
}
+/**
+* CREATE [TEMPORARY] [SYSTEM] CONNECTION [IF NOT EXISTS]
[catalog_name.][db_name.]connection_name
+* [COMMENT connection_comment]
+* WITH (property_key = property_val, ...)
+*/
+SqlCreate SqlCreateConnection(Span s, boolean isTemporary) :
+{
+ final SqlParserPos startPos = s.pos();
+ boolean ifNotExists = false;
+ boolean isSystem = false;
+ SqlIdentifier connectionIdentifier;
+ SqlCharStringLiteral comment = null;
+ SqlNodeList propertyList = SqlNodeList.EMPTY;
+}
+{
+ [
+ <SYSTEM>
+ {
+ if (!isTemporary){
+ throw SqlUtil.newContextException(getPos(),
+
ParserResource.RESOURCE.createSystemConnectionOnlySupportTemporary());
+ }
+ isSystem = true;
+ }
+ ]
+ <CONNECTION>
+
+ ifNotExists = IfNotExistsOpt()
+
+ connectionIdentifier = CompoundIdentifier()
+ [ <COMMENT> <QUOTED_STRING>
+ {
+ String p = SqlParserUtil.parseString(token.image);
+ comment = SqlLiteral.createCharString(p, getPos());
+ }
Review Comment:
```suggestion
{
comment = Comment();
}
```
There was added `Comment` method at
https://github.com/apache/flink/pull/27256 to unify the way of parsing
comments, let's use it here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]