Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
scwf committed Nov 7, 2014
1 parent f64eddf commit 8b2d845
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,27 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
assert(resultSet.getString(1) === s"spark.sql.hive.version=${HiveShim.version}")
}
}

test("SPARK-4292 regression: result set iterator issue") {
withJdbcStatement() { statement =>
val dataFilePath =
Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt")

val queries = Seq(
"DROP TABLE IF EXISTS test_4292",
"CREATE TABLE test_4292(key INT, val STRING)",
s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE test_4292")

queries.foreach(statement.execute)

val resultSet = statement.executeQuery("SELECT key FROM test_4292")

Seq(238, 86, 311, 27, 165).foreach { key =>
resultSet.next()
assert(resultSet.getInt(1) == key)
}

statement.executeQuery("DROP TABLE IF EXISTS test_4292")
}
}
}

0 comments on commit 8b2d845

Please sign in to comment.