-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
f9c2087
init draft
jayzhan211 51350d4
production ready
jayzhan211 1bf175b
cleanup
jayzhan211 d9c204f
Merge branch 'main' of https://github.com/apache/datafusion into udaf…
jayzhan211 bf394cc
fix merge conflict
jayzhan211 a2e4cba
mv accumulator out
jayzhan211 4a63405
fix doc
jayzhan211 c4f485c
Merge branch 'main' of https://github.com/apache/datafusion into udaf…
jayzhan211 f218184
rename
jayzhan211 c26e4d5
fix test
jayzhan211 366f2bf
fix test
jayzhan211 a90b28e
doc
jayzhan211 93a514e
fix doc and cleanup
jayzhan211 3841736
fix doc
jayzhan211 5ef93e1
clippy + doc
jayzhan211 4b22995
cleanup
jayzhan211 e7f0edc
cleanup
jayzhan211 cfd1734
rename exprs
jayzhan211 061d4dd
rm create_aggregate_expr_with_dfschema
jayzhan211 c8846a6
revert change in calc_requirements
jayzhan211 87b5d42
fmt
jayzhan211 b1a15db
doc and cleanup
jayzhan211 8fc4f7f
Merge branch 'main' of https://github.com/apache/datafusion into udaf…
jayzhan211 b76b8f0
rm dfschema
jayzhan211 0c19a8d
rm input types
jayzhan211 7226889
rename return_type
jayzhan211 8d330fa
upd doc
jayzhan211 96b72e8
move group accumulator adapter to functions-aggregate-common
jayzhan211 57b0477
Merge branch 'main' of https://github.com/apache/datafusion into udaf…
jayzhan211 4943b40
fix
jayzhan211 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
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" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe we could adjust this to say it had commonly shared types