You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/30 13:38:47 UTC

[GitHub] [arrow-datafusion] HaoYang670 opened a new pull request, #4031: Reserve the literal expression of `Count` function

HaoYang670 opened a new pull request, #4031:
URL: https://github.com/apache/arrow-datafusion/pull/4031

   Signed-off-by: remzi <13...@gmail.com>
   
   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #3891.
   
   # Rationale for this change
   ## master
   ``` sql
   ❯ select count(*);
   +-----------------+
   | COUNT(UInt8(1)) |
   +-----------------+
   | 1               |
   +-----------------+
   ❯ select count(1);
   +-----------------+
   | COUNT(UInt8(1)) |
   +-----------------+
   | 1               |
   +-----------------+
   ❯ select count(2);
   +-----------------+
   | COUNT(UInt8(1)) |
   +-----------------+
   | 1               |
   +-----------------+
   ❯ select count(2.2);
   +-----------------+
   | COUNT(UInt8(1)) |
   +-----------------+
   | 1               |
   +-----------------+
   ```
   
   ## this patch
   ```sql
   ❯ select count(*), count(1), count(2), count(2.2);
   +-----------------+-----------------+-----------------+---------------------+
   | COUNT(UInt8(1)) | COUNT(Int64(1)) | COUNT(Int64(2)) | COUNT(Float64(2.2)) |
   +-----------------+-----------------+-----------------+---------------------+
   | 1               | 1               | 1               | 1                   |
   +-----------------+-----------------+-----------------+---------------------+
   ```
   
   # What changes are included in this PR?
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] ursabot commented on pull request #4031: Reserve the literal expression of `Count` function

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #4031:
URL: https://github.com/apache/arrow-datafusion/pull/4031#issuecomment-1300870378

   Benchmark runs are scheduled for baseline = d09621545dea45888a82b3f61f0e033bdee8a8d6 and contender = 065a478c27a17a65df2390b9c492eaf9b9ee6afb. 065a478c27a17a65df2390b9c492eaf9b9ee6afb is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/aa8f122197d8456798fd56b521cb2598...1996f2e4499449e9adbd4d18ff127dff/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/4b8bebf2703245bda9ebb3ede62db599...b57a393c89c147fbb1cb87880c4df63b/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/cdff0a52d23e42c4af49f0e2429703b7...30b05e5eb1654798b46e4cc3dc30efb5/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/d4c68eae985b492992b4694d432cbef9...beb2f47e20c24428bc58b012ced8add4/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #4031: Reserve the literal expression of `Count` function

Posted by GitBox <gi...@apache.org>.
alamb merged PR #4031:
URL: https://github.com/apache/arrow-datafusion/pull/4031


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #4031: Reserve the literal expression of `Count` function

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #4031:
URL: https://github.com/apache/arrow-datafusion/pull/4031#discussion_r1010580334


##########
datafusion/sql/src/planner.rs:
##########
@@ -2344,25 +2344,21 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
     fn aggregate_fn_to_expr(
         &self,
         fun: AggregateFunction,
-        function: sqlparser::ast::Function,
+        args: Vec<FunctionArg>,
         schema: &DFSchema,
     ) -> Result<(AggregateFunction, Vec<Expr>)> {
         let args = match fun {
             // Special case rewrite COUNT(*) to COUNT(constant)
-            AggregateFunction::Count => function
-                .args
+            AggregateFunction::Count => args
                 .into_iter()
                 .map(|a| match a {
-                    FunctionArg::Unnamed(FunctionArgExpr::Expr(SQLExpr::Value(

Review Comment:
   🧹 
   
   Not sure why that was in there
   
   Nice work @HaoYang670  fixing bugs by deleting code 🏅 



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on pull request #4031: Reserve the literal expression of `Count` function

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #4031:
URL: https://github.com/apache/arrow-datafusion/pull/4031#issuecomment-1298813888

   cc @andygrove 


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org