Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address comments
  • Loading branch information
clockfly committed Aug 30, 2016
commit 1965b1a918633f0d9b94b0a245605592cddbeb9b
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import org.apache.spark.sql.types._
*
* @param child child expression that can produce column value with `child.eval(inputRow)`
* @param percentageExpression Expression that represents a single percentage value or
* a array of percentage values. Each percentage value must be between
* an array of percentage values. Each percentage value must be between
* 0.0 and 1.0.
* @param accuracyExpression Integer literal expression of approximation accuracy. Higher value
* yields better accuracy, the default value is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class ApproximatePercentileSuite extends SparkFunSuite {
val defaultAccuracy = ApproximatePercentile.DEFAULT_PERCENTILE_ACCURACY
// sql, single percentile
assertEqual(
"percentile_approx(`a`, 0.5D, 1000)",
s"percentile_approx(`a`, 0.5D, $defaultAccuracy)",
new ApproximatePercentile("a".attr, percentageExpression = Literal(0.5D)).sql: String)

// sql, array of percentile
Expand All @@ -183,7 +183,7 @@ class ApproximatePercentileSuite extends SparkFunSuite {

// sql(isDistinct = false), single percentile
assertEqual(
"percentile_approx(`a`, 0.5D, 1000)",
s"percentile_approx(`a`, 0.5D, $defaultAccuracy)",
new ApproximatePercentile("a".attr, percentageExpression = Literal(0.5D))
.sql(isDistinct = false))

Expand All @@ -197,7 +197,7 @@ class ApproximatePercentileSuite extends SparkFunSuite {

// sql(isDistinct = true), single percentile
assertEqual(
"percentile_approx(DISTINCT `a`, 0.5D, 1000)",
s"percentile_approx(DISTINCT `a`, 0.5D, $defaultAccuracy)",
new ApproximatePercentile("a".attr, percentageExpression = Literal(0.5D))
.sql(isDistinct = true))

Expand Down