forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from ClibMouse/Kusto-p3-disable-extra--word-f…
…or-sort Kusto-phase3 : fix sort issues
- Loading branch information
Showing
8 changed files
with
412 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#include <Parsers/tests/gtest_common.h> | ||
|
||
#include <Parsers/Kusto/ParserKQLQuery.h> | ||
|
||
INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_Sort, ParserTest, | ||
::testing::Combine( | ||
::testing::Values(std::make_shared<DB::ParserKQLQuery>()), | ||
::testing::ValuesIn(std::initializer_list<ParserTestCase>{ | ||
{ | ||
"Customers | order by FirstName", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName asc", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName ASC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName desc", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName asc nulls first", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName ASC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName asc nulls last", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName ASC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName desc nulls first", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName DESC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName desc nulls last", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName nulls first", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName DESC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName nulls last", | ||
"SELECT *\nFROM Customers\nORDER BY FirstName DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName, Age", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName DESC NULLS LAST,\n Age DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName asc, Age desc", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName ASC NULLS FIRST,\n Age DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName desc, Age asc", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName DESC NULLS LAST,\n Age ASC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName asc nulls first, Age asc nulls first", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName ASC NULLS FIRST,\n Age ASC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName asc nulls last, Age asc nulls last", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName ASC NULLS LAST,\n Age ASC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName desc nulls first, Age desc nulls first", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName DESC NULLS FIRST,\n Age DESC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName desc nulls last, Age desc nulls last", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName DESC NULLS LAST,\n Age DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName nulls first, Age nulls first", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName DESC NULLS FIRST,\n Age DESC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName nulls last, Age nulls last", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName DESC NULLS LAST,\n Age DESC NULLS LAST" | ||
}, | ||
{ | ||
"Customers | order by FirstName, Age asc nulls last, LastName nulls first", | ||
"SELECT *\nFROM Customers\nORDER BY\n FirstName DESC NULLS LAST,\n Age ASC NULLS LAST,\n LastName DESC NULLS FIRST" | ||
}, | ||
{ | ||
"Customers | order by FirstName ASC", | ||
"throws" | ||
}, | ||
{ | ||
"Customers | order by FirstName DESC", | ||
"throws" | ||
}, | ||
{ | ||
"Customers | order by FirstName nulls", | ||
"throws" | ||
}, | ||
{ | ||
"Customers | order by FirstName nulls middle", | ||
"throws" | ||
}, | ||
{ | ||
"Customers | order by FirstName asc desc", | ||
"throws" | ||
}, | ||
{ | ||
"Customers | order by FirstName nulls first desc", | ||
"throws" | ||
} | ||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.