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

Added support for char_length #212

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

YannisBres
Copy link
Contributor

@YannisBres YannisBres commented Dec 15, 2023

This PR adds a string-related scalar function mapping in FunctionMappings to support generating plans for queries that use the char_length function.
It also introduces very basic unit tests for string-related functions, including the newly supported char_length one.

test: added tests for string functions
@CLAassistant
Copy link

CLAassistant commented Dec 15, 2023

CLA assistant check
All committers have signed the CLA.

}

@ParameterizedTest
@ValueSource(strings = {"vc32"})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the || concatenation operator fails on CHAR columns with "IllegalArgumentException: Unable to convert call ||(char<16>?, char<16>?) at RexExpressionConverter.visitCall(RexExpressionConverter.java:83)".
This should be investigated.


@ParameterizedTest
@ValueSource(strings = {"c16", "vc32"})
void charLength(String column) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

I made a very small change here: char_length -> charLength

Copy link
Contributor Author

Choose a reason for hiding this comment

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

6 months of *&#@$%! Go and I forgot good ol' Java conventions. What a shame! 😉

Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Thanks for adding this mapping, and also for the additional tests for other string functions!

@vbarua vbarua merged commit 7424483 into substrait-io:main Dec 18, 2023
8 checks passed
@YannisBres YannisBres deleted the yannis.bres/char_length branch December 18, 2023 16:15
ajegou pushed a commit to ajegou/substrait-java that referenced this pull request Mar 29, 2024
test: added tests for string functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants