gengliangwang commented on code in PR #41191: URL: https://github.com/apache/spark/pull/41191#discussion_r1204980014
########## 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: How can a non-literal expression convert back to itself with `toExpressionOptions`? -- 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