You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/13 18:26:02 UTC

[GitHub] [arrow-datafusion] alamb opened a new pull request, #2531: Fix size_of_scalar test

alamb opened a new pull request, #2531:
URL: https://github.com/apache/arrow-datafusion/pull/2531

   # 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:
   
   ```
           // Since ScalarValues are used in a non trivial number of places,
           // making it larger means significant more memory consumption
           // per distinct value.
   ```
   
   It turns out that the way the `cfgs` were setup the test never was invoked.
   
   The change seems to have come in via #1455 from @maxburke 
   
   I found this while reviewing https://github.com/apache/arrow-datafusion/pull/2523
   
   # What changes are included in this PR?
   Fix test so it is always invoked
   
   # Are there any user-facing changes?
   no


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #2531: Fix size_of_scalar test

Posted by GitBox <gi...@apache.org>.
alamb merged PR #2531:
URL: https://github.com/apache/arrow-datafusion/pull/2531


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] tustvold commented on a diff in pull request #2531: Fix size_of_scalar test

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #2531:
URL: https://github.com/apache/arrow-datafusion/pull/2531#discussion_r872701638


##########
datafusion/core/src/scalar.rs:
##########
@@ -377,7 +377,7 @@ mod tests {
         #[cfg(target_arch = "aarch64")]
         assert_eq!(std::mem::size_of::<ScalarValue>(), 64);
 
-        #[cfg(target_arch = "amd64")]
+        #[cfg(not(target_arch = "aarch64"))]

Review Comment:
   Sorry, try removing the double equals...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] tustvold commented on a diff in pull request #2531: Fix size_of_scalar test

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #2531:
URL: https://github.com/apache/arrow-datafusion/pull/2531#discussion_r872697091


##########
datafusion/core/src/scalar.rs:
##########
@@ -377,7 +377,7 @@ mod tests {
         #[cfg(target_arch = "aarch64")]
         assert_eq!(std::mem::size_of::<ScalarValue>(), 64);
 
-        #[cfg(target_arch = "amd64")]
+        #[cfg(not(target_arch = "aarch64"))]

Review Comment:
   You could also write something like
   
   ```
   let expected = match cfg!(target_arch == "aarch64") {
     true => 64,
     false => 48,
   };
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #2531: Fix size_of_scalar test

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #2531:
URL: https://github.com/apache/arrow-datafusion/pull/2531#discussion_r872700708


##########
datafusion/core/src/scalar.rs:
##########
@@ -377,7 +377,7 @@ mod tests {
         #[cfg(target_arch = "aarch64")]
         assert_eq!(std::mem::size_of::<ScalarValue>(), 64);
 
-        #[cfg(target_arch = "amd64")]
+        #[cfg(not(target_arch = "aarch64"))]

Review 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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #2531: Fix size_of_scalar test

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #2531:
URL: https://github.com/apache/arrow-datafusion/pull/2531#discussion_r872682349


##########
datafusion/core/src/scalar.rs:
##########
@@ -377,7 +377,7 @@ mod tests {
         #[cfg(target_arch = "aarch64")]
         assert_eq!(std::mem::size_of::<ScalarValue>(), 64);
 
-        #[cfg(target_arch = "amd64")]
+        #[cfg(not(target_arch = "aarch64"))]

Review Comment:
   I like this formulation as it ensures that one of these `assert_eq!` calls will always be invoked, regardless of architecture



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org