cloud-fan 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_r366875986
 
 

 ##########
 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(
 
 Review comment:
   We can have 2 methods
   ```
   def cleanTableProperties {
     // check reserved properties
   }
   
   def cleanOptions(...): (Map[String, String], Option[String]) {
     val cleaned = cleanTableProperties(options)
     var path: Option[String] = None
     val pathRemoved = cleaned.filter {
       case if it's path =>
         if (path.isDefined) fail else ...
     }
     (pathRemoved, location)
   }
   ```
   and the caller side
   ```
   val (cleanedOptions, path) = cleanTableProperties(ctx, options)
   if (location.isDefined && path.isDefined) fail
   ```

----------------------------------------------------------------
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

Reply via email to