[jira] [Assigned] (SPARK-19595) from_json produces only a single row when input is a json array
[ https://issues.apache.org/jira/browse/SPARK-19595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Burak Yavuz reassigned SPARK-19595: --- Assignee: Hyukjin Kwon > 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 >Assignee: Hyukjin Kwon >Priority: Minor > Fix For: 2.2.0 > > > Currently, {{from_json}} reads a single row when it is a json array. For > example, > {code} > 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]| > ++ > {code} > 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
[jira] [Assigned] (SPARK-19595) from_json produces only a single row when input is a json array
[ https://issues.apache.org/jira/browse/SPARK-19595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Apache Spark reassigned SPARK-19595: Assignee: Apache Spark > 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 >Assignee: Apache Spark >Priority: Minor > > Currently, {{from_json}} reads a single row when it is a json array. For > example, > {code} > 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]| > ++ > {code} > 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
[jira] [Assigned] (SPARK-19595) from_json produces only a single row when input is a json array
[ https://issues.apache.org/jira/browse/SPARK-19595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Apache Spark reassigned SPARK-19595: Assignee: (was: Apache Spark) > 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, > {code} > 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]| > ++ > {code} > 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