Skip to content

Conversation

@sgrebnov
Copy link

@sgrebnov sgrebnov commented Sep 27, 2024

Which issue does this PR close?

PR fixes Postgres unparsing "Query Error function round(double precision, integer) does not exist" error by enforcing NUMERIC data type for round scalar function as Postgres does not support Float arguments and requires NUMERIC.

https://www.postgresql.org/docs/17/functions-math.html

round ( v numeric, s integer ) → numeric
Rounds v to s decimal places. Ties are broken by rounding away from zero.
round(42.4382, 2) → 42.44
round(1234.56, -1) → 1230

Closes spiceai/spiceai#2844

@sgrebnov sgrebnov changed the title Postgres: enforce NUMERIC data type for round scalar function Postgres: enforce required NUMERIC type for round scalar function Sep 27, 2024
@sgrebnov sgrebnov force-pushed the sgrebnov/fix-pg-round-unparsing branch from cde4135 to 9e1bd7d Compare September 27, 2024 17:18
@sgrebnov sgrebnov self-assigned this Sep 29, 2024
@sgrebnov sgrebnov marked this pull request as draft October 3, 2024 01:14
@sgrebnov sgrebnov force-pushed the sgrebnov/fix-pg-round-unparsing branch from 1d48a4a to a8f630a Compare October 3, 2024 05:46
@sgrebnov sgrebnov marked this pull request as ready for review October 3, 2024 06:02
@sgrebnov sgrebnov merged commit fabd575 into spiceai-42 Oct 3, 2024
@sgrebnov sgrebnov deleted the sgrebnov/fix-pg-round-unparsing branch October 3, 2024 07:18
sgrebnov added a commit that referenced this pull request Oct 3, 2024
…#34)

Includes initial support for dialects to override scalar functions unparsing
sgrebnov added a commit that referenced this pull request Oct 15, 2024
* Postgres: enforce required `NUMERIC` type for `round` scalar function (#34)

Includes initial support for dialects to override scalar functions unparsing

* Document scalar_function_to_sql_overrides fn
kczimm pushed a commit that referenced this pull request Aug 19, 2025
* dissallow pushdown of volatile PhysicalExprs

* fix

* add FilteredVec helper to handle filter / remap pattern (#34)

* checkpoint: Address PR feedback in https://github.com/apach...

* add FilteredVec to consolidate handling of filter / remap pattern

* lint

* Add slt test for pushing volatile predicates down (#35)

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants