You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:33:39 UTC

[GitHub] [spark] maropu commented on a change in pull request #32858: [SPARK-35706][SQL]Consider making the ':' in STRUCT data type definition optional

maropu commented on a change in pull request #32858:
URL: https://github.com/apache/spark/pull/32858#discussion_r649659422



##########
File path: sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
##########
@@ -930,7 +930,7 @@ complexColTypeList
     ;
 
 complexColType
-    : identifier ':' dataType (NOT NULL)? commentSpec?
+    : identifier ':'? dataType (NOT NULL)? commentSpec?

Review comment:
       Could you update the SQL doc? https://github.com/apache/spark/blame/master/docs/sql-ref-datatypes.md#L197

##########
File path: docs/sql-ref-datatypes.md
##########
@@ -194,7 +194,7 @@ The following table shows the type names as well as aliases used in Spark SQL pa
 |**DecimalType**|DECIMAL, DEC, NUMERIC|
 |**CalendarIntervalType**|INTERVAL|
 |**ArrayType**|ARRAY\<element_type>|
-|**StructType**|STRUCT<field1_name: field1_type, field2_name: field2_type, ...>|
+|**StructType**|STRUCT<field1_name field1_type, field2_name field2_type, ...>|

Review comment:
       Instead of removing `:`, how about writing `Note that : is optional` like https://github.com/apache/spark/blame/master/docs/sql-ref-datatypes.md#L172 ?




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org