findepi commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1664640979
########## datafusion/optimizer/tests/optimizer_integration.rs: ########## @@ -294,6 +294,21 @@ fn eliminate_nested_filters() { assert_eq!(expected, format!("{plan:?}")); } +#[test] +fn eliminate_redundant_null_check() { + let sql = "\ + SELECT col_int32, count(*) c + FROM test + GROUP BY col_int32 + HAVING c IS NOT NULL"; + let plan = test_sql(sql).unwrap(); + let expected = "\ + Projection: test.col_int32, count(*) AS c\ + \n Aggregate: groupBy=[[test.col_int32]], aggr=[[count(Int64(1)) AS count(*)]]\ + \n TableScan: test projection=[col_int32]"; + assert_eq!(expected, format!("{plan:?}")); Review Comment: Note: `assert_eq!` names its parameters "left" and "right" and doesn't seem to designate which one is expected and which is actual. However, when a test is run from RustRover, the IDE is apparently opinionated and currently expects the "right" to be "the expected": <img width="1156" alt="image" src="https://github.com/apache/datafusion/assets/144328/989d9c55-f032-49f0-880f-4bc93f672604"> I put the expected on the left, since this is what the existing code does. Some RustRover references - https://github.com/intellij-rust/intellij-rust/issues/3814 - https://github.com/intellij-rust/intellij-rust/pull/3848 -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org