cloud-fan commented on a change in pull request #27110: [SPARK-30439][SQL]
Support NOT NULL in column data type
URL: https://github.com/apache/spark/pull/27110#discussion_r363794905
##########
File path:
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
##########
@@ -865,23 +866,23 @@ qualifiedColTypeWithPositionList
;
qualifiedColTypeWithPosition
- : name=multipartIdentifier dataType (COMMENT comment=STRING)? colPosition?
+ : name=multipartIdentifier dataType (NOT NULL)? (COMMENT comment=STRING)?
colPosition?
;
colTypeList
: colType (',' colType)*
;
colType
- : colName=errorCapturingIdentifier dataType (COMMENT STRING)?
+ : colName=errorCapturingIdentifier dataType (NOT NULL)? (COMMENT
comment=STRING)?
Review comment:
it depends on data source. You can see how we determine the schema in
`CreateDataSourceTableCommand`.
BTW this is an existing problem: users can call `spark.catalog.createTable`
with non-nullable schema.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]