Hyukjin Kwon created SPARK-19595: ------------------------------------ Summary: from_json produces only a single row when input is a json array Key: SPARK-19595 URL: https://issues.apache.org/jira/browse/SPARK-19595 Project: Spark Issue Type: Bug Components: SQL Affects Versions: 2.2.0 Reporter: Hyukjin Kwon Priority: Minor
Currently, {{from_json}} reads a single row when it is a json array. For example, ```scala import org.apache.spark.sql.functions._ import org.apache.spark.sql.types._ val schema = StructType(StructField("a", IntegerType) :: Nil) Seq(("""[{"a": 1}, {"a": 2}]""")).toDF("struct").select(from_json(col("struct"), schema)).show() +--------------------+ |jsontostruct(struct)| +--------------------+ | [1]| +--------------------+ ``` Maybe we should not support this in that function or it should work like a generator expression. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org