dtenedor commented on code in PR #41191:
URL: https://github.com/apache/spark/pull/41191#discussion_r1206028445
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala:
##########
@@ -1385,8 +1389,37 @@ 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. */
+ def options: Map[String, String] = optionsList.map { case (key, value) =>
+ val newValue = if (value == null) {
+ null
+ } else value match {
+ case Literal(litVal: String, _) => litVal
+ case Literal(litVal: UTF8String, _) => litVal.toString
+ case _ => value.sql
Review Comment:
I realize that in this case, the constant-folding step was not able to
convert the option value to a literal, so it was non-constant; we return an
appropriate error message in this case 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]