mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
make_list_with_nulls_bug1009 fix
This commit is contained in:
parent
49ce24a451
commit
6fa32e3108
@ -654,7 +654,7 @@ https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/make-seriesoper
|
||||
`Customers | summarize t = make_list_if(FirstName, Age > 10) by FirstName`
|
||||
`Customers | summarize t = make_list_if(FirstName, Age > 10, 10) by FirstName`
|
||||
- [make_list_with_nulls()](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/make-list-with-nulls-aggfunction)
|
||||
`Customers | summarize t = make_list_with_nulls(FirstName) by FirstName`
|
||||
`Customers | summarize t = make_list_with_nulls(Age) by FirstName`
|
||||
- [make_set()](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/makeset-aggfunction)
|
||||
`Customers | summarize t = make_set(FirstName) by FirstName`
|
||||
`Customers | summarize t = make_set(FirstName, 10) by FirstName`
|
||||
|
@ -152,7 +152,14 @@ bool MakeListIf::convertImpl(String & out,IParser::Pos & pos)
|
||||
|
||||
bool MakeListWithNulls::convertImpl(String & out,IParser::Pos & pos)
|
||||
{
|
||||
return directMapping(out,pos,"groupArray");
|
||||
String fn_name = getKQLFunctionName(pos);
|
||||
|
||||
if (fn_name.empty())
|
||||
return false;
|
||||
++pos;
|
||||
const auto column_name = getConvertedArgument(fn_name,pos);
|
||||
out = "arrayConcat(groupArray(" + column_name + ") AS ga, arrayMap(x -> null, range(0, toUInt32(count(*)-length(ga)),1)))";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MakeSet::convertImpl(String & out,IParser::Pos & pos)
|
||||
|
@ -53,5 +53,9 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery, ParserTest,
|
||||
{
|
||||
"DataTable | summarize t = percentilew(Bucket, Frequency, 50)",
|
||||
"SELECT quantileExactWeighted(50 / 100)(Bucket, Frequency) AS t\nFROM DataTable"
|
||||
},
|
||||
{
|
||||
"Customers | summarize t = make_list_with_nulls(Age) by FirstName",
|
||||
"SELECT\n FirstName,\n arrayConcat(groupArray(Age) AS ga, arrayMap(x -> NULL, range(0, toUInt32(count(*) - length(ga)), 1))) AS t\nFROM Customers\nGROUP BY FirstName"
|
||||
}
|
||||
})));
|
||||
|
Loading…
Reference in New Issue
Block a user