-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore: refactor array fn signatures & add more slt tests #17672
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
Conversation
List(field) | FixedSizeList(field, _) => match field.data_type() { | ||
List(field) => match field.data_type() { |
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.
Removed FixedSizeList
since signature should coerce it to List
vec![ | ||
TypeSignature::ArraySignature(ArrayFunctionSignature::Array { | ||
arguments: vec![ArrayFunctionArgument::Array], | ||
array_coercion: None, |
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.
No coercion here as the implementation natively supports FixedSizeList
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> { | ||
match &arg_types[0] { | ||
List(field) | FixedSizeList(field, _) => Ok(List(Arc::clone(field))), | ||
List(field) => Ok(List(Arc::clone(field))), |
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.
Same reason as flatten
|
||
# DuckDB: [4] | ||
# ClickHouse: Null | ||
# Since they dont have the same result, we just follow Postgres, return error |
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.
Removed this since the query doesn't seem to error (am I misunderstanding what the comment means 🤔 )
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.
Looks like a good change to me -- thanks @Jefffrey
Which issue does this PR close?
Part of #8249 and #8185
Rationale for this change
Some signature for nested functions are outdated and not using more robust/streamlined type signatures; also add more tests (specifically for
LargeList
andFixedSizeList
array types) for nested functions.What changes are included in this PR?
Refactor signatures of nested functions to be more streamlined and robust. Add more SLT tests for nested functions to ensure they work with
LargeList
andFixedSizeList
types. No expected behaviour change for these functions in this PR, just refactoring.Are these changes tested?
Existing SLT tests passed & added more tests.
Are there any user-facing changes?
No