gengliangwang commented on code in PR #41191:
URL: https://github.com/apache/spark/pull/41191#discussion_r1206049315


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala:
##########
@@ -1385,8 +1389,49 @@ case class DropIndex(
 case class TableSpec(
     properties: Map[String, String],
     provider: Option[String],
-    options: Map[String, String],
+    // Note that the map value can be null if the input option only provided a 
key.
+    optionsList: Map[String, Expression],
     location: Option[String],
     comment: Option[String],
     serde: Option[SerdeInfo],
-    external: Boolean)
+    external: Boolean) extends TreePatternBits {
+  /** This is a convenience method to obtain the options list as a map of 
strings to strings. */
+  lazy val options: Map[String, String] = {

Review Comment:
   This looks hacky. Ideally, a SQL query should work even when the optimizer 
rule `ConstantFolding`.
   
   Sorry for getting back and forth: shall we have a `UnresolvedTableSpec` 
which contains `optionsList: Map[String, Expression]`. And another rule to 
resolve `UnresolvedTableSpec` as `TableSpec` if the expression in the map is 
all resolved? We can try using expression.eval() in the new rule.



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

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to