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

Fix typing of CASE-WHEN (DynamicTyper) #1566

Open
johnedquinn opened this issue Aug 23, 2024 · 0 comments
Open

Fix typing of CASE-WHEN (DynamicTyper) #1566

johnedquinn opened this issue Aug 23, 2024 · 0 comments

Comments

@johnedquinn
Copy link
Member

johnedquinn commented Aug 23, 2024

The merged change is still wrong. The supertype of INT, SMALLINT, and DECIMAL(5, 0), according to #1554 is DECIMAL. Though, when computeDecimal is invoked to compute the precision and scale, it throws an error when folding over the types of INT and SMALLINT.
This PR merges the not completely correct code while mitigating the thrown exception. I tried to apply as minimal changes as possible to the merge, but this is one area known to have a bug.

Originally posted by @johnedquinn in #1565 (comment)

In SQL:1999, Section 9.3 (Data types of results of aggregations), it specifies several rules of coercing the branches of a case expression. These rules are not followed. It needs to be fixed.

I would probably look at the recent implementations of the 2D tables for CastTable and DatumComparator -- we can probably implement something quite similar.

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

No branches or pull requests

1 participant