Fix size_of_scalar test#2531
Merged
Merged
Conversation
alamb
commented
May 13, 2022
| assert_eq!(std::mem::size_of::<ScalarValue>(), 64); | ||
|
|
||
| #[cfg(target_arch = "amd64")] | ||
| #[cfg(not(target_arch = "aarch64"))] |
Contributor
Author
There was a problem hiding this comment.
I like this formulation as it ensures that one of these assert_eq! calls will always be invoked, regardless of architecture
Contributor
There was a problem hiding this comment.
You could also write something like
let expected = match cfg!(target_arch == "aarch64") {
true => 64,
false => 48,
};
Contributor
Author
There was a problem hiding this comment.
let expected = match cfg!(target_arch == "aarch64") {
true => 64,
false => 48,
};
resulted in
error: expected 1 cfg-pattern
--> datafusion/core/src/scalar.rs:380:30
|
380 | let expected = match cfg!(target_arch == "aarch64") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `cfg` (in Nightly builds, run with -Z macro-backtrace for more info)
for me locally
Contributor
There was a problem hiding this comment.
Sorry, try removing the double equals...
tustvold
reviewed
May 13, 2022
tustvold
left a comment
Contributor
There was a problem hiding this comment.
A comment about why there is the architectural discrepancy might be nice
| assert_eq!(std::mem::size_of::<ScalarValue>(), 64); | ||
|
|
||
| #[cfg(target_arch = "amd64")] | ||
| #[cfg(not(target_arch = "aarch64"))] |
Contributor
There was a problem hiding this comment.
You could also write something like
let expected = match cfg!(target_arch == "aarch64") {
true => 64,
false => 48,
};
tustvold
approved these changes
May 16, 2022
korowa
pushed a commit
to korowa/arrow-datafusion
that referenced
this pull request
May 18, 2022
* Fix size_of_scalar test * add comments * Update tests
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
N/A
Rationale for this change
This test is important. It verifies that the memory use of code like GroupByHash is not changed. Quoting:
It turns out that the way the
cfgswere setup the test never was invoked.The change seems to have come in via #1455 from @maxburke
I found this while reviewing #2523
What changes are included in this PR?
Fix test so it is always invoked
Are there any user-facing changes?
no