Skip to content

Commit 4082863

Browse files
committed
fixup: test: add test for mix case columns
1 parent ba36d39 commit 4082863

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

datafusion/optimizer/src/push_down_filter.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4131,6 +4131,7 @@ mod tests {
41314131
/// Create a test table scan with uppercase column names for case sensitivity testing
41324132
fn test_table_scan_with_uppercase_columns() -> Result<LogicalPlan> {
41334133
let schema = Schema::new(vec![
4134+
Field::new("a", DataType::UInt32, false),
41344135
Field::new("A", DataType::UInt32, false),
41354136
Field::new("B", DataType::UInt32, false),
41364137
Field::new("C", DataType::UInt32, false),
@@ -4157,4 +4158,24 @@ mod tests {
41574158
"
41584159
)
41594160
}
4161+
4162+
#[test]
4163+
fn filter_agg_mix_case_insensitive() -> Result<()> {
4164+
let table_scan = test_table_scan_with_uppercase_columns()?;
4165+
let plan = LogicalPlanBuilder::from(table_scan)
4166+
.aggregate(
4167+
vec![col("a")],
4168+
vec![sum(col(r#""B""#)).alias("total_salary")],
4169+
)?
4170+
.filter(col("a").gt(lit(10i64)))?
4171+
.build()?;
4172+
4173+
assert_optimized_plan_equal!(
4174+
plan,
4175+
@r"
4176+
Aggregate: groupBy=[[test.a]], aggr=[[sum(test.B) AS total_salary]]
4177+
TableScan: test, full_filters=[test.a > Int64(10)]
4178+
"
4179+
)
4180+
}
41604181
}

0 commit comments

Comments
 (0)