-
Notifications
You must be signed in to change notification settings - Fork 1.6k
SAMPLE BY FILL crashes with array column aggregates #6810
Copy link
Copy link
Closed
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution
Description
To reproduce
Queries that combine array aggregate functions (last, first, last_not_null) with SAMPLE BY FILL(NULL) or SAMPLE BY FILL(value) crash with an UnsupportedOperationException:
-- crashes
SELECT last(arr) FROM t SAMPLE BY 1h FILL(NULL)
-- also crashes
SELECT last(arr) FROM t SAMPLE BY 1h FILL(42)
FILL(NONE), FILL(PREV), and FILL(LINEAR) are not affected.
Reproduction
On demo box you can do
select timestamp, last(bids) from market_data
where timestamp in '$now-1m..$now'
sample by 10s FILL(null)
Or locally
CREATE TABLE t (ts TIMESTAMP, arr DOUBLE[]) TIMESTAMP(ts) PARTITION BY DAY;
INSERT INTO t VALUES
('1970-01-01T00:00:00.000000Z', ARRAY[1.0, 2.0]),
('1970-01-01T00:00:20.000000Z', ARRAY[3.0, 4.0]);
-- this crashes with UnsupportedOperationException at Record.getArray()
SELECT ts, last(arr) FROM t SAMPLE BY 10s FILL(NULL);
Expected behavior
- FILL(NULL) should produce null arrays in gap buckets
- FILL(value) should produce null arrays in gap buckets, since arrays cannot be filled with scalar values
QuestDB version:
9.3.2
OS, in case of Docker specify Docker and the Host OS:
both ubuntu and osx
File System, in case of Docker specify Host File System:
ext4
Full Name:
javier
Affiliation:
questdb
Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?
- Yes, I have
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution