Repository: incubator-hivemall Updated Branches: refs/heads/master fad2941fd -> 94229779c
Fixed a failing test on Spark 1.6 test Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/94229779 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/94229779 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/94229779 Branch: refs/heads/master Commit: 94229779cc9619d2c44ddc623641b5f88e0e97fb Parents: fad2941 Author: myui <[email protected]> Authored: Tue Dec 13 18:22:29 2016 +0900 Committer: myui <[email protected]> Committed: Tue Dec 13 18:22:29 2016 +0900 ---------------------------------------------------------------------- .../scala/org/apache/spark/sql/hive/HivemallOpsSuite.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/94229779/spark/spark-1.6/src/test/scala/org/apache/spark/sql/hive/HivemallOpsSuite.scala ---------------------------------------------------------------------- diff --git a/spark/spark-1.6/src/test/scala/org/apache/spark/sql/hive/HivemallOpsSuite.scala b/spark/spark-1.6/src/test/scala/org/apache/spark/sql/hive/HivemallOpsSuite.scala index 4c77f18..4ef14f6 100644 --- a/spark/spark-1.6/src/test/scala/org/apache/spark/sql/hive/HivemallOpsSuite.scala +++ b/spark/spark-1.6/src/test/scala/org/apache/spark/sql/hive/HivemallOpsSuite.scala @@ -367,12 +367,14 @@ final class HivemallOpsSuite extends HivemallQueryTest { test("tools.array - select_k_best") { import hiveContext.implicits._ + import org.apache.spark.sql.functions._ val data = Seq(Seq(0, 1, 3), Seq(2, 4, 1), Seq(5, 4, 9)) - val df = data.map(d => (d, Seq(3, 1, 2), 2)).toDF("features", "importance_list", "k") + val df = data.map(d => (d, Seq(3, 1, 2))).toDF("features", "importance_list") + val k = 2 // if use checkAnswer here, fail for some reason, maybe type? but it's okay on spark-2.0 - assert(df.select(select_k_best(df("features"), df("importance_list"), df("k"))).collect === + assert(df.select(select_k_best(df("features"), df("importance_list"), lit(k))).collect === data.map(s => Row(Seq(s(0).toDouble, s(2).toDouble)))) }
