You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "jayzhan211 (via GitHub)" <gi...@apache.org> on 2024/05/13 12:55:01 UTC

[PR] Move `Count` to `functions-aggregate` [datafusion]

jayzhan211 opened a new pull request, #10484:
URL: https://github.com/apache/datafusion/pull/10484

   ## 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 #.
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   ## What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## 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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1626228488


##########
datafusion/physical-expr/src/aggregate/build_in.rs:
##########
@@ -61,14 +61,9 @@ pub fn create_aggregate_expr(
         .collect::<Result<Vec<_>>>()?;
     let input_phy_exprs = input_phy_exprs.to_vec();
     Ok(match (fun, distinct) {
-        (AggregateFunction::Count, false) => Arc::new(
-            expressions::Count::new_with_multiple_exprs(input_phy_exprs, name, data_type),
-        ),
-        (AggregateFunction::Count, true) => Arc::new(expressions::DistinctCount::new(
-            data_type,
-            input_phy_exprs[0].clone(),
-            name,
-        )),
+        (AggregateFunction::Count, _) => {
+            todo!("Builtin Count will be removed")

Review Comment:
   can we please make this an internal error rather than a panic?



##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -1312,160 +1311,160 @@ mod tests {
         Arc::new(task_ctx)
     }
 
-    async fn check_grouping_sets(
-        input: Arc<dyn ExecutionPlan>,
-        spill: bool,
-    ) -> Result<()> {
-        let input_schema = input.schema();
-
-        let grouping_set = PhysicalGroupBy {
-            expr: vec![
-                (col("a", &input_schema)?, "a".to_string()),
-                (col("b", &input_schema)?, "b".to_string()),
-            ],
-            null_expr: vec![
-                (lit(ScalarValue::UInt32(None)), "a".to_string()),
-                (lit(ScalarValue::Float64(None)), "b".to_string()),
-            ],
-            groups: vec![
-                vec![false, true],  // (a, NULL)
-                vec![true, false],  // (NULL, b)
-                vec![false, false], // (a,b)
-            ],
-        };
-
-        let aggregates: Vec<Arc<dyn AggregateExpr>> = vec![Arc::new(Count::new(
-            lit(1i8),
-            "COUNT(1)".to_string(),
-            DataType::Int64,
-        ))];
-
-        let task_ctx = if spill {
-            new_spill_ctx(4, 1000)
-        } else {
-            Arc::new(TaskContext::default())
-        };
-
-        let partial_aggregate = Arc::new(AggregateExec::try_new(
-            AggregateMode::Partial,
-            grouping_set.clone(),
-            aggregates.clone(),
-            vec![None],
-            input,
-            input_schema.clone(),
-        )?);
-
-        let result =
-            common::collect(partial_aggregate.execute(0, task_ctx.clone())?).await?;
-
-        let expected = if spill {
-            vec![
-                "+---+-----+-----------------+",
-                "| a | b   | COUNT(1)[count] |",
-                "+---+-----+-----------------+",
-                "|   | 1.0 | 1               |",
-                "|   | 1.0 | 1               |",
-                "|   | 2.0 | 1               |",
-                "|   | 2.0 | 1               |",
-                "|   | 3.0 | 1               |",
-                "|   | 3.0 | 1               |",
-                "|   | 4.0 | 1               |",
-                "|   | 4.0 | 1               |",
-                "| 2 |     | 1               |",
-                "| 2 |     | 1               |",
-                "| 2 | 1.0 | 1               |",
-                "| 2 | 1.0 | 1               |",
-                "| 3 |     | 1               |",
-                "| 3 |     | 2               |",
-                "| 3 | 2.0 | 2               |",
-                "| 3 | 3.0 | 1               |",
-                "| 4 |     | 1               |",
-                "| 4 |     | 2               |",
-                "| 4 | 3.0 | 1               |",
-                "| 4 | 4.0 | 2               |",
-                "+---+-----+-----------------+",
-            ]
-        } else {
-            vec![
-                "+---+-----+-----------------+",
-                "| a | b   | COUNT(1)[count] |",
-                "+---+-----+-----------------+",
-                "|   | 1.0 | 2               |",
-                "|   | 2.0 | 2               |",
-                "|   | 3.0 | 2               |",
-                "|   | 4.0 | 2               |",
-                "| 2 |     | 2               |",
-                "| 2 | 1.0 | 2               |",
-                "| 3 |     | 3               |",
-                "| 3 | 2.0 | 2               |",
-                "| 3 | 3.0 | 1               |",
-                "| 4 |     | 3               |",
-                "| 4 | 3.0 | 1               |",
-                "| 4 | 4.0 | 2               |",
-                "+---+-----+-----------------+",
-            ]
-        };
-        assert_batches_sorted_eq!(expected, &result);
-
-        let groups = partial_aggregate.group_expr().expr().to_vec();
-
-        let merge = Arc::new(CoalescePartitionsExec::new(partial_aggregate));
-
-        let final_group: Vec<(Arc<dyn PhysicalExpr>, String)> = groups
-            .iter()
-            .map(|(_expr, name)| Ok((col(name, &input_schema)?, name.clone())))
-            .collect::<Result<_>>()?;
-
-        let final_grouping_set = PhysicalGroupBy::new_single(final_group);
-
-        let task_ctx = if spill {
-            new_spill_ctx(4, 3160)
-        } else {
-            task_ctx
-        };
-
-        let merged_aggregate = Arc::new(AggregateExec::try_new(
-            AggregateMode::Final,
-            final_grouping_set,
-            aggregates,
-            vec![None],
-            merge,
-            input_schema,
-        )?);
-
-        let result =
-            common::collect(merged_aggregate.execute(0, task_ctx.clone())?).await?;
-        let batch = concat_batches(&result[0].schema(), &result)?;
-        assert_eq!(batch.num_columns(), 3);
-        assert_eq!(batch.num_rows(), 12);
-
-        let expected = vec![
-            "+---+-----+----------+",
-            "| a | b   | COUNT(1) |",
-            "+---+-----+----------+",
-            "|   | 1.0 | 2        |",
-            "|   | 2.0 | 2        |",
-            "|   | 3.0 | 2        |",
-            "|   | 4.0 | 2        |",
-            "| 2 |     | 2        |",
-            "| 2 | 1.0 | 2        |",
-            "| 3 |     | 3        |",
-            "| 3 | 2.0 | 2        |",
-            "| 3 | 3.0 | 1        |",
-            "| 4 |     | 3        |",
-            "| 4 | 3.0 | 1        |",
-            "| 4 | 4.0 | 2        |",
-            "+---+-----+----------+",
-        ];
-
-        assert_batches_sorted_eq!(&expected, &result);
-
-        let metrics = merged_aggregate.metrics().unwrap();
-        let output_rows = metrics.output_rows().unwrap();
-        assert_eq!(12, output_rows);
-
-        Ok(())
-    }
+    // async fn check_grouping_sets(

Review Comment:
   I think we should either port or remove these tests -- probably port them, right?



##########
datafusion/physical-plan/src/windows/mod.rs:
##########
@@ -749,7 +749,7 @@ mod tests {
         let refs = blocking_exec.refs();
         let window_agg_exec = Arc::new(WindowAggExec::try_new(
             vec![create_window_expr(
-                &WindowFunctionDefinition::AggregateFunction(AggregateFunction::Count),
+                &WindowFunctionDefinition::AggregateUDF(count_udaf()),

Review Comment:
   nice



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate`, update MSRV to rust 1.75 [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#issuecomment-2164097460

   Thanks @alamb !


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1599247898


##########
datafusion/physical-expr-common/src/aggregate/groups_accumulator/accumulate.rs:
##########
@@ -0,0 +1,113 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use arrow::{array::BooleanArray, buffer::NullBuffer};
+
+/// This function is called to update the accumulator state per row
+/// when the value is not needed (e.g. COUNT)
+///
+/// # Arguments:
+///
+/// * `group_indices`:  To which groups do the rows in `values` belong, (aka group_index)
+/// * `opt_filter`: if present, only rows for which is Some(true) are included
+/// * `index_fn`: `F` invoked like `value_fn(group_index) for all non null values
+/// passing the filter. Note that no tracking is done for null inputs
+/// or which groups have seen any values
+/// 
+/// See `NullState::accumulate`, for more details on other
+/// arguments.
+pub fn accumulate_indices<F>(

Review Comment:
   moved, no change



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate`, update MSRV to rust 1.75 [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 merged PR #10484:
URL: https://github.com/apache/datafusion/pull/10484


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1599247532


##########
datafusion/physical-expr-common/src/aggregate/count_distinct/mod.rs:
##########
@@ -0,0 +1,23 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+mod bytes;

Review Comment:
   These will move to `functions-aggregate` after builtin is removed.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1626731683


##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -1312,160 +1311,160 @@ mod tests {
         Arc::new(task_ctx)
     }
 
-    async fn check_grouping_sets(
-        input: Arc<dyn ExecutionPlan>,
-        spill: bool,
-    ) -> Result<()> {
-        let input_schema = input.schema();
-
-        let grouping_set = PhysicalGroupBy {
-            expr: vec![
-                (col("a", &input_schema)?, "a".to_string()),
-                (col("b", &input_schema)?, "b".to_string()),
-            ],
-            null_expr: vec![
-                (lit(ScalarValue::UInt32(None)), "a".to_string()),
-                (lit(ScalarValue::Float64(None)), "b".to_string()),
-            ],
-            groups: vec![
-                vec![false, true],  // (a, NULL)
-                vec![true, false],  // (NULL, b)
-                vec![false, false], // (a,b)
-            ],
-        };
-
-        let aggregates: Vec<Arc<dyn AggregateExpr>> = vec![Arc::new(Count::new(
-            lit(1i8),
-            "COUNT(1)".to_string(),
-            DataType::Int64,
-        ))];
-
-        let task_ctx = if spill {
-            new_spill_ctx(4, 1000)
-        } else {
-            Arc::new(TaskContext::default())
-        };
-
-        let partial_aggregate = Arc::new(AggregateExec::try_new(
-            AggregateMode::Partial,
-            grouping_set.clone(),
-            aggregates.clone(),
-            vec![None],
-            input,
-            input_schema.clone(),
-        )?);
-
-        let result =
-            common::collect(partial_aggregate.execute(0, task_ctx.clone())?).await?;
-
-        let expected = if spill {
-            vec![
-                "+---+-----+-----------------+",
-                "| a | b   | COUNT(1)[count] |",
-                "+---+-----+-----------------+",
-                "|   | 1.0 | 1               |",
-                "|   | 1.0 | 1               |",
-                "|   | 2.0 | 1               |",
-                "|   | 2.0 | 1               |",
-                "|   | 3.0 | 1               |",
-                "|   | 3.0 | 1               |",
-                "|   | 4.0 | 1               |",
-                "|   | 4.0 | 1               |",
-                "| 2 |     | 1               |",
-                "| 2 |     | 1               |",
-                "| 2 | 1.0 | 1               |",
-                "| 2 | 1.0 | 1               |",
-                "| 3 |     | 1               |",
-                "| 3 |     | 2               |",
-                "| 3 | 2.0 | 2               |",
-                "| 3 | 3.0 | 1               |",
-                "| 4 |     | 1               |",
-                "| 4 |     | 2               |",
-                "| 4 | 3.0 | 1               |",
-                "| 4 | 4.0 | 2               |",
-                "+---+-----+-----------------+",
-            ]
-        } else {
-            vec![
-                "+---+-----+-----------------+",
-                "| a | b   | COUNT(1)[count] |",
-                "+---+-----+-----------------+",
-                "|   | 1.0 | 2               |",
-                "|   | 2.0 | 2               |",
-                "|   | 3.0 | 2               |",
-                "|   | 4.0 | 2               |",
-                "| 2 |     | 2               |",
-                "| 2 | 1.0 | 2               |",
-                "| 3 |     | 3               |",
-                "| 3 | 2.0 | 2               |",
-                "| 3 | 3.0 | 1               |",
-                "| 4 |     | 3               |",
-                "| 4 | 3.0 | 1               |",
-                "| 4 | 4.0 | 2               |",
-                "+---+-----+-----------------+",
-            ]
-        };
-        assert_batches_sorted_eq!(expected, &result);
-
-        let groups = partial_aggregate.group_expr().expr().to_vec();
-
-        let merge = Arc::new(CoalescePartitionsExec::new(partial_aggregate));
-
-        let final_group: Vec<(Arc<dyn PhysicalExpr>, String)> = groups
-            .iter()
-            .map(|(_expr, name)| Ok((col(name, &input_schema)?, name.clone())))
-            .collect::<Result<_>>()?;
-
-        let final_grouping_set = PhysicalGroupBy::new_single(final_group);
-
-        let task_ctx = if spill {
-            new_spill_ctx(4, 3160)
-        } else {
-            task_ctx
-        };
-
-        let merged_aggregate = Arc::new(AggregateExec::try_new(
-            AggregateMode::Final,
-            final_grouping_set,
-            aggregates,
-            vec![None],
-            merge,
-            input_schema,
-        )?);
-
-        let result =
-            common::collect(merged_aggregate.execute(0, task_ctx.clone())?).await?;
-        let batch = concat_batches(&result[0].schema(), &result)?;
-        assert_eq!(batch.num_columns(), 3);
-        assert_eq!(batch.num_rows(), 12);
-
-        let expected = vec![
-            "+---+-----+----------+",
-            "| a | b   | COUNT(1) |",
-            "+---+-----+----------+",
-            "|   | 1.0 | 2        |",
-            "|   | 2.0 | 2        |",
-            "|   | 3.0 | 2        |",
-            "|   | 4.0 | 2        |",
-            "| 2 |     | 2        |",
-            "| 2 | 1.0 | 2        |",
-            "| 3 |     | 3        |",
-            "| 3 | 2.0 | 2        |",
-            "| 3 | 3.0 | 1        |",
-            "| 4 |     | 3        |",
-            "| 4 | 3.0 | 1        |",
-            "| 4 | 4.0 | 2        |",
-            "+---+-----+----------+",
-        ];
-
-        assert_batches_sorted_eq!(&expected, &result);
-
-        let metrics = merged_aggregate.metrics().unwrap();
-        let output_rows = metrics.output_rows().unwrap();
-        assert_eq!(12, output_rows);
-
-        Ok(())
-    }
+    // async fn check_grouping_sets(

Review Comment:
   oops, I forgot this



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#issuecomment-2161856159

   > This PR has several conflicts -- other than those, do you think this PR is ready for another review @jayzhan211 ?
   
   Yes, it is ready for review.


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#issuecomment-2145953831

   I will try and review this tomorrow


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#issuecomment-2148558094

   > I am not sure about the MSRV changes (why are those needed?) 
   
   I keep failing with the MSRV check in the CI, so I upgrade the version of it. https://github.com/apache/datafusion/actions/runs/9351098969/job/25736034103


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1599247532


##########
datafusion/physical-expr-common/src/aggregate/count_distinct/mod.rs:
##########
@@ -0,0 +1,23 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+mod bytes;

Review Comment:
   We can move it to `functions-aggregate` after builtin is removed.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1624466476


##########
datafusion-cli/Cargo.toml:
##########
@@ -26,7 +26,7 @@ license = "Apache-2.0"
 homepage = "https://datafusion.apache.org"
 repository = "https://github.com/apache/datafusion"
 # Specify MSRV here as `cargo msrv` doesn't support workspace version
-rust-version = "1.73"
+rust-version = "1.78"

Review Comment:
   I change to 1.78 aka stable version to fix the msrv failure, I'm not sure is it the right way to fix that error.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1626224232


##########
datafusion-cli/Cargo.toml:
##########
@@ -26,7 +26,7 @@ license = "Apache-2.0"
 homepage = "https://datafusion.apache.org"
 repository = "https://github.com/apache/datafusion"
 # Specify MSRV here as `cargo msrv` doesn't support workspace version
-rust-version = "1.73"
+rust-version = "1.78"

Review Comment:
   I think per the policy we need to support
   https://github.com/apache/datafusion?tab=readme-ov-file#rust-version-compatibility-policy
   
   we can only update to `1.75` (which is 6 months old)
   https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1750-2023-12-28



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#issuecomment-2149359916

   ```
   error: package `clap_builder v4.5.2` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.73.0
   Either upgrade to rustc 1.74 or newer, or use
   cargo update -p clap_builder@4.5.2 --precise ver
   where `ver` is the latest version of `clap_builder` supporting rustc 1.73.0
   ```
   
   `clap_builder` needs 1.74, which used in `criterion v0.5.1`
   
   ```
   │   │   ├── petgraph v0.6.5
   │   │   │   ├── fixedbitset v0.4.2
   │   │   │   └── indexmap v2.2.6 (*)
   │   │   └── regex v1.10.4 (*)
   │   │   [dev-dependencies]
   │   │   ├── arrow v51.0.0 (*)
   │   │   ├── criterion v0.5.1
   │   │   │   ├── anes v0.1.6
   │   │   │   ├── cast v0.3.0
   │   │   │   ├── ciborium v0.2.2
   │   │   │   │   ├── ciborium-io v0.2.2
   │   │   │   │   ├── ciborium-ll v0.2.2
   │   │   │   │   │   ├── ciborium-io v0.2.2
   │   │   │   │   │   └── half v2.4.1 (*)
   │   │   │   │   └── serde v1.0.203 (*)
   │   │   │   ├── clap v4.5.4
   │   │   │   │   ├── clap_builder v4.5.2
   │   │   │   │   │   ├── anstream v0.6.14 (*)
   │   │   │   │   │   ├── anstyle v1.0.7
   │   │   │   │   │   ├── clap_lex v0.7.0
   │   │   │   │   │   └── strsim v0.11.1
   │   │   │   │   └── clap_derive v4.5.4 (proc-macro)
   │   │   │   │       ├── heck v0.5.0
   │   │   │   │       ├── proc-macro2 v1.0.85 (*)
   │   │   │   │       ├── quote v1.0.36 (*)
   │   │   │   │       └── syn v2.0.66 (*)
   
   ```


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#issuecomment-2161052429

   This PR has several conflicts -- other than those, do you think this PR is ready for another review @jayzhan211 ?


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate` [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1599247532


##########
datafusion/physical-expr-common/src/aggregate/count_distinct/mod.rs:
##########
@@ -0,0 +1,23 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+mod bytes;

Review Comment:
   We can move it to `functions-aggregate` after builtin is removed.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Move `Count` to `functions-aggregate`, update MSRV to rust 1.75 [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #10484:
URL: https://github.com/apache/datafusion/pull/10484#discussion_r1637185178


##########
Cargo.toml:
##########
@@ -52,7 +52,7 @@ homepage = "https://datafusion.apache.org"
 license = "Apache-2.0"
 readme = "README.md"
 repository = "https://github.com/apache/datafusion"
-rust-version = "1.73"
+rust-version = "1.75"

Review Comment:
   By my reading of https://github.com/apache/datafusion?tab=readme-ov-file#rust-version-compatibility-policy
   
   is that since 1.74 was [released in Nov 2023](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1740-2023-11-16), we can safely update in this PR



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org