What's the best practice to parse JSON using spark

2015-09-18 Thread Cui Lin
Hello,All, Parsing JSON's nested structure is easy if using Java or Python API. Where I can find the similar way to parse JSON file using spark? Another question is by using SparkSQL, how can i easily save the results into NOSQL DB? any examples? Thanks a lot! -- Best regards! Lin,Cui

Re: What's the best practice to parse JSON using spark

2015-09-18 Thread Ted Yu
For #2, please see: examples/src/main/scala//org/apache/spark/examples/HBaseTest.scala examples/src/main/scala//org/apache/spark/examples/pythonconverters/HBaseConverters.scala In hbase, there is hbase-spark module which is being polished. Should be available in hbase 1.3.0 release. Cheers On F

Re: What's the best practice to parse JSON using spark

2015-09-18 Thread Ted Yu
For #1, see this thread: http://search-hadoop.com/m/q3RTti0Thneenne2 For #2, also see: examples//src/main/python/hbase_inputformat.py examples//src/main/python/hbase_outputformat.py Cheers On Fri, Sep 18, 2015 at 5:12 PM, Ted Yu wrote: > For #2, please see: > > examples/src/main/scala//org/apa

Re: What's the best practice to parse JSON using spark

2015-09-21 Thread Petr Novak
Internally Spark is using json4s and jackson parser v3.2.10, AFAIK. So if you are using Scala they should be available without adding dependencies. There is v3.2.11 already available but adding to my app was causing NoSuchMethod exception so I would have to shade it. I'm simply staying on v3.2.10 f

Re: What's the best practice to parse JSON using spark

2015-09-21 Thread Petr Novak
Surprisingly I had the same issue when including json4s dependency at the same version v3.2.10. I had to remove json4s deps from my code. I'm using Scala 2.11, there might be some issue with mixing 2.10/2.11 and it could be just my environment. I haven't investigated much as depending on Spark prov

Re: What's the best practice to parse JSON using spark

2015-09-21 Thread Adrian Tanase
use cases. -adrian From: Petr Novak Sent: Monday, September 21, 2015 12:11 PM To: Cui Lin; user Subject: Re: What's the best practice to parse JSON using spark Surprisingly I had the same issue when including json4s dependency at the same version v3.2.10. I had to