Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22775#discussion_r227239024
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala
 ---
    @@ -770,8 +776,17 @@ case class SchemaOfJson(
         factory
       }
     
    -  override def convert(v: UTF8String): UTF8String = {
    -    val dt = 
Utils.tryWithResource(CreateJacksonParser.utf8String(jsonFactory, v)) { parser 
=>
    +  @transient
    +  private lazy val json = child.eval().asInstanceOf[UTF8String]
    --- End diff --
    
    It is possible and that's one case I am trying to disallow here. 
`from_json` only accepts `schema_of_json` when the input is literals. I can't 
imagine a proper usecase by DDL formatted strings from a JSON column.
    
    The main purpose of this expression was `from_json(..., schema = 
schema_of_json(...))`. I was trying to allow what I need only.


---

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

Reply via email to