Re: Basic question. Access MongoDB data in Spark.
Anybody knows the stratio's mailing list? I cant seem to find it. Cheers On Mon, Jun 13, 2016 at 6:02 PM, Ted Yu <yuzhih...@gmail.com> wrote: > Have you considered posting the question on stratio's mailing list ? > > You may get faster response there. > > > On Mon, Jun 13, 2016 at 8:09 AM, Umair Janjua <umairjanjua...@gmail.com> > wrote: > >> Hi guys, >> >> I have this super basic problem which I cannot figure out. Can somebody >> give me a hint. >> >> http://stackoverflow.com/questions/37793214/spark-mongdb-data-using-java >> >> Cheers >> > >
Basic question. Access MongoDB data in Spark.
Hi guys, I have this super basic problem which I cannot figure out. Can somebody give me a hint. http://stackoverflow.com/questions/37793214/spark-mongdb-data-using-java Cheers
Re: Java MongoDB Spark Stratio (Please give me a hint)
The dataframe does not get any data. What could I be doing wrong here. I have rechecked the credentials and other stuff. I am still trying to debug the issue without any luck so far. On Mon, Jun 13, 2016 at 11:30 AM, Umair Janjua <umairjanjua...@gmail.com> wrote: > Any idea what I might be doing wrong. I am new to spark and I cannot > proceed forward from here: > > > > --- > JavaSparkContext sc = new JavaSparkContext("local[*]", "test > spark-mongodb java"); > SQLContext sqlContext = new SQLContext(sc); > > Map options = new HashMap(); > options.put("host", "host:port"); > options.put("database", "database"); > options.put("collection", "collectionName"); > options.put("credentials", "username,database,password"); > > System.out.println("Check1"); > > DataFrame df = > sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); > > df.registerTempTable("collectionName"); > df.show(); > -- > > On Fri, Jun 10, 2016 at 3:36 PM, Umair Janjua <umairjanjua...@gmail.com> > wrote: > >> Hi my code, >> When i run this program is gets stuck at >> sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); >> line and then it does not proceed forward. Nothing happens after that. What >> should I do? How can I debug it. I am stuck here. Please any hint would be >> appreciated. >> >> >> - >> JavaSparkContext sc = new JavaSparkContext("local[*]", "test >> spark-mongodb java"); >> SQLContext sqlContext = new SQLContext(sc); >> >> Map options = new HashMap(); >> options.put("host", "host:port"); >> options.put("database", "database"); >> options.put("collection", "collectionName"); >> options.put("credentials", "username,database,password"); >> >> System.out.println("Check1"); >> DataFrame df = >> sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); >> >> sqlContext.sql("SELECT * FROM collectionName"); >> System.out.println("Check2"); >> df.count(); >> System.out.println("Check DataFrame Count: " + df.count()); >> System.out.println("Check3"); >> df.registerTempTable("collectionName"); >> df.show(); >> >> >> - >> >> The above code only gets printed till Check1 and then it gets stuck and >> nothing happens. >> >> Cheers >> > >
Re: Java MongoDB Spark Stratio (Please give me a hint)
Any idea what I might be doing wrong. I am new to spark and I cannot proceed forward from here: --- JavaSparkContext sc = new JavaSparkContext("local[*]", "test spark-mongodb java"); SQLContext sqlContext = new SQLContext(sc); Map options = new HashMap(); options.put("host", "host:port"); options.put("database", "database"); options.put("collection", "collectionName"); options.put("credentials", "username,database,password"); System.out.println("Check1"); DataFrame df = sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); df.registerTempTable("collectionName"); df.show(); -- On Fri, Jun 10, 2016 at 3:36 PM, Umair Janjua <umairjanjua...@gmail.com> wrote: > Hi my code, > When i run this program is gets stuck at > sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); > line and then it does not proceed forward. Nothing happens after that. What > should I do? How can I debug it. I am stuck here. Please any hint would be > appreciated. > > > - > JavaSparkContext sc = new JavaSparkContext("local[*]", "test > spark-mongodb java"); > SQLContext sqlContext = new SQLContext(sc); > > Map options = new HashMap(); > options.put("host", "host:port"); > options.put("database", "database"); > options.put("collection", "collectionName"); > options.put("credentials", "username,database,password"); > > System.out.println("Check1"); > DataFrame df = > sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); > > sqlContext.sql("SELECT * FROM collectionName"); > System.out.println("Check2"); > df.count(); > System.out.println("Check DataFrame Count: " + df.count()); > System.out.println("Check3"); > df.registerTempTable("collectionName"); > df.show(); > > > - > > The above code only gets printed till Check1 and then it gets stuck and > nothing happens. > > Cheers >
Java MongoDB Spark Stratio (Please give me a hint)
Hi my code, When i run this program is gets stuck at sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); line and then it does not proceed forward. Nothing happens after that. What should I do? How can I debug it. I am stuck here. Please any hint would be appreciated. - JavaSparkContext sc = new JavaSparkContext("local[*]", "test spark-mongodb java"); SQLContext sqlContext = new SQLContext(sc); Map options = new HashMap(); options.put("host", "host:port"); options.put("database", "database"); options.put("collection", "collectionName"); options.put("credentials", "username,database,password"); System.out.println("Check1"); DataFrame df = sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load(); sqlContext.sql("SELECT * FROM collectionName"); System.out.println("Check2"); df.count(); System.out.println("Check DataFrame Count: " + df.count()); System.out.println("Check3"); df.registerTempTable("collectionName"); df.show(); - The above code only gets printed till Check1 and then it gets stuck and nothing happens. Cheers