From e83ab30f181cef7d1703a259a73c9302214fb538 Mon Sep 17 00:00:00 2001 From: Larry Luo Date: Wed, 20 Jul 2022 14:18:03 -0400 Subject: [PATCH] Added sorting test cases --- .../0_stateless/02366_kql_tabular.reference | 51 ++++++++++++++---- .../queries/0_stateless/02366_kql_tabular.sql | 53 ++++++++----------- 2 files changed, 62 insertions(+), 42 deletions(-) diff --git a/tests/queries/0_stateless/02366_kql_tabular.reference b/tests/queries/0_stateless/02366_kql_tabular.reference index 6fd5af9b60a..fa9ea03a9c0 100644 --- a/tests/queries/0_stateless/02366_kql_tabular.reference +++ b/tests/queries/0_stateless/02366_kql_tabular.reference @@ -49,6 +49,46 @@ Peter Nara Theodore Diaz Bachelors Stephanie Cox Bachelors Peter Nara Graduate Degree +-- Query with desc sort -- +Theodore +Stephanie +Peter +Latoya +Joshua +Skilled Manual +Skilled Manual +Skilled Manual +Skilled Manual +Professional +-- Query with asc sort -- +Management +Professional +Professional +Professional +Professional +-- Query with sort (without keyword asc desc) -- +Theodore +Stephanie +Peter +Latoya +Joshua +Skilled Manual +Skilled Manual +Skilled Manual +Skilled Manual +Professional +-- Query with sort 2 Columns with different direction -- +Stephanie Cox Management +Dalton Wood Professional +Angel Stewart Professional +Latoya Shen Professional +Cameron Rodriguez Professional +-- Query with second sort -- +Stephanie Cox Management +Dalton Wood Professional +Angel Stewart Professional +Latoya Shen Professional +Cameron Rodriguez Professional -- Test String Equals (==) -- Theodore Diaz Skilled Manual Peter Nara Skilled Manual @@ -98,14 +138,3 @@ Christine Nara Skilled Manual Partial College 33 -- Test Filter using multi where -- Dalton Wood Professional Partial College 42 Angel Stewart Professional Partial College 46 --- test sort, order -- -Angel Stewart Professional Partial College 46 -Dalton Wood Professional Partial College 42 -Edward Hernandez Skilled Manual High School 36 -Christine Nara Skilled Manual Partial College 33 -Stephanie Cox Management Bachelors 33 -Cameron Rodriguez Professional Partial College 28 -Theodore Diaz Skilled Manual Bachelors 28 -Joshua Lee Professional Partial College 26 -Peter Nara Skilled Manual Graduate Degree 26 -Latoya Shen Professional Graduate Degree 25 diff --git a/tests/queries/0_stateless/02366_kql_tabular.sql b/tests/queries/0_stateless/02366_kql_tabular.sql index 3f16e63567b..6a0a3417f42 100644 --- a/tests/queries/0_stateless/02366_kql_tabular.sql +++ b/tests/queries/0_stateless/02366_kql_tabular.sql @@ -46,33 +46,32 @@ Select '-- Query has second Column selection with extra column --'; set dialect='kusto'; Customers| project FirstName,LastName,Occupation | take 3 | project FirstName,LastName,Education; --- set dialect='clickhouse'; --- Select '-- Query with desc sort --'; --- set dialect='kusto'; --- Customers | project FirstName,LastName,Occupation | take 5 | sort by FirstName desc; --- Customers | project FirstName,LastName,Occupation | take 5 | order by Occupation desc; +set dialect='clickhouse'; +Select '-- Query with desc sort --'; +set dialect='kusto'; +Customers | project FirstName | take 5 | sort by FirstName desc; +Customers | project Occupation | take 5 | order by Occupation desc; --- set dialect='clickhouse'; --- Select '-- Query with asc sort --'; --- set dialect='kusto'; --- Customers | project FirstName,LastName,Occupation | take 5 | sort by Occupation asc; +set dialect='clickhouse'; +Select '-- Query with asc sort --'; +set dialect='kusto'; +Customers | project Occupation | take 5 | sort by Occupation asc; --- set dialect='clickhouse'; --- Select '-- Query with sort (without keyword asc desc) --'; --- set dialect='kusto'; --- Customers | project FirstName,LastName,Occupation | take 5 | sort by FirstName; --- Customers | project FirstName,LastName,Occupation | take 5 | order by Occupation; +set dialect='clickhouse'; +Select '-- Query with sort (without keyword asc desc) --'; +set dialect='kusto'; +Customers | project FirstName | take 5 | sort by FirstName; +Customers | project Occupation | take 5 | order by Occupation; --- set dialect='clickhouse'; --- Select '-- Query with sort 2 Columns with different direction --'; --- set dialect='kusto'; --- Customers | project FirstName,LastName,Occupation | take 5 |sort by Occupation asc, LastName desc; - --- set dialect='clickhouse'; --- Select '-- Query with second sort --'; --- set dialect='kusto'; --- Customers | project FirstName,LastName,Occupation | take 5 |sort by Occupation desc |sort by Occupation asc; +set dialect='clickhouse'; +Select '-- Query with sort 2 Columns with different direction --'; +set dialect='kusto'; +Customers | project FirstName,LastName,Occupation | take 5 | sort by Occupation asc, LastName desc; +set dialect='clickhouse'; +Select '-- Query with second sort --'; +set dialect='kusto'; +Customers | project FirstName,LastName,Occupation | take 5 | sort by Occupation desc |sort by Occupation asc, LastName desc; set dialect='clickhouse'; Select '-- Test String Equals (==) --'; @@ -119,15 +118,7 @@ Select '-- Test Filter using numerical great and less (> , <) --'; set dialect='kusto'; Customers | project FirstName,LastName,Occupation,Education,Age | where Age > 30 and Age < 40; - set dialect='clickhouse'; Select '-- Test Filter using multi where --'; set dialect='kusto'; Customers | project FirstName,LastName,Occupation,Education,Age | where Age > 30 | where Occupation == 'Professional'; - --- TODO: verify the issue that order by can not be followed by other statements -set dialect='clickhouse'; -Select '-- test sort, order --'; -set dialect='kusto'; -Customers | order by Age desc, FirstName asc; -