-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
UDAF refactor: Add PhysicalExpr trait dependency on datafusion-expr
and remove logical expressions requirement for creating physical aggregate expression
#11845
Changes from 12 commits
f9c2087
51350d4
1bf175b
d9c204f
bf394cc
a2e4cba
4a63405
c4f485c
f218184
c26e4d5
366f2bf
a90b28e
93a514e
3841736
5ef93e1
4b22995
e7f0edc
cfd1734
061d4dd
c8846a6
87b5d42
b1a15db
8fc4f7f
b76b8f0
0c19a8d
7226889
8d330fa
96b72e8
57b0477
4943b40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,43 @@ | ||||||
# 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. | ||||||
|
||||||
[package] | ||||||
name = "datafusion-expr-common" | ||||||
description = "Logical plan and expression representation for DataFusion query engine" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we could adjust this to say it had commonly shared types
Suggested change
|
||||||
keywords = ["datafusion", "logical", "plan", "expressions"] | ||||||
readme = "README.md" | ||||||
version = { workspace = true } | ||||||
edition = { workspace = true } | ||||||
homepage = { workspace = true } | ||||||
repository = { workspace = true } | ||||||
license = { workspace = true } | ||||||
authors = { workspace = true } | ||||||
rust-version = { workspace = true } | ||||||
|
||||||
[lints] | ||||||
workspace = true | ||||||
|
||||||
[lib] | ||||||
name = "datafusion_expr_common" | ||||||
path = "src/lib.rs" | ||||||
|
||||||
[features] | ||||||
|
||||||
[dependencies] | ||||||
arrow = { workspace = true } | ||||||
datafusion-common = { workspace = true } | ||||||
paste = "^1.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
//! Vectorized [`GroupsAccumulator`] | ||
|
||
use arrow_array::{ArrayRef, BooleanArray}; | ||
use arrow::array::{ArrayRef, BooleanArray}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
use datafusion_common::{not_impl_err, Result}; | ||
|
||
/// Describes how many rows should be emitted during grouping. | ||
|
@@ -75,7 +75,7 @@ impl EmitTo { | |
/// expected that each `GroupAccumulator` will use something like `Vec<..>` | ||
/// to store the group states. | ||
/// | ||
/// [`Accumulator`]: crate::Accumulator | ||
/// [`Accumulator`]: crate::accumulator::Accumulator | ||
/// [Aggregating Millions of Groups Fast blog]: https://arrow.apache.org/blog/2023/08/05/datafusion_fast_grouping/ | ||
pub trait GroupsAccumulator: Send { | ||
/// Updates the accumulator's state from its arguments, encoded as | ||
|
@@ -140,7 +140,7 @@ pub trait GroupsAccumulator: Send { | |
/// See [`Self::evaluate`] for details on the required output | ||
/// order and `emit_to`. | ||
/// | ||
/// [`Accumulator::state`]: crate::Accumulator::state | ||
/// [`Accumulator::state`]: crate::accumulator::Accumulator::state | ||
fn state(&mut self, emit_to: EmitTo) -> Result<Vec<ArrayRef>>; | ||
|
||
/// Merges intermediate state (the output from [`Self::state`]) | ||
|
@@ -197,7 +197,7 @@ pub trait GroupsAccumulator: Send { | |
/// state directly to the next aggregation phase with minimal processing | ||
/// using this method. | ||
/// | ||
/// [`Accumulator::state`]: crate::Accumulator::state | ||
/// [`Accumulator::state`]: crate::accumulator::Accumulator::state | ||
fn convert_to_state( | ||
&self, | ||
_values: &[ArrayRef], | ||
|
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.