Re: Finding most occurrences in a JSON Nested Array

2015-01-16 Thread adstan
Hi Pankaj, I have another related problem... given the following data: I want to find the top 3 locations where the employees' certifications are obtained (ignoring the fact that geospatial comparison are more than just equality). I tried the earlier approach, the challenge is the location field

Re: Finding most occurrences in a JSON Nested Array

2015-01-06 Thread adstan
Many thanks Pankaj, I've got it working. For completeness, here's the whole segment (including the printout at diff stages): -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Finding-most-occurrences-in-a-JSON-Nested-Array-tp20971p20996.html Sent from the Ap

Re: Finding most occurrences in a JSON Nested Array

2015-01-05 Thread adstan
I did try this earlier before, but I’ve got an error that I couldn’t comprehend: scala> var hobbies = results.flatMap(row => row(1)) :16: error: type mismatch; found : Any required: TraversableOnce[?] var hobbies = results.flatMap(row => row(1)) I must be missing something, perhaps a

Finding most occurrences in a JSON Nested Array

2015-01-05 Thread adstan
Hi, I'm pretty new to both Spark (and Scala), so I would like to seek some help here: I have this dataset in JSON: In short, I'm trying to find out the top 10 hobbies, sorted DESC by count. So basically i did: Prints... This is where I got stucked... I tried and got: What do I do with an Arr