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

Refactor regexplike signature #13394

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jiashenC
Copy link
Contributor

Which issue does this PR close?

Close some tasks in #13301.

What changes are included in this PR?

Simplify function signature.

Are these changes tested?

Added more tests for implicit casting.

Are there any user-facing changes?

No

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) functions labels Nov 13, 2024
@jiashenC
Copy link
Contributor Author

@jayzhan211, I made some progress first for the RegExpLike function. In the original issue, you mentioned the signature can be replaced with Signature::string(2, Volatility::Immutable), but I do see this function can also accept 3 arguments. And this will fail tests like dataframe::dataframe_functions::test_fn_regexp_like. I wonder if I misunderstood something here?

@jayzhan211
Copy link
Contributor

jayzhan211 commented Nov 13, 2024

@jayzhan211, I made some progress first for the RegExpLike function. In the original issue, you mentioned the signature can be replaced with Signature::string(2, Volatility::Immutable), but I do see this function can also accept 3 arguments. And this will fail tests like dataframe::dataframe_functions::test_fn_regexp_like. I wonder if I misunderstood something here?

You can use one_of

signature: Signature::one_of(
                vec![
                    TypeSignature::String(2),
                    TypeSignature::String(3)
                ],
                Volatility::Immutable,
            ),

@jiashenC jiashenC marked this pull request as ready for review November 14, 2024 00:25
@jiashenC
Copy link
Contributor Author

@jayzhan211 thanks for the reply! I mark this as ready for review.

@jayzhan211
Copy link
Contributor

@jayzhan211 thanks for the reply! I mark this as ready for review.

You can run cargo test --test sqllogictests and ./dev/rust_lint.sh to cleanup CI

@github-actions github-actions bot removed the sqllogictest SQL Logic Tests (.slt) label Nov 15, 2024
@jiashenC jiashenC changed the title Refactor regexplife signature Refactor regexplike signature Nov 20, 2024
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants