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 size_of_scalar test #2531

Merged
merged 3 commits into from
May 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions datafusion/core/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,16 @@ mod tests {
// Since ScalarValues are used in a non trivial number of places,
// making it larger means significant more memory consumption
// per distinct value.
#[cfg(target_arch = "aarch64")]
assert_eq!(std::mem::size_of::<ScalarValue>(), 64);
//
// The alignment requirements differ across architectures and
// thus the size of the enum appears to as as well

#[cfg(target_arch = "amd64")]
assert_eq!(std::mem::size_of::<ScalarValue>(), 48);
let expected = match cfg!(target_arch = "aarch64") {
true => 64,
false => 48,
};

assert_eq!(std::mem::size_of::<ScalarValue>(), expected);
}

#[test]
Expand Down