Skip to content

Commit

Permalink
Put the input file to the resource folder
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Sep 17, 2020
1 parent accb825 commit 690db25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,22 @@ class ApproximatePercentileQuerySuite extends QueryTest with SharedSparkSession
assert(buffer.isCompressed)
}

test("SPARK-XXXXX: ") {
test("SPARK-32908: maximum target error in percentile_approx") {
withTempView(table) {
val df = spark.read.option("header", "true")
.option("inferSchema", "true")
.csv("/Users/maximgekk/tmp/tr_rat_resampling_score.csv")
spark.read
.schema("col int")
.csv(testFile("percentile_approx-input.csv.bz2"))
.repartition(1)
df.createOrReplaceTempView(table)
.createOrReplaceTempView(table)
checkAnswer(
spark.sql(
s"""SELECT
| percentile_approx(tr_rat_resampling_score, 0.77, 100000)
|FROM $table
""".stripMargin),
Row(17))
| percentile_approx(col, 0.77, 1000),
| percentile_approx(col, 0.77, 10000),
| percentile_approx(col, 0.77, 100000),
| percentile_approx(col, 0.77, 1000000)
|FROM $table""".stripMargin),
Row(18, 17, 17, 17))
}
}
}

0 comments on commit 690db25

Please sign in to comment.