Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-06 Thread via GitHub
jonahgao commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1667354250 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { exp

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-05 Thread via GitHub
jonahgao commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1667250109 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { exp

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-05 Thread via GitHub
jonahgao merged PR #11256: URL: https://github.com/apache/datafusion/pull/11256 -- 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...@dataf

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-05 Thread via GitHub
jayzhan211 commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1667215728 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { e

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-05 Thread via GitHub
findepi commented on PR #11256: URL: https://github.com/apache/datafusion/pull/11256#issuecomment-2211376092 thanks @jonahgao for your review! updated. -- 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 g

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-05 Thread via GitHub
findepi commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1667103815 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { expr

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-05 Thread via GitHub
jonahgao commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666430879 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { exp

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
findepi commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666408825 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { expr

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
findepi commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666407091 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { expr

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
jayzhan211 commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666217226 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { e

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
jayzhan211 commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666204769 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { e

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
jonahgao commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666162520 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { exp

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
findepi commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666030287 ## datafusion/optimizer/tests/optimizer_integration.rs: ## @@ -294,6 +294,21 @@ fn eliminate_nested_filters() { assert_eq!(expected, format!("{plan:?}")); }

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
findepi commented on code in PR #11256: URL: https://github.com/apache/datafusion/pull/11256#discussion_r1666020300 ## datafusion/expr/src/expr_schema.rs: ## @@ -322,10 +322,16 @@ impl ExprSchemable for Expr { } } Expr::Cast(Cast { expr

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
findepi commented on PR #11256: URL: https://github.com/apache/datafusion/pull/11256#issuecomment-2209470440 @jonahgao thanks! I think we may later choose to add a similar optimizer to the one that was proposed here for the sake of filter expressions. Let's not add one if not needed tod

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-04 Thread via GitHub
jonahgao commented on PR #11256: URL: https://github.com/apache/datafusion/pull/11256#issuecomment-2209124848 I think there might be a simpler way to achieve this. We can declare the count aggregation expr as non-nullable like [this](https://github.com/apache/datafusion/commit/21d0119

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-03 Thread via GitHub
alamb commented on PR #11256: URL: https://github.com/apache/datafusion/pull/11256#issuecomment-2207336875 Thank you very much @findepi -- for both this PR and your other recent contributions. I will indeed review this PR, though I may not get to it until tomorrow or Friday -- This is

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-03 Thread via GitHub
findepi commented on PR #11256: URL: https://github.com/apache/datafusion/pull/11256#issuecomment-2207206104 @alamb PTAL -- 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

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-03 Thread via GitHub
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:?}")); }

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-03 Thread via GitHub
findepi commented on PR #11256: URL: https://github.com/apache/datafusion/pull/11256#issuecomment-2207004248 Added unit and integration tests. Should be ready to review. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use

Re: [PR] Infer count() aggregation is not null [datafusion]

2024-07-03 Thread via GitHub
findepi commented on PR #11256: URL: https://github.com/apache/datafusion/pull/11256#issuecomment-2206765177 this is a draft because there are no tests in this PR. still review feedback would be very welcomed -- am i going in the right direction? -- This is an automated message

[PR] Infer count() aggregation is not null [datafusion]

2024-07-03 Thread via GitHub
findepi opened a new pull request, #11256: URL: https://github.com/apache/datafusion/pull/11256 `count([DISTINCT] [expr])` aggregate function never returns null. Infer non-nullness of such aggregate expression. This allows elimination of the HAVING filter for a query such as SELE