Re: JSON Arrays and Spark

2016-10-12 Thread sujeet jog
e = true) > > ||||||||||-- maritalStatus: string > (nullable = true) > > ||||||||||-- numberOfDeductions: long > (nullable = true) > > || | | | | ||-- wDate: struct (nullable = true) > > ||||

Re: JSON Arrays and Spark

2016-10-12 Thread Hyukjin Kwon
true) > > || | | | | ||-- wDate: struct (nullable = true) > > |||||||||-- originalHireDate: string > (nullable = true) > > ||||||-- year: long (nullable = true) > > > > > > *From:* Luciano R

RE: JSON Arrays and Spark

2016-10-12 Thread Kappaganthu, Sivaram (ES)
Subject: Re: JSON Arrays and Spark Please take a look at http://spark.apache.org/docs/latest/sql-programming-guide.html#json-datasets Particularly the note at the required format : Note that the file that is offered as a json file is not a typical JSON file. Each line must contain a separate, self

Re: JSON Arrays and Spark

2016-10-10 Thread Hyukjin Kwon
FYI, it supports [{...}, {...} ...] Or {...} format as input. On 11 Oct 2016 3:19 a.m., "Jean Georges Perrin" wrote: > Thanks Luciano - I think this is my issue :( > > On Oct 10, 2016, at 2:08 PM, Luciano Resende wrote: > > Please take a look at >

Re: JSON Arrays and Spark

2016-10-10 Thread Jean Georges Perrin
Thanks Luciano - I think this is my issue :( > On Oct 10, 2016, at 2:08 PM, Luciano Resende wrote: > > Please take a look at > http://spark.apache.org/docs/latest/sql-programming-guide.html#json-datasets >

Re: JSON Arrays and Spark

2016-10-10 Thread Jean Georges Perrin
Thanks! I am ok with strict rules (despite being French), but even: [{ "red": "#f00", "green": "#0f0" },{ "red": "#f01", "green": "#0f1" }] is not going through… Is there a way to see what he does not like? the JSON parser has been pretty good to me until

Re: JSON Arrays and Spark

2016-10-10 Thread Luciano Resende
Please take a look at http://spark.apache.org/docs/latest/sql-programming-guide.html#json-datasets Particularly the note at the required format : Note that the file that is offered as *a json file* is not a typical JSON file. Each line must contain a separate, self-contained valid JSON object.

JSON Arrays and Spark

2016-10-10 Thread Jean Georges Perrin
Hi folks, I am trying to parse JSON arrays and it’s getting a little crazy (for me at least)… 1) If my JSON is: {"vals":[100,500,600,700,800,200,900,300]} I get: ++ |vals| ++ |[100, 500, 600, 7...| ++ root |-- vals: