Skip to content

[7.x] SQL: Mute pivot testAverageWithOneValueAndOrder and testSumWith… #47033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
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
53 changes: 27 additions & 26 deletions x-pack/plugin/sql/qa/src/main/resources/pivot.csv-spec
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,18 @@ null |48396.28571428572|62140.666666666664
1 |49767.22222222222|47073.25
;

averageWithOneValueAndOrder
schema::languages:bt|'F':d
SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary) FOR gender IN ('F')) ORDER BY languages DESC LIMIT 4;

languages | 'F'
---------------+------------------
5 |46705.555555555555
4 |49291.5
3 |53660.0
2 |50684.4
;
// AwaitsFix https://github.com/elastic/elasticsearch/issues/47002
// averageWithOneValueAndOrder
// schema::languages:bt|'F':d
// SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary) FOR gender IN ('F')) ORDER BY languages DESC LIMIT 4;
//
// languages | 'F'
// ---------------+------------------
// 5 |46705.555555555555
// 4 |49291.5
// 3 |53660.0
// 2 |50684.4
// ;

averageWithTwoValuesAndOrderDesc
schema::languages:bt|'M':d|'F':d
Expand Down Expand Up @@ -170,26 +171,26 @@ SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary
---------------+-----------------+------------------
null |48396.28571428572|62140.666666666664
1 |49767.22222222222|47073.25
2 |44103.90909090909|50684.4
2 |44103.90909090909|50684.4
3 |51741.90909090909|53660.0
4 |47058.90909090909|49291.5
5 |39052.875 |46705.555555555555
;


sumWithoutSubquery
schema::birth_date:ts|emp_no:i|first_name:s|gender:s|hire_date:ts|last_name:s|1:i|2:i
SELECT * FROM test_emp PIVOT (SUM(salary) FOR languages IN (1, 2)) LIMIT 5;

birth_date | emp_no | first_name | gender | hire_date | last_name | 1 | 2
---------------------+---------------+---------------+---------------+---------------------+---------------+---------------+---------------
null |10041 |Uri |F |1989-11-12 00:00:00.0|Lenart |56415 |null
null |10043 |Yishay |M |1990-10-20 00:00:00.0|Tzvieli |34341 |null
null |10044 |Mingsen |F |1994-05-21 00:00:00.0|Casley |39728 |null
1952-04-19 00:00:00.0|10009 |Sumant |F |1985-02-18 00:00:00.0|Peac |66174 |null
1953-01-07 00:00:00.0|10067 |Claudi |M |1987-03-04 00:00:00.0|Stavenow |null |52044
1953-01-23 00:00:00.0|10019 |Lillian |null |1999-04-30 00:00:00.0|Haddadi |73717 |null
;
// AwaitsFix https://github.com/elastic/elasticsearch/issues/47002
// sumWithoutSubquery
// schema::birth_date:ts|emp_no:i|first_name:s|gender:s|hire_date:ts|last_name:s|1:i|2:i
// SELECT * FROM test_emp PIVOT (SUM(salary) FOR languages IN (1, 2)) LIMIT 5;
//
// birth_date | emp_no | first_name | gender | hire_date | last_name | 1 | 2
// ---------------------+---------------+---------------+---------------+---------------------+---------------+---------------+---------------
// null |10041 |Uri |F |1989-11-12 00:00:00.0|Lenart |56415 |null
// null |10043 |Yishay |M |1990-10-20 00:00:00.0|Tzvieli |34341 |null
// null |10044 |Mingsen |F |1994-05-21 00:00:00.0|Casley |39728 |null
// 1952-04-19 00:00:00.0|10009 |Sumant |F |1985-02-18 00:00:00.0|Peac |66174 |null
// 1953-01-07 00:00:00.0|10067 |Claudi |M |1987-03-04 00:00:00.0|Stavenow |null |52044
// 1953-01-23 00:00:00.0|10019 |Lillian |null |1999-04-30 00:00:00.0|Haddadi |73717 |null
// ;

averageWithOneValueAndMath
schema::languages:bt|'F':d
Expand Down