arcadedb
arcadedb copied to clipboard
SQL: aggregate functions with single argument not processing modifiers
ArcadeDB Server v23.3.1 (build da609e411ccf28afeab01015ad6c2ecca1dadb3d/1680693032550/main)
Running on Mac OS X 12.6.4 - OpenJDK 64-Bit Server VM Homebrew
The results of aggregate functions with a single argument (either literal or type) do not handle modifiers. It works as expected when using two arguments.
Expected behavior
LIST
1
INTEGER
INTEGER
Actual behavior
[1,2,3,4]
[1,2,3,4]
10
4
Steps to reproduce
CREATE DOCUMENT TYPE doc;
INSERT INTO doc (num) VALUES (1), (2), (3), (4);
SELECT unionall(num).type() FROM doc;
SELECT unionall(num)[0] FROM doc;
SELECT sum(num).type() FROM doc;
SELECT max(num).type() FROM doc;
I tried looking into a selection of aggregating SQL functions to look for a pattern, but I couldn't find any explaining this error definitely. Here are my findings:
-
sum(execute) returns anObjectholding a:- Single parameter:
Number - Multiple parameters:
Number
- Single parameter:
-
max(execute) returns anObjectholding a:- Single parameter:
Object - Multiple parameters:
Object
- Single parameter:
-
unionAll(execute) returns anObjectholding a:- Single parameter:
ArrayList<Object> - Multiple parameters:
MultiIterator<>
- Single parameter:
Reproduced.