-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 infinite loop during planning caused by PickTableLayout #17720
Conversation
@highker you did approve this PR at #16627 but it was missing few tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For primitive types like int
, please directly compare their values instead of using Objects.equals
across this PR.
Direct value comparison for primitive types is much more efficient than Object.equals
in Java
} | ||
HashTables other = (HashTables) obj; | ||
return Arrays.equals(this.hashTables, other.hashTables) && | ||
Objects.equals(this.expectedHashTableCount, other.expectedHashTableCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expectedHashTableCount
is of primitive type int
. We can directly compare the values as it is much more efficient than using Object.equals
this.expectedHashTableCount == other.expectedHashTableCount
return false; | ||
} | ||
ArrayBlock other = (ArrayBlock) obj; | ||
return Objects.equals(this.arrayOffset, other.arrayOffset) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For primitive types like int
, please directly compare their values instead of using Object.equals
, here and in other files.
@v-jizhang Please squash the commits into one commit. The code changes look good. |
Replaces prestodb#16627 Co-authored-by: Brian Li <librian415@gmail.com>
Squashed. Thank you! |
Custom hashcode and equal functions are introduced for xxxBlock in PR prestodb#17720, where content in the corresponding block rather than the object itself are used in hashcode and equal function computation. However, xxxBlockBuilder which also extends from Block interface is left behind. In this commit, we override such functions for block builder.
Replaces #16627
Co-authored-by: Brian Li librian415@gmail.com
Test plan - Added a test.