diff --git a/langlib/lang.query/src/main/ballerina/types.bal b/langlib/lang.query/src/main/ballerina/types.bal index 831969bbe5cd..781945702112 100644 --- a/langlib/lang.query/src/main/ballerina/types.bal +++ b/langlib/lang.query/src/main/ballerina/types.bal @@ -674,9 +674,9 @@ class _GroupByFunction { } private function getKey(_Frame f) returns anydata|error { - anydata[] keys = []; + record{} keys = {}; foreach var key in self.keys { - keys.push( check f[key]); + keys[key] = check f[key]; } return keys; }