Skip to content

SAMPLE BY FILL crashes with array column aggregates #6810

@javier

Description

@javier

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

Metadata

Metadata

Assignees

Labels

BugIncorrect or unexpected behaviorSQLIssues or changes relating to SQL execution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions