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

[BUG] Queries with window expressions fail when cost-based optimizer is enabled #2489

Closed
andygrove opened this issue May 24, 2021 · 1 comment · Fixed by #2491
Closed

[BUG] Queries with window expressions fail when cost-based optimizer is enabled #2489

andygrove opened this issue May 24, 2021 · 1 comment · Fixed by #2491
Assignees
Labels
bug Something isn't working P0 Must have for release

Comments

@andygrove
Copy link
Contributor

Describe the bug

With the RAPIDS Accelerator cost-based optimizer enabled, queries with window expressions fail when we attempt to estimate data sizes, because WindowFrame.dataType throws UnsupportedOperationException.

[2021-05-22T11:55:11.887Z] java.lang.UnsupportedOperationException: dataType^M
[2021-05-22T11:55:11.887Z]      at org.apache.****.sql.catalyst.expressions.WindowFrame.dataType(windowExpressions.scala:168)^M
[2021-05-22T11:55:11.887Z]      at org.apache.****.sql.catalyst.expressions.WindowFrame.dataType$(windowExpressions.scala:168)^M
[2021-05-22T11:55:11.887Z]      at org.apache.****.sql.catalyst.expressions.SpecifiedWindowFrame.dataType(windowExpressions.scala:179)^M
[2021-05-22T11:55:11.887Z]      at com.nvidia.****.rapids.BaseExprMeta.dataType(RapidsMeta.scala:758)^M
[2021-05-22T11:55:11.887Z]      at com.nvidia.****.rapids.CpuCostModel.exprCost(CostBasedOptimizer.scala:282)^M

Steps/Code to reproduce bug
Run NDS query q89 with CBO enabled.

Expected behavior
Query should not fail.

Environment details (please complete the following information)
N/A

Additional context
None

@andygrove andygrove added bug Something isn't working ? - Needs Triage Need team to review and classify labels May 24, 2021
@andygrove andygrove added this to the May 24 - Jun 4 milestone May 24, 2021
@andygrove andygrove self-assigned this May 24, 2021
@revans2
Copy link
Collaborator

revans2 commented May 24, 2021

Ya there is some oddness with data type for a WindowSpecDefinition. For what ever reason they throw nsupportedOperationException("dataType"), so we probably need to have some special case code for them like we have here.

@sameerz sameerz added P0 Must have for release and removed ? - Needs Triage Need team to review and classify labels May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Must have for release
Projects
None yet
3 participants