From 327d268673b70574f232003ed4977fbcaa4b9e9f Mon Sep 17 00:00:00 2001 From: Marios Trivyzas Date: Thu, 16 Apr 2020 16:41:54 +0200 Subject: [PATCH] SQL: [Test] Add test for a fixed bug for string scalars on aggs (#55304) (#55309) Added an integration test to validate behaviour of string scalars on top of aggregate functions. The behaviour was fixed with #49570. Relates to: #41597 (cherry picked from commit 35f964154850e3f02b6c7f9ca238da98ad83ebb3) --- x-pack/plugin/sql/qa/src/main/resources/agg.csv-spec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/x-pack/plugin/sql/qa/src/main/resources/agg.csv-spec b/x-pack/plugin/sql/qa/src/main/resources/agg.csv-spec index 9c23a832ec8..3cd32d232be 100644 --- a/x-pack/plugin/sql/qa/src/main/resources/agg.csv-spec +++ b/x-pack/plugin/sql/qa/src/main/resources/agg.csv-spec @@ -435,6 +435,17 @@ null |5.1415926535 null |4.1415926535 ; +aggregateWithStringScalars +schema::gender:s|avg:s +SELECT gender, REPLACE(CONVERT(AVG(salary), text), '.', ',') as "avg" +FROM test_emp WHERE languages IS NOT NULL AND birth_date IS NOT NULL GROUP BY gender ORDER BY gender LIMIT 2; + + gender | avg +---------------+--------------- +null |48760,5 +F |51130,48 +; + // // Grouping functions //