Restore filter argument

This commit is contained in:
nagamocha3000 2021-02-26 22:44:36 +03:00 • committed by Matt Jaffee
parent 66d12f88e2
commit 832c6f1a71
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

View file

@ -6894,16 +6894,13 @@ func variousQueriesOnPercentiles(t *testing.T, clusterSize int) {
rowKey: rowKeys[r.Uint64()%2], // flip a coin
}
}
r.Shuffle(len(testValues), func(i, j int) {
testValues[i], testValues[j] = testValues[j], testValues[i]
})
// filter out nums that fulfil predicate
var nums []int64
for _, v := range testValues {
// if v.rowKey == "foo" {
nums = append(nums, v.num)
// }
if v.rowKey == "foo" {
nums = append(nums, v.num)
}
}
// get min and max for calculating both expected median
@ -6999,7 +6996,7 @@ func variousQueriesOnPercentiles(t *testing.T, clusterSize int) {
nths := []float64{0.1, 0.25, 0.5, 0.75, 0.9, 0.99}
var tests []testCase
for _, nth := range nths {
query := fmt.Sprintf(`Percentile(field="net_worth", nth=%f)`, nth)
query := fmt.Sprintf(`Percentile(field="net_worth", filter=Row(val="foo"), nth=%f)`, nth)
expectedPercentile := getExpectedPercentile(nums, nth)
tests = append(tests, testCase{
query: query,