forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48168][SQL][FOLLOWUP] Fix bitwise shifting operator's precedence
### What changes were proposed in this pull request? After referencing both `C`, `MySQL`'s doc, https://en.cppreference.com/w/c/language/operator_precedence https://dev.mysql.com/doc/refman/8.0/en/operator-precedence.html And doing some experiments on scala-shell ```scala scala> 1 & 2 >> 1 val res0: Int = 1 scala> 2 >> 1 << 1 val res1: Int = 2 scala> 1 << 1 + 2 val res2: Int = 8 ``` The suitable precedence for `<< >> >>>` is between '+/-' and '&' with a left-to-right associativity. ### Why are the changes needed? bugfix ### Does this PR introduce _any_ user-facing change? now, unreleased yet ### How was this patch tested? new tests ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#46753 from yaooqinn/SPARK-48168-F. Authored-by: Kent Yao <[email protected]> Signed-off-by: Kent Yao <[email protected]>
- Loading branch information
Showing
4 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters