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 Utf8->Binary type coercion for comparison #7080

Merged
merged 4 commits into from
Jul 25, 2023
Merged

Add Utf8->Binary type coercion for comparison #7080

merged 4 commits into from
Jul 25, 2023

Conversation

jonahgao
Copy link
Member

@jonahgao jonahgao commented Jul 25, 2023

Which issue does this PR close?

Partial fix for #7039.

Closes #7039

Rationale for this change

The following casts should be safe:

  • Utf8 -> Binary
  • Utf8 | LargetUtf8 | Binary -> LargeBinary

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jul 25, 2023
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 @jonahgao ❤️

I took the liberty of merging up from main to get a fix for CI failures and pushed a small sql level test in sqllogictests

Copy link
Member

@jackwener jackwener 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 @jonahgao

Comment on lines 776 to 782
(LargeBinary, LargeBinary)
| (Binary, LargeBinary)
| (LargeBinary, Binary)
| (Utf8, LargeBinary)
| (LargeBinary, Utf8)
| (LargeUtf8, LargeBinary)
| (LargeBinary, LargeUtf8) => Some(LargeBinary),
Copy link
Member

Choose a reason for hiding this comment

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

we can use

(LargeBinary, Utf8 | LargeUtf8 | Binary | LargeBinary) | (Utf8 | LargeUtf8 | Binary | LargeBinary, LargeBinary)

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated. Thank you @jackwener ❤️

@jonahgao
Copy link
Member Author

Thanks @jonahgao ❤️

I took the liberty of merging up from main to get a fix for CI failures and pushed a small sql level test in sqllogictests

Thank you @alamb ❤️

@alamb alamb merged commit 52cf58b into apache:main Jul 25, 2023
@jonahgao jonahgao deleted the binary_type_coercion branch July 26, 2023 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error with partitioned dataset: Cannot infer common argument type for comparison operation Binary != Utf8
3 participants