danny0405 commented on a change in pull request #9712: [FLINK-13656] 
[sql-parser][table-planner][table-planner-blink] Bump Calcite dependency to 
1.21.0
URL: https://github.com/apache/flink/pull/9712#discussion_r327908022
 
 

 ##########
 File path: 
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
 ##########
 @@ -375,210 +387,83 @@ SqlDrop SqlDropView(Span s, boolean replace) :
     }
 }
 
-SqlIdentifier FlinkCollectionsTypeName() :
-{
-}
-{
-    LOOKAHEAD(2)
-    <MULTISET> {
-        return new SqlIdentifier(SqlTypeName.MULTISET.name(), getPos());
-    }
-|
-    <ARRAY> {
-        return new SqlIdentifier(SqlTypeName.ARRAY.name(), getPos());
-    }
-}
-
-SqlIdentifier FlinkTypeName() :
+SqlTypeNameSpec SqlUserDefinedTypeName() :
 {
-    final SqlTypeName sqlTypeName;
-    final SqlIdentifier typeName;
-    final Span s = Span.of();
+    final String typeName;
 }
 {
     (
-<#-- additional types are included here -->
-<#-- make custom data types in front of Calcite core data types -->
-<#list parser.flinkDataTypeParserMethods as method>
-    <#if (method?index > 0)>
-    |
-    </#if>
-        LOOKAHEAD(2)
-        typeName = ${method}
-</#list>
+        <STRING> { typeName = token.image; }
     |
-        LOOKAHEAD(2)
-        sqlTypeName = SqlTypeName(s) {
-            typeName = new SqlIdentifier(sqlTypeName.name(), s.end(this));
-        }
-    |
-        LOOKAHEAD(2)
-        typeName = FlinkCollectionsTypeName()
-    |
-        typeName = CompoundIdentifier() {
-            throw new ParseException("UDT in DDL is not supported yet.");
-        }
+        <BYTES> { typeName = token.image; }
     )
     {
-        return typeName;
+        return new ExtendedSqlBuiltinTypeNameSpec(token.image, getPos());
     }
 }
 
-/**
-* Parse a Flink data type with nullable options, NULL -> nullable, NOT NULL -> 
not nullable.
-* Default to be nullable.
+/*
+* Parses collection type name that does not belong to standard SQL, i.e. 
ARRAY&lt;INT NOT NULL&gt;.
 */
-SqlDataTypeSpec FlinkDataType() :
+SqlTypeNameSpec ExtendedCollectionsTypeName() :
 
 Review comment:
   Thanks, i have renamed `ExtendedCollectionsTypeName2` to 
`CustomizedCollectionsTypeName`.
   
   The `ExtendedCollectionsTypeName` supports NULL/NOT NULL options compared to 
Calcite core `CollectionsTypeName`, i.e. "INT NOT NULL ARRAY", i have addressed 
this in the comments.
   
   The `CustomizedCollectionsTypeName` is totally customized by Flink, whose 
syntax does not belong to standard SQL, i.e. "ARRAY&lt;INT NOT NULL&gt;"

----------------------------------------------------------------
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