Skip to content

Move starts_with, to_hex, trim, upper to datafusion-functions (and add string_expressions) #9541

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

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

Tangruilin
Copy link
Contributor

…tions

Which issue does this PR close?

Closes #9539 .

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @Tangruilin -- this is looking good.

The PR title says it moves 4 functions but the PR only moves one function (starts_with) -- this is good, but I think the title should be updated to reflect the change.

I think we also need to remove the existing BuiltInScalarFunction::StartsWith variant in the same PR

Comment on lines 90 to 92

#[cfg(test)]
mod tests {}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need an empty test module, do we?

Suggested change
#[cfg(test)]
mod tests {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need an empty test module, do we?

Sorry... This PR is only a draft now

@Tangruilin Tangruilin marked this pull request as draft March 12, 2024 01:48
@github-actions github-actions bot added logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates core Core DataFusion crate labels Mar 12, 2024
@github-actions github-actions bot added the sql SQL Planner label Mar 12, 2024
@Tangruilin Tangruilin force-pushed the task#9539 branch 3 times, most recently from de09b18 to 0171242 Compare March 14, 2024 17:17
@alamb
Copy link
Contributor

alamb commented Mar 19, 2024

Hi @Tangruilin -- I wonder how this PR is going?

@Tangruilin
Copy link
Contributor Author

Hi @Tangruilin -- I wonder how this PR is going?

I need to slove the conflicts, then the PR can be reviewed

This will be finished today

@Tangruilin Tangruilin marked this pull request as ready for review March 20, 2024 12:24
@github-actions github-actions bot removed the core Core DataFusion crate label Mar 20, 2024
@alamb alamb changed the title [task #9539] Move starts_with, to_hex, trim, upper to datafusion-func… Move starts_with, to_hex, trim, upper to datafusion-functions (and add string_expressions) Mar 20, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you so much @Tangruilin 🙏

default = [
"core_expressions",
"datetime_expressions",
"encoding_expressions",
"math_expressions",
"regex_expressions",
"crypto_expressions",
]
"string_expressions",
] # Enable encoding by default so the doctests work. In general don't automatically enable all packages.
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems strange the comment was moved down to the bottom. Shouldn't it still be at the top?

@@ -650,26 +650,6 @@ async fn test_fn_split_part() -> Result<()> {
Ok(())
}

#[tokio::test]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why these tests were removed. I think it is important that we can still use these functions with the dataframe API.

Copy link
Contributor

Choose a reason for hiding this comment

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

I poked around and this seems like it was because the string_functions expr_fn weren't exported. I took the liberty of fixing this in b803062

@alamb alamb merged commit 1d8a41b into apache:main Mar 20, 2024
@alamb
Copy link
Contributor

alamb commented Mar 20, 2024

Thanks again @Tangruilin

@Tangruilin Tangruilin deleted the task#9539 branch March 23, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move starts_with, to_hex, trim, upper to datafusion-functions
2 participants