yaooqinn commented on a change in pull request #27197: [SPARK-30507][SQL] TableCalalog reserved properties shoudn't be changed via options or tblpropeties URL: https://github.com/apache/spark/pull/27197#discussion_r366871254
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala ########## @@ -2669,6 +2667,47 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging ctx.EXTENDED != null) } + /** + * When resolving TBLPROPERTIES, please let the `location` be None and `isOptionClause` be false + */ + private def cleanTableProperties( + ctx: ParserRuleContext, + properties: Map[String, String], + location: Option[String] = None, + isOptionClause: Boolean = false): Map[String, String] = withOrigin(ctx) { + import TableCatalog._ + val legacyOn = conf.getConf(SQLConf.LEGACY_PROPERTY_NON_RESERVED) + var pathDefined = false + val newProps = properties.filter { + case (PROP_PROVIDER, _) if !legacyOn => + throw new ParseException(s"$PROP_PROVIDER is a reserved table property, please use" + + s" the USING clause to specify it.", ctx) + case (PROP_PROVIDER, _) => false + case (PROP_LOCATION, _) if !legacyOn => + throw new ParseException(s"$PROP_LOCATION is a reserved table property, please use" + + s" the LOCATION clause to specify it.", ctx) + case (PROP_LOCATION, _) => false + case (path, _) if path.equalsIgnoreCase("path") && location.nonEmpty => Review comment: yes in tblprops,path is a normal one as it is onw ---------------------------------------------------------------- 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