Skip to content

Commit

Permalink
Fix CMS test
Browse files Browse the repository at this point in the history
  • Loading branch information
hvanhovell committed Nov 30, 2016
1 parent 3ba68de commit 5f8e3d0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ class CountMinSketchAggQuerySuite extends QueryTest with SharedSQLContext {
withTempView(table) {
val rdd: RDD[Row] = spark.sparkContext.parallelize(data)
spark.createDataFrame(rdd, schema).createOrReplaceTempView(table)
val cmsSql = schema.fieldNames.map(col => s"count_min_sketch($col, $eps, $confidence, $seed)")
.mkString(", ")
val result = sql(s"SELECT $cmsSql FROM $table").head()

val cmsSql = schema.fieldNames.map { col =>
s"count_min_sketch($col, ${eps}D, ${confidence}D, $seed)"
}
val result = sql(s"SELECT ${cmsSql.mkString(", ")} FROM $table").head()
schema.indices.foreach { i =>
val binaryData = result.getAs[Array[Byte]](i)
val in = new ByteArrayInputStream(binaryData)
Expand Down

0 comments on commit 5f8e3d0

Please sign in to comment.