danny0405 commented on a change in pull request #11568: [FLINK-16779][table] 
Add RAW type support in DDL and functions
URL: https://github.com/apache/flink/pull/11568#discussion_r402692226
 
 

 ##########
 File path: 
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
 ##########
 @@ -889,6 +888,30 @@ SqlTypeNameSpec SqlMapTypeName() :
     }
 }
 
+/** Parses a SQL raw type such as {@code RAW('org.my.Class', 'sW3Djsds...')}. 
*/
+SqlTypeNameSpec SqlRawTypeName() :
+{
+    SqlCharStringLiteral className;
+    SqlCharStringLiteral serializerString;
+}
+{
+    <RAW>
+    <LPAREN>
+    <QUOTED_STRING> {
+        String cn = SqlParserUtil.parseString(token.image);
+        className = SqlLiteral.createCharString(cn, getPos());
 
 Review comment:
   I would suggest to reuse `StringLiteral()` parse instead for these reasons:
   1. Handle the multi-segment/charset/unescape character correctly
   2. We would check the string format sooner or later, either in the parser 
and planner

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to