-
Notifications
You must be signed in to change notification settings - Fork 602
enable supports_filter_during_aggregation
for Generic dialect
#1815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I list all the dialects expected to support filtering during aggregation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @goldmedal
FYI @iffyio
supports_filter_during_aggregation
for theGeneric
Dialect datafusion#15719