-
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
Use LogicalType for TypeSignature Numeric
and String
, Coercible
#13240
Open
jayzhan211
wants to merge
13
commits into
apache:main
Choose a base branch
from
jayzhan211:logical-signature
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+191
−115
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
30be8a0
use logical type for signature
jayzhan211 4b6d433
fmt & clippy
jayzhan211 5cb2aa9
numeric
jayzhan211 c9ac3c5
fix numeric
jayzhan211 ec65ca1
deprecate coercible
jayzhan211 1aba4cb
introduce numeric and numeric string
jayzhan211 acd2ceb
fix doc
jayzhan211 3855c6f
cleanup
jayzhan211 804242c
add back coercible
jayzhan211 793b0da
rename
jayzhan211 2cfa273
fmt
jayzhan211 6e97cb1
rm numeric string signature
jayzhan211 99f2cd3
typo
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
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 |
---|---|---|
|
@@ -33,8 +33,8 @@ use datafusion_expr::aggregate_doc_sections::DOC_SECTION_GENERAL; | |
use datafusion_expr::function::{AccumulatorArgs, StateFieldsArgs}; | ||
use datafusion_expr::utils::{format_state_name, AggregateOrderSensitivity}; | ||
use datafusion_expr::{ | ||
Accumulator, AggregateUDFImpl, ArrayFunctionSignature, Documentation, Expr, | ||
ExprFunctionExt, Signature, SortExpr, TypeSignature, Volatility, | ||
Accumulator, AggregateUDFImpl, Documentation, Expr, ExprFunctionExt, Signature, | ||
SortExpr, Volatility, | ||
}; | ||
use datafusion_functions_aggregate_common::utils::get_sort_options; | ||
use datafusion_physical_expr_common::sort_expr::{LexOrdering, LexOrderingRef}; | ||
|
@@ -79,15 +79,7 @@ impl Default for FirstValue { | |
impl FirstValue { | ||
pub fn new() -> Self { | ||
Self { | ||
signature: Signature::one_of( | ||
vec![ | ||
// TODO: we can introduce more strict signature that only numeric of array types are allowed | ||
TypeSignature::ArraySignature(ArrayFunctionSignature::Array), | ||
TypeSignature::Numeric(1), | ||
TypeSignature::Uniform(1, vec![DataType::Utf8]), | ||
], | ||
Volatility::Immutable, | ||
), | ||
signature: Signature::any(1, Volatility::Immutable), | ||
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. Ideally first/last value get the first/last item in the column, so it should be the type of the column. I forgot why we don't use |
||
requirement_satisfied: false, | ||
} | ||
} | ||
|
@@ -406,15 +398,7 @@ impl Default for LastValue { | |
impl LastValue { | ||
pub fn new() -> Self { | ||
Self { | ||
signature: Signature::one_of( | ||
vec![ | ||
// TODO: we can introduce more strict signature that only numeric of array types are allowed | ||
TypeSignature::ArraySignature(ArrayFunctionSignature::Array), | ||
TypeSignature::Numeric(1), | ||
TypeSignature::Uniform(1, vec![DataType::Utf8]), | ||
], | ||
Volatility::Immutable, | ||
), | ||
signature: Signature::any(1, Volatility::Immutable), | ||
requirement_satisfied: false, | ||
} | ||
} | ||
|
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
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 can make a distinction between
Debug
andDisplay
. Currently, we print something likeI imagine we can print
Int32
toInt32
, printJSON
toJSON
... 🤔However, I think it may not be the point of this PR. We can do it in another PR.