RE: Data from Mysql using JdbcRDD

2014-08-04 Thread chutium
have a look on this commit: https://github.com/apache/spark/pull/1612/files#diff-0 try this: -stmt.setLong(1, part.lower) -stmt.setLong(2, part.upper) +val parameterCount = stmt.getParameterMetaData.getParameterCount +if (parameterCount > 0) stmt.setLong(1, part.lower) +i

RE: Data from Mysql using JdbcRDD

2014-08-01 Thread srinivas
Hi Thanks Alli have few more questions on this suppose i don't want to pass where caluse in my sql and is their a way that i can do this. Right now i am trying to modify JdbcRDD class by removing all the paramaters for lower bound and upper bound. But i am getting run time exceptions. Is thei

RE: Data from Mysql using JdbcRDD

2014-07-30 Thread Cheng, Hao
Probably you need to update the SQL like "SELECT * FROM student_info where id >= ? and id <= ?". -Original Message- From: srinivas [mailto:kusamsrini...@gmail.com] Sent: Thursday, July 31, 2014 6:55 AM To: u...@spark.incubator.apache.org Subject: Data from Mysql using JdbcRDD Hi, I am

Re: Data from Mysql using JdbcRDD

2014-07-30 Thread Josh Mahonin
Hi Srini, I believe the JdbcRDD requires input splits based on ranges within the query itself. As an example, you could adjust your query to something like: SELECT * FROM student_info WHERE id >= ? AND id <= ? Note that the values you've passed in '1, 20, 2' correspond to the lower bound index, u

Re: Data from Mysql using JdbcRDD

2014-07-30 Thread chaitu reddy
Kc On Jul 30, 2014 3:55 PM, "srinivas" wrote: > Hi, > I am trying to get data from mysql using JdbcRDD using code The table have > three columns > > val url = "jdbc:mysql://localhost:3306/studentdata" > val username = "root" > val password = "root" > val mysqlrdd = new org.apache.sp