Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-14 Thread via GitHub
jayzhan211 merged PR #14532: URL: https://github.com/apache/datafusion/pull/14532 -- 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-unsubscr...@dat

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-14 Thread via GitHub
jayzhan211 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2659324140 Thanks @jkosh44 -- 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 comme

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-13 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2656959911 I think this might also be an API change? I don't have the permissions to add the tag though. -- This is an automated message from the Apache Git Service. To respond to the message

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-13 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2656668319 Thanks for the review @jayzhan211 and for all of your helpful feedback! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitH

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-13 Thread via GitHub
jayzhan211 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2656285292 `array_element` doesn't change the list so not coerce to list makes sense to me. -- This is an automated message from the Apache Git Service. To respond to the message, please l

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-12 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2655302737 > It might because of `array_coercion` you set for the function is incorrect 🤔 The query that fails is `array.slt:1221` which is ``` query IT select array_element(arro

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-12 Thread via GitHub
jayzhan211 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2655163076 > > It is because of this, I think we now only coerce to list if the flag is set > > Are you saying that the function should look something like this? > > ```rust

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-12 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1952948300 ## datafusion/functions-nested/src/array_has.rs: ## @@ -94,7 +94,7 @@ impl Default for ArrayHas { impl ArrayHas { pub fn new() -> Self { Self { -

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-12 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2654129469 > It is because of this, I think we now only coerce to list if the flag is set Are you saying that the function should look something like this? ```Rust fn array(

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-12 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1952912279 ## datafusion/expr-common/src/signature.rs: ## @@ -286,6 +258,72 @@ impl Display for ArrayFunctionSignature { } } +/// A wrapper around a vec of [`ArrayFun

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1951785203 ## datafusion/functions-nested/src/array_has.rs: ## @@ -94,7 +94,7 @@ impl Default for ArrayHas { impl ArrayHas { pub fn new() -> Self { Self { -

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1951783336 ## datafusion/functions-nested/src/array_has.rs: ## @@ -94,7 +94,7 @@ impl Default for ArrayHas { impl ArrayHas { pub fn new() -> Self { Self { -

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1951778634 ## datafusion/expr-common/src/signature.rs: ## @@ -286,6 +258,72 @@ impl Display for ArrayFunctionSignature { } } +/// A wrapper around a vec of [`Array

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2652335822 > get_valid_types() always coerces the outermost FixedSizeList to List, no matter what the value of the flag is. I'm pretty sure that matches existing behavior, but I don't fully

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1951358636 ## datafusion/functions-nested/src/remove.rs: ## @@ -98,7 +99,7 @@ impl ScalarUDFImpl for ArrayRemove { } fn return_type(&self, arg_types: &[DataType])

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1951358636 ## datafusion/functions-nested/src/remove.rs: ## @@ -98,7 +99,7 @@ impl ScalarUDFImpl for ArrayRemove { } fn return_type(&self, arg_types: &[DataType])

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2651638551 @jayzhan211 I just pushed a commit with your idea about adding a flag for array coercion. I'm feeling pretty good about the state of this PR, but I have the following two open questi

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950526095 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950529828 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950526095 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950529828 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950529828 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-11 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950526095 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950225082 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Has

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950125583 ## datafusion/functions-nested/src/remove.rs: ## @@ -98,7 +99,7 @@ impl ScalarUDFImpl for ArrayRemove { } fn return_type(&self, arg_types: &[DataTyp

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950111843 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950111843 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1950111843 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1949114839 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Has

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2648300594 > It might be a better approach to not modify the accepted argument types (i.e. don't convert `FixedSizeList` to `List` in `get_valid_types()`, and instead move the logic to `return_

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1949114839 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Has

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-10 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1949116013 ## datafusion/common/src/utils/mod.rs: ## @@ -602,26 +602,46 @@ pub fn base_type(data_type: &DataType) -> DataType { /// /// let data_type = DataType::List(Arc:

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-09 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1948299765 ## datafusion/common/src/utils/mod.rs: ## @@ -602,26 +602,46 @@ pub fn base_type(data_type: &DataType) -> DataType { /// /// let data_type = DataType::List(A

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-09 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1948299517 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-09 Thread via GitHub
jayzhan211 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1948299517 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd,

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-08 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1947908046 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,11 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Has

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-07 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1946590323 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,13 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Has

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-07 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1946583823 ## datafusion/common/src/utils/mod.rs: ## @@ -602,26 +602,46 @@ pub fn base_type(data_type: &DataType) -> DataType { /// /// let data_type = DataType::List(Arc:

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-06 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2641969506 > See this, [#13819 (comment)](https://github.com/apache/datafusion/issues/13819#issuecomment-2552554818). We only convert an inner fixed-size list to a regular list when the functio

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-06 Thread via GitHub
jayzhan211 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2641979167 > So it sounds like we need to include in the array signature whether or not the function might change the size of the list and use that information. yes -- This is an au

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-06 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1945901967 ## datafusion/expr-common/src/signature.rs: ## @@ -286,6 +261,34 @@ impl Display for ArrayFunctionSignature { } } +#[derive(Debug, Clone, PartialEq, Eq, Pa

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-06 Thread via GitHub
jkosh44 commented on code in PR #14532: URL: https://github.com/apache/datafusion/pull/14532#discussion_r1945901504 ## datafusion/expr-common/src/signature.rs: ## @@ -227,25 +226,11 @@ impl Display for TypeSignatureClass { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Has

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-06 Thread via GitHub
jayzhan211 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2641836978 See this, https://github.com/apache/datafusion/issues/13819#issuecomment-2552554818. We only convert an inner fixed-size list to a regular list when the function performs a mut

Re: [PR] function: Allow more expressive array signatures [datafusion]

2025-02-06 Thread via GitHub
jkosh44 commented on PR #14532: URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2641819030 This is failing CI for the following reason. Previously, in `get_valid_types()` functions with the array signature `ArrayAndIndexes` and `Array` would convert top level `Fixed

[PR] function: Allow more expressive array signatures [datafusion]

2025-02-06 Thread via GitHub
jkosh44 opened a new pull request, #14532: URL: https://github.com/apache/datafusion/pull/14532 This commit allows for more expressive array function signatures. Previously, `ArrayFunctionSignature` was an enum of potential argument combinations and orders. For many array functions, none of