Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time-weighted rollup: called Result::unwrap() on an Err value: OrderError #839

Open
michael-sayapin opened this issue Jan 22, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@michael-sayapin
Copy link

michael-sayapin commented Jan 22, 2025

Relevant system information:

  • OS: Ubuntu 22.04
  • PostgreSQL version (output of SELECT version();): PostgreSQL 14.15 (Ubuntu 14.15-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
  • TimescaleDB Toolkit version (output of \dx timescaledb_toolkit in psql): 1.19.0
  • Installation method: Docker timescale/timescaledb-ha:pg14-ts2.17

Describe the bug

Time-weighted average rollup cannot rollup disjointed data.

# SELECT time_bucket('9999y', t), rollup(tw_column) FROM my_cagg GROUP BY 1;
ERROR:  called `Result::unwrap()` on an `Err` value: OrderError

I tried:

  • adding a CTE or subquery to filter tw_column IS NOT NULL
  • ordering by t in CTE / subquery

The issue can be reproduced when I have two records like this:

        t               |                                                                                 tw_column
------------------------+----------------------------------------------------------------------------------------------------
 2025-01-14 01:00:00+00 | (version:1,first:(ts:"2025-01-14 01:00:24+00",val:1),last:(ts:"2025-01-14 01:59:25+00",val:2),weighted_sum:5,method:Linear)
 2025-01-14 01:00:00+00 | (version:1,first:(ts:"2025-01-14 01:00:25+00",val:3),last:(ts:"2025-01-14 01:59:25+00",val:4),weighted_sum:7,method:Linear)

Expected behavior

Merging of two time-weighted aggregates.

@michael-sayapin michael-sayapin added the bug Something isn't working label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant