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

approx_percentile cast error #11

Open
okennedy opened this issue Oct 9, 2023 · 1 comment
Open

approx_percentile cast error #11

okennedy opened this issue Oct 9, 2023 · 1 comment

Comments

@okennedy
Copy link
Member

okennedy commented Oct 9, 2023

Describe the bug
Use of the approximate percentile function appears to force an incorrect cast to string.

To Reproduce
Create a dataset R with a column A

select avg(a), approx_percentile(a, array(0.5)) FROM R

Expected behavior
No exception

@okennedy
Copy link
Member Author

okennedy commented Oct 9, 2023

cannot resolve 'percentile(midterm1.out_of_100, applycaveat(CAST(0.25BD AS DOUBLE), concat('Could not cast \'', coalesce(CAST(0.25BD AS STRING), '\'NULL\''), '\' to DoubleType (in 0.25)'), ((NOT (0.25BD IS NULL)) AND (CAST(0.25BD AS DOUBLE) IS NULL))), 1L)' due to data type mismatch: The percentage(s) must be a constant literal, but got applycaveat(cast(0.25 as double), concat(Could not cast ', coalesce(cast(0.25 as string), 'NULL'), ' to DoubleType (in 0.25)), None, false, (NOT isnull(0.25) AND isnull(cast(0.25 as double))))

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