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

Add binary coercion in like #7349

Closed
wants to merge 1 commit into from
Closed

Add binary coercion in like #7349

wants to merge 1 commit into from

Conversation

JayjeetAtGithub
Copy link
Contributor

@JayjeetAtGithub JayjeetAtGithub commented Aug 21, 2023

Which issue does this PR close?

Fixes #7342

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added logical-expr Logical plan and expressions physical-expr Physical Expressions and removed physical-expr Physical Expressions labels Aug 21, 2023
@alamb
Copy link
Contributor

alamb commented Aug 21, 2023

The code looks good -- this PR also needs a test

You can use the arrow_cast function to create binary columns and there are some examples of using the binary column data type in https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files/binary.slt

@@ -680,6 +680,7 @@ pub fn like_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option<DataTyp
string_coercion(lhs_type, rhs_type)
.or_else(|| dictionary_coercion(lhs_type, rhs_type, false))
.or_else(|| null_coercion(lhs_type, rhs_type))
.or_else(|| binary_coercion(lhs_type, rhs_type))
Copy link
Member

Choose a reason for hiding this comment

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

This coerces string to binary, but currently Like expr only works on string array. I saw you did a commit which adds binary support to Like but it was removed.

@JayjeetAtGithub
Copy link
Contributor Author

Actually this does not work, I am trying to figure it out. Will post updates soon.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: There isn't a common type to coerce Binary and Utf8 in LIKE expression
3 participants