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

stats_agg throws "DoubleOverflow" exception #803

Open
garrulus opened this issue Jun 17, 2024 · 0 comments
Open

stats_agg throws "DoubleOverflow" exception #803

garrulus opened this issue Jun 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@garrulus
Copy link

Relevant system information:

  • OS: Ubuntu 22.04
  • PostgreSQL version (output of SELECT version();): 15.6
  • TimescaleDB Toolkit version (output of \dx timescaledb_toolkit in psql): 1.18.0
  • TimescaleDB version (output of \dx timescaledb in psql): 2.14.1
  • Installation method: Docker container

Describe the bug
A "double overflow" exception is unexpectedly thrown when using stats_agg to aggregate very large input values.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new database with the timescaledb and timescaledb-toolkit extensions installed.
  2. Connect to the database using psql.
  3. Execute the SQL statement using psql: select stats_agg(n) from (values (1e308), (1e308), (1e308)) as t(n);
  4. Observe exception is thrown: "ERROR: called Result::unwrap() on an Err value: DoubleOverflow"

Expected behavior
No exception should be thrown; instead, the statssummary1d returned should indicate an error or overflow state, perhaps using NaN or null.

Actual behavior
Exception is thrown as described above in reproduction steps.

Screenshots
Not applicable.

Additional context
Throwing an exception appears to silently break automatic continuous aggregates updates; e.g. the problem was originally observed where input values that included "double max" (1.79769e+308) stopped all aggregation from occurring.

@garrulus garrulus added the bug Something isn't working label Jun 17, 2024
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