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 the Window operator with overflowed empty k-rows frames #9476

Closed
wants to merge 1 commit into from

Conversation

kagamiori
Copy link
Contributor

Summary:
The boundaries of Window frames are int32 integers. When the frame
boundaries given in the query exceed int32 limit, the Window
operator needs to adjust the frame bounds. However, the current
code has a bug that when the frame end is below INT32_MIN, it
adjust the frame end to 0. This is wrong because the original frame is
empty, but after the adjustment, it always include row 0. This diff fixes
this bug by setting the frame bound to -1 when the frame bound
belows INT32_MIN. A subsequent call to computeValidFrames will
check whether this frame is empty and mark it properly.

This diff fixes #9375.

Differential Revision: D56085211

@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 Apr 12, 2024
@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Apr 12, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit f009024
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/661f06a48a5d460008213c98

@kagamiori
Copy link
Contributor Author

Hi @aditi-pandit, could you help review this PR? Thanks!

Copy link
Collaborator

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @kagamiori. LGTM.

kagamiori added a commit to kagamiori/velox that referenced this pull request Apr 16, 2024
…incubator#9476)

Summary:

The boundaries of Window frames are int32 integers. When the frame
boundaries given in the query exceed int32 limit, the Window
operator needs to adjust the frame bounds. However, the current
code has a bug that when the frame end is below INT32_MIN, it
adjust the frame end to 0. This is wrong because the original frame is
empty, but after the adjustment, it always include row 0. This diff fixes
this bug by setting the frame bound to -1 when the frame bound
belows INT32_MIN. A subsequent call to computeValidFrames will
check whether this frame is empty and mark it properly.

This diff fixes facebookincubator#9375.

Differential Revision: D56085211
@facebook-github-bot
Copy link
Contributor

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

kagamiori added a commit to kagamiori/velox that referenced this pull request Apr 16, 2024
…incubator#9476)

Summary:

The boundaries of Window frames are int32 integers. When the frame
boundaries given in the query exceed int32 limit, the Window
operator needs to adjust the frame bounds. However, the current
code has a bug that when the frame end is below INT32_MIN, it
adjust the frame end to 0. This is wrong because the original frame is
empty, but after the adjustment, it always include row 0. This diff fixes
this bug by setting the frame bound to -1 when the frame bound
belows INT32_MIN. A subsequent call to computeValidFrames will
check whether this frame is empty and mark it properly.

This diff fixes facebookincubator#9375.

Differential Revision: D56085211
@facebook-github-bot
Copy link
Contributor

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

kagamiori added a commit to kagamiori/velox that referenced this pull request Apr 16, 2024
…incubator#9476)

Summary:

The boundaries of Window frames are int32 integers. When the frame
boundaries given in the query exceed int32 limit, the Window
operator needs to adjust the frame bounds. However, the current
code has a bug that when the frame end is below INT32_MIN, it
adjust the frame end to 0. This is wrong because the original frame is
empty, but after the adjustment, it always include row 0. This diff fixes
this bug by setting the frame bound to -1 when the frame bound
belows INT32_MIN. A subsequent call to computeValidFrames will
check whether this frame is empty and mark it properly.

This diff fixes facebookincubator#9375.

Reviewed By: Yuhta

Differential Revision: D56085211
@facebook-github-bot
Copy link
Contributor

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

…incubator#9476)

Summary:

The boundaries of Window frames are int32 integers. When the frame
boundaries given in the query exceed int32 limit, the Window
operator needs to adjust the frame bounds. However, the current
code has a bug that when the frame end is below INT32_MIN, it
adjust the frame end to 0. This is wrong because the original frame is
empty, but after the adjustment, it always include row 0. This diff fixes
this bug by setting the frame bound to -1 when the frame bound
belows INT32_MIN. A subsequent call to computeValidFrames will
check whether this frame is empty and mark it properly.

This diff fixes facebookincubator#9375.

Reviewed By: Yuhta

Differential Revision: D56085211
@facebook-github-bot
Copy link
Contributor

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

kagamiori added a commit to kagamiori/velox that referenced this pull request Apr 16, 2024
…incubator#9476)

Summary:

The boundaries of Window frames are int32 integers. When the frame
boundaries given in the query exceed int32 limit, the Window
operator needs to adjust the frame bounds. However, the current
code has a bug that when the frame end is below INT32_MIN, it
adjust the frame end to 0. This is wrong because the original frame is
empty, but after the adjustment, it always include row 0. This diff fixes
this bug by setting the frame bound to -1 when the frame bound
belows INT32_MIN. A subsequent call to computeValidFrames will
check whether this frame is empty and mark it properly.

This diff fixes facebookincubator#9375.

Reviewed By: Yuhta

Differential Revision: D56085211
kagamiori added a commit to kagamiori/velox that referenced this pull request Apr 16, 2024
…incubator#9476)

Summary:

The boundaries of Window frames are int32 integers. When the frame
boundaries given in the query exceed int32 limit, the Window
operator needs to adjust the frame bounds. However, the current
code has a bug that when the frame end is below INT32_MIN, it
adjust the frame end to 0. This is wrong because the original frame is
empty, but after the adjustment, it always include row 0. This diff fixes
this bug by setting the frame bound to -1 when the frame bound
belows INT32_MIN. A subsequent call to computeValidFrames will
check whether this frame is empty and mark it properly.

This diff fixes facebookincubator#9375.

Reviewed By: Yuhta

Differential Revision: D56085211
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 79f3add.

Copy link

Conbench analyzed the 1 benchmark run on commit 79f3addd.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

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 Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect result of window operation when frame bound exceeds INT32 limit and the frame is empty
4 participants