Github user sabhyankar commented on a diff in the pull request:
https://github.com/apache/spark/pull/8746#discussion_r41091143
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DDLParser.scala
---
@@ -173,13 +174,15 @@ class DDLParser(parseQuery: String => LogicalPlan)
optionName ~ stringLit ^^ { case k ~ v => (k, v) }
protected lazy val column: Parser[StructField] =
- ident ~ dataType ~ (COMMENT ~> stringLit).? ^^ { case columnName ~
typ ~ cm =>
- val meta = cm match {
- case Some(comment) =>
- new MetadataBuilder().putString(COMMENT.str.toLowerCase,
comment).build()
- case None => Metadata.empty
- }
-
- StructField(columnName, typ, nullable = true, meta)
+ ident ~ dataType ~ (NOT ~ NULL).? ~ (COMMENT ~> stringLit).? ^^ {
+ case columnName ~ typ ~ setNotNullable ~ cm =>
--- End diff --
I guess that makes it a little less ambiguous. I have made the change in
the latest commit.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]