Skip to content
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

minor: simplify union_extract code #14640

Merged
merged 3 commits into from
Feb 17, 2025
Merged

minor: simplify union_extract code #14640

merged 3 commits into from
Feb 17, 2025

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Feb 13, 2025

Which issue does this PR close?

Rationale for this change

There were a few simplifications I noticed while reviewing #12116 so I am

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added documentation Improvements or additions to documentation logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) functions labels Feb 13, 2025
@github-actions github-actions bot removed documentation Improvements or additions to documentation logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) labels Feb 14, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 14, 2025
@alamb alamb marked this pull request as ready for review February 14, 2025 16:47
@@ -113,22 +114,15 @@ impl ScalarUDFImpl for UnionExtractFun {
}

fn invoke_with_args(&self, args: ScalarFunctionArgs) -> Result<ColumnarValue> {
let args = args.args;
let [array, target_name] = take_function_args("union_extract", args.args)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

}
_ => ScalarValue::try_from(target.data_type())?,
Some((type_id, value)) if target_type_id == type_id => *value,
_ => ScalarValue::try_new_null(target.data_type())?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Feb 17, 2025
@xudong963 xudong963 merged commit e4b78c7 into apache:main Feb 17, 2025
24 checks passed
@alamb alamb deleted the union_extract branch February 19, 2025 12:21
@alamb
Copy link
Contributor Author

alamb commented Feb 19, 2025

Thanks @xudong963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants