Skip to content

Commit

Permalink
Tentatively restore percentile rank expected results.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrik-es committed Jun 10, 2023
1 parent b8f7c00 commit 7718dbb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions x-pack/plugin/sql/qa/server/src/main/resources/agg.csv-spec
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ SELECT MAX(languages) max, MIN(languages) min, SUM(languages) sum, AVG(languages
null |null |null |null |null |null |null |null
1 |1 |15 |1 |1.0 |100.0 |NaN |NaN
2 |2 |38 |2 |2.0 |100.0 |NaN |NaN
3 |3 |51 |3 |3.0 |100.0 |NaN |NaN
3 |3 |51 |3 |3.0 |50.0 |NaN |NaN
4 |4 |72 |4 |4.0 |0.0 |NaN |NaN
;

Expand Down Expand Up @@ -1208,9 +1208,9 @@ GROUP BY gender ORDER BY gender;

percentile | percentile_rank | gender
-----------------+------------------+---------------
86857.79999999999|32.69659025378865 |null
86857.79999999999|30.0 |null
94042.92000000001|37.03569653103581 |F
87348.36 |44.337514210592246|M
87348.36 |45.614035087719294|M
;

extendedStatsAggregateFunctionsWithScalars
Expand Down Expand Up @@ -1497,7 +1497,7 @@ SELECT PERCENTILE_RANK(bytes_in, 0) as "PERCENTILE_RANK_AllZeros" FROM logs WHER

PERCENTILE_RANK_AllZeros
------------------------
100.0
50.0
;


Expand Down
40 changes: 20 additions & 20 deletions x-pack/plugin/sql/qa/server/src/main/resources/docs/docs.csv-spec
Original file line number Diff line number Diff line change
Expand Up @@ -1514,12 +1514,12 @@ SELECT languages, PERCENTILE(salary, 95) AS "95th" FROM emp

languages | 95th
---------------+-----------------
null |74482.4
1 |71122.8
2 |70271.4
3 |71926.0
4 |69352.15
5 |56371.0
null |74999.0
1 |72790.5
2 |71924.70000000001
3 |73638.25
4 |72115.59999999999
5 |61071.7
// end::aggPercentile
;

Expand All @@ -1531,12 +1531,12 @@ SELECT languages, PERCENTILE(salary / 12.0, 95) AS "95th" FROM emp

languages | 95th
---------------+------------------
null |6206.866666666667
1 |5926.9
2 |5855.949999999999
3 |5993.833333333333
4 |5779.345833333333
5 |4697.583333333333
null |6249.916666666667
1 |6065.875
2 |5993.725
3 |6136.520833333332
4 |6009.633333333332
5 |5089.3083333333325
// end::aggPercentileScalars
;

Expand All @@ -1549,14 +1549,14 @@ SELECT
FROM emp
GROUP BY languages;

languages | 97.3_TDigest | 97.3_HDR
---------------+-----------------+---------------
null |74720.036 |74992.0
1 |72316.132 |73712.0
2 |71792.436 |69936.0
3 |73326.23999999999|74992.0
4 |71753.281 |74608.0
5 |61176.16000000001|56368.0
languages | 97.3_TDigest | 97.3_HDR
---------------+---------------+---------------
null |74999.0 |74992.0
1 |73717.0 |73712.0
2 |73530.238 |69936.0
3 |74970.0 |74992.0
4 |74572.0 |74608.0
5 |66117.118 |56368.0
// end::aggPercentileWithPercentileConfig
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ SELECT languages, PERCENTILE(salary, 95) "95th", ROUND(PERCENTILE_RANK(salary, 6

languages:bt | 95th:d | rank:d | MAX(salary):i | MIN(salary):i | c:l
---------------+---------------+---------------+---------------+---------------+---------------
null |74999 |74 |74999 |28336 |10
null |74999 |80 |74999 |28336 |10
2 |44307 |100 |44307 |29175 |3
3 |65030 |100 |65030 |38376 |4
5 |66817 |100 |66817 |37137 |4
3 |65030 |75 |65030 |38376 |4
5 |66817 |75 |66817 |37137 |4
;

multiAggWithStatsAndMatrixStatsAndMultiQuery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SELECT gender, PERCENTILE(emp_no, 92.45) p1 FROM FROZEN frozen_emp GROUP BY gend

gender:s | p1:d
null |10018.745
F |10096.336
F |10098.0085
M |10091.393
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ GROUP BY gender ORDER BY gender;

percentile | percentile_rank | gender
-----------------+------------------+---------------
86857.79999999999|32.69659025378865 |null
86857.79999999999|30.00000000000000 |null
94042.92000000001|37.03569653103581 |F
87348.36 |44.337514210592246|M
87348.36 |45.614035087719294|M
;

extendedStatsAggregateFunctionsWithScalars
Expand Down Expand Up @@ -567,7 +567,7 @@ ORDER BY status;

percentile:d | percentile_rank:d | status:s
---------------------+-------------------+---------------
1.8836190713044468E19|1.970336796004502 |Error
1.8836190713044468E19|0.0 |Error
1.7957483822449326E19|26.644793296251386 |OK
;

Expand Down

0 comments on commit 7718dbb

Please sign in to comment.