Skip to content
Snippets Groups Projects
Commit 7c79ef7d authored by Andrew Or's avatar Andrew Or Committed by Reynold Xin
Browse files

[Minor] Move JdbcRDDSuite to the correct package

It was in the wrong package

Author: Andrew Or <andrewor14@gmail.com>

Closes #839 from andrewor14/jdbc-suite and squashes the following commits:

f948c5a [Andrew Or] cache -> cache()
b215279 [Andrew Or] Move JdbcRDDSuite to the correct package
parent 1014668f
No related branches found
No related tags found
No related merge requests found
......@@ -15,13 +15,13 @@
* limitations under the License.
*/
package org.apache.spark
package org.apache.spark.rdd
import java.sql._
import org.scalatest.{BeforeAndAfter, FunSuite}
import org.apache.spark.rdd.JdbcRDD
import org.apache.spark.{LocalSparkContext, SparkContext}
class JdbcRDDSuite extends FunSuite with BeforeAndAfter with LocalSparkContext {
......@@ -35,18 +35,18 @@ class JdbcRDDSuite extends FunSuite with BeforeAndAfter with LocalSparkContext {
ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
DATA INTEGER
)""")
create.close
create.close()
val insert = conn.prepareStatement("INSERT INTO FOO(DATA) VALUES(?)")
(1 to 100).foreach { i =>
insert.setInt(1, i * 2)
insert.executeUpdate
}
insert.close
insert.close()
} catch {
case e: SQLException if e.getSQLState == "X0Y32" =>
// table exists
} finally {
conn.close
conn.close()
}
}
......@@ -57,7 +57,7 @@ class JdbcRDDSuite extends FunSuite with BeforeAndAfter with LocalSparkContext {
() => { DriverManager.getConnection("jdbc:derby:target/JdbcRDDSuiteDb") },
"SELECT DATA FROM FOO WHERE ? <= ID AND ID <= ?",
1, 100, 3,
(r: ResultSet) => { r.getInt(1) } ).cache
(r: ResultSet) => { r.getInt(1) } ).cache()
assert(rdd.count === 100)
assert(rdd.reduce(_+_) === 10100)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment