Skip to content

Commit 82a8178

Browse files
committed
fix
1 parent a1684f9 commit 82a8178

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

datafusion/optimizer/src/rewrite_limit_to_aggregate.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,6 @@ mod tests {
303303

304304
#[test]
305305
fn test_rewrite_sorts_different_column() {
306-
// Test: SELECT id FROM t ORDER BY value DESC LIMIT 1
307-
// This WILL rewrite to SELECT MAX(value) FROM t
308-
// Note: This changes query semantics - we lose the 'id' column!
309-
// This is a limitation that should be addressed: only rewrite when
310-
// the sort column matches the projected column
311-
312306
let input = test_table_scan().unwrap();
313307

314308
let plan = LogicalPlanBuilder::from(input)
@@ -324,8 +318,7 @@ mod tests {
324318
let rule = RewriteLimitToAggregate::new();
325319
let result = rule.rewrite(plan, &crate::OptimizerContext::new()).unwrap();
326320

327-
// Currently this DOES transform (which is semantically incorrect)
328-
assert!(result.transformed, "Currently transforms (but semantically changes query)");
321+
assert!(!result.transformed, "Should not transform for diff");
329322
}
330323

331324
// ============================================================================

0 commit comments

Comments
 (0)