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: Make width_bucket() behave like in Presto Java. #11557

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spershin
Copy link
Contributor

Summary:
Presto Java treats null elements in the input array vector as zeroes,
ignoring null flag. This is not entirely correct, but at least consistent.
Velox currently just reads what value is in the element, ignoring null flag and
is inconsistent as the memory is not necessarily zeroed.

Differential Revision: D66043501

Summary:
Presto Java treats null elements in the input array vector as zeroes,
ignoring null flag. This is not entirely correct, but at least consistent.
Velox currently just reads what value is in the element, ignoring null flag and
is inconsistent as the memory is not necessarily zeroed.

Differential Revision: D66043501
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 16, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66043501

Copy link

netlify bot commented Nov 16, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit b6b77b2
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6737f05d75ef970008e64b0d

// Adhere to this behavior for now.
template <typename T>
T valueOrZero(const DecodedVector& elementsHolder, vector_size_t idx) {
return elementsHolder.isNullAt(idx) ? T{0} : elementsHolder.valueAt<T>(idx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be strong against this and we should throw whenever we see null here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yuhta I understand your position and I also want to fix it properly.
However, at the moment it will break some queries and behavior will differ from Presto.
This will complicate the adoption and roll out of the Prestissimo for both users and us.

I have created Presto issue to come with the conclusion of what we want to do about this problem: prestodb/presto#24055

Hopefully, soon we can alter Presto's behavior and with it, the Velox's.

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Java queries have NULLs in bins will for sure not giving what the user expects. If we are worry about user reports, just throw VELOX_FAIL_UNSUPPORTED_INPUT_UNCATCHABLE so the queries will be retried on Java.

@spershin spershin changed the title Make width_bucket() behaev like in Presto Java. fix: Make width_bucket() behave like in Presto Java. Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants