enable supports_filter_during_aggregation for Generic dialect#1815
enable supports_filter_during_aggregation for Generic dialect#1815alamb merged 2 commits intoapache:mainfrom
supports_filter_during_aggregation for Generic dialect#1815Conversation
|
@alamb, What do you think about this? I think this change is related to the default behavior of DataFusion. |
supports_filter_during_aggregation for Genericsupports_filter_during_aggregation for Generic dialect
|
Makes sense to me @goldmedal -- I think the intent is that the GenericDialect should support as many SQL constructs as possible The only thing I think this PR needs is a test and it should be good to go |
oops , I forgot to mention the tests. I found it will be covered by the original case: datafusion-sqlparser-rs/tests/sqlparser_common.rs Lines 11644 to 11655 in 81d8909 I guess it's enough? |
I was thinking a test that would prevent against regressions in a future refactor -- namely a test that will fail if this code change is reverted, I think as it stands, if the code change is reverted all the tests will still pass 🤔 |
I see. Make sense. I'll add another test to protect it. |
| let testing_dialects = all_dialects_where(|d| d.supports_filter_during_aggregation()); | ||
| let expected_dialects: Vec<Box<dyn Dialect>> = vec![ | ||
| Box::new(PostgreSqlDialect {}), | ||
| Box::new(DatabricksDialect {}), | ||
| Box::new(HiveDialect {}), | ||
| Box::new(SQLiteDialect {}), | ||
| Box::new(DuckDbDialect {}), | ||
| Box::new(GenericDialect {}), | ||
| ]; | ||
| assert_eq!(testing_dialects.dialects.len(), expected_dialects.len()); | ||
| expected_dialects | ||
| .into_iter() | ||
| .for_each(|d| assert!(d.supports_filter_during_aggregation())); |
There was a problem hiding this comment.
I list all the dialects expected to support filtering during aggregation.
alamb
left a comment
There was a problem hiding this comment.
Thank you @goldmedal
FYI @iffyio
supports_filter_during_aggregationfor theGenericDialect datafusion#15719