watford-ep commented on code in PR #18342:
URL: https://github.com/apache/datafusion/pull/18342#discussion_r2475069183
##########
datafusion/physical-expr/src/equivalence/properties/mod.rs:
##########
@@ -1470,3 +1470,40 @@ fn get_expr_properties(
expr.get_properties(&child_states)
}
}
+
+#[cfg(test)]
+mod properties_tests {
+ use super::*;
+ use crate::expressions::{binary, case, col, lit};
+ use arrow::compute::SortOptions;
+ use arrow::datatypes::{DataType, Field, Schema};
+ use datafusion_common::Result;
+ use datafusion_expr::Operator;
+ use datafusion_physical_expr_common::sort_expr::PhysicalSortExpr;
+ use std::sync::Arc;
+
+ #[test]
+ fn test_case_expr_ordering_from_raw_oeq_class() -> Result<()> {
+ let schema = Arc::new(Schema::new(vec![
+ Field::new("a", DataType::Int32, true),
+ Field::new("b", DataType::Int32, true),
+ ]));
+
+ // CASE WHEN a = 1 THEN a -> should be ordered
+ let mut eq_properties =
EquivalenceProperties::new(Arc::clone(&schema));
+ let when = binary(col("a", &schema)?, Operator::Eq, lit(1i32),
&schema)?;
+ let then = col("a", &schema)?;
+ let case_expr = case(None, vec![(when, then)], None)?;
+
+ let option = SortOptions::default();
Review Comment:
I have removed this offending code!
--
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]