kosiew commented on code in PR #26074:
URL: https://github.com/apache/datafusion/pull/26074#discussion_r4203905306
##########
datafusion/physical-plan/src/aggregates/order/mod.rs:
##########
@@ -164,7 +166,75 @@ mod tests {
use std::sync::Arc;
- use arrow::array::Int32Array;
+ use arrow::array::{Int32Array, StringArray};
+ use datafusion_common::ScalarValue;
+
+ #[test]
+ fn test_size_none() {
+ assert_eq!(GroupOrdering::None.size(), size_of::<GroupOrdering>());
+ }
+
+ #[test]
+ fn test_size_full() -> Result<()> {
+ let mut ordering = GroupOrdering::try_new(&InputOrderMode::Sorted)?;
+ let expected = size_of::<GroupOrdering>();
+ assert_eq!(ordering.size(), expected);
+
+ ordering.new_groups(&[], &[0, 1, 2], 3)?;
+ assert_eq!(ordering.size(), expected);
+ ordering.remove_groups(2);
+ assert_eq!(ordering.size(), expected);
+ ordering.input_done();
+ assert_eq!(ordering.size(), expected);
+ ordering.reset();
+ assert_eq!(ordering.size(), expected);
+ Ok(())
+ }
Review Comment:
I’ll combine the `None` and `Sorted` assertions into one descriptor-size
test; the `Sorted` assertion catches the original double charge.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]