cloud-fan commented on a change in pull request #26806: [SPARK-30183][SQL] Disallow to specify reserved properties in CREATE NAMESPACE syntax URL: https://github.com/apache/spark/pull/26806#discussion_r363151225
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala ########## @@ -2525,17 +2526,21 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging var properties = ctx.tablePropertyList.asScala.headOption .map(visitPropertyKeyValues) .getOrElse(Map.empty) - Option(ctx.comment).map(string).map { - properties += SupportsNamespaces.PROP_COMMENT -> _ + + if (properties.keySet.intersect(RESERVED_PROPERTIES.asScala.toSet).nonEmpty) { + throw new ParseException(s"Disallow to specify reserved properties, including" + + s" ${RESERVED_PROPERTIES.asScala.mkString("(", ",", ")")}.", ctx) + } + + Option(ctx.comment).map(string).foreach { + properties += PROP_COMMENT -> _ } - ctx.locationSpec.asScala.headOption.map(visitLocationSpec).map { - properties += SupportsNamespaces.PROP_LOCATION -> _ + ctx.locationSpec.asScala.headOption.map(visitLocationSpec).foreach { Review comment: let's leave it as it is for now ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org