theirix commented on PR #22482:
URL: https://github.com/apache/datafusion/pull/22482#issuecomment-4532671039

   > > The main question is whether we should use a decimal or a float output 
type.
   > > From a quick skim, analytical engines use float output types for the 
decimal inputs. The major exception is Postgres - it preserves decimal types
   > 
   > `numeric`/`decimal` in Postgres is arbitrary precision and can represent 
exceptional values like `NaN`, so I think it's somewhat different (no risk of 
overflow, etc.)
   
   That's true indeed - Postgres is different even with this type semantics, 
let's stick with DuckDB/Spark.
   
   > We could follow DuckDB and others by _always_ returning a float output 
type, but to me it seems unfortunate to lose exact precision for the 
`power(decimal, integer)` case.
   
   I agree, let's leave `(decimal+integer -> decimal)` exact, if possible.
   
   > > Also, with `parse_float_as_decimal`, we promote the second argument to 
decimal - would it work?
   > 
   > AFAIK this PR should work fine in that scenario (I'm working on this in 
part because I want to flip `parse_float_as_decimal` to true by default in the 
future). But lmk if I misunderstood your question.
   
   Yes, I saw that ticket - thank you! My concern is that after the switch, 
both arguments become decimal values, so the floatness check on the exponent 
returns false. I remember I've tried to introduce some SLT test cases for both 
values of the flag, it could be useful to double-check.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to