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

Velox shows different behavior compared to Presto on non boolean aggregation masks #11523

Open
kgpai opened this issue Nov 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kgpai
Copy link
Contributor

kgpai commented Nov 13, 2024

Bug description

Velox shows different behavior compared to Presto java

SELECT sum(c0) FILTER(WHERE c0), count(*) FILTER(WHERE c0), c1 from (values (CAST(10 AS BIGINT), 'a')) t(c0, c1) GROUP BY c1;

 NULL  |     0 | a

Corresponding Query in Presto Java:

SELECT sum(c0) FILTER(WHERE c0), count(*) FILTER(WHERE c0), c1 from (values (CAST(10 AS BIGINT), 'a')) t(c0, c1) GROUP BY c1;

    10 |     1 | a

Whether the behavior is correct on Presto or Velox end is yet to be determined. Creating this issue to track this discrepancy.

System information

N/A

Relevant logs

N/A
@kgpai kgpai added bug Something isn't working triage Newly created issue that needs attention. labels Nov 13, 2024
kgpai pushed a commit to kgpai/velox-1 that referenced this issue Nov 13, 2024
Summary:
There is difference in behavior in how non boolean aggregation masks behave in Velox and Presto. 
This change causes velox to throw when we encounter non boolean mask.
This is a stop gap for issue facebookincubator#11523.

Differential Revision: D65858866
@Yuhta
Copy link
Contributor

Yuhta commented Nov 13, 2024

Note that Presto Java does not allow non-boolean filter expression in non-aggregate filters. The implicit cast looks unsafe for a high level language like SQL.

kgpai pushed a commit to kgpai/velox-1 that referenced this issue Nov 13, 2024
…okincubator#11524)

Summary:

There is difference in behavior in how non boolean aggregation masks behave in Velox and Presto. 
This change causes velox to throw when we encounter non boolean mask.
This is a stop gap for issue facebookincubator#11523.

Reviewed By: Yuhta

Differential Revision: D65858866
@kgpai kgpai removed the triage Newly created issue that needs attention. label Nov 13, 2024
facebook-github-bot pushed a commit that referenced this issue Nov 13, 2024
Summary:
Pull Request resolved: #11524

There is difference in behavior in how non boolean aggregation masks behave in Velox and Presto.
This change causes velox to throw when we encounter non boolean mask.
This is a stop gap for issue #11523.

Reviewed By: Yuhta

Differential Revision: D65858866

fbshipit-source-id: 346ea545cea2cfbada87d0e9ba9b4b890233c789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants