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

Support Utf8View to numeric coercion #14377

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

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jan 30, 2025

Which issue does this PR close?

Rationale for this change

This allows Stringview to be compared to numeric values, consistently with normal stirngs

What changes are included in this PR?

  1. add tests for coercion (both numeric as well as date/time coercion)

Are these changes tested?

Yes unit tests are

Are there any user-facing changes?

Yes, queries that work with Utf8 will now also work with Utf8View

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jan 30, 2025
@alamb alamb changed the title Alamb/string view coercion Support Utf8View to numeric coercsion Jan 30, 2025
@alamb alamb changed the title Support Utf8View to numeric coercsion Support Utf8View to numeric coercion Jan 30, 2025
@@ -684,8 +684,10 @@ fn string_numeric_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option<D
match (lhs_type, rhs_type) {
(Utf8, _) if rhs_type.is_numeric() => Some(Utf8),
(LargeUtf8, _) if rhs_type.is_numeric() => Some(LargeUtf8),
(Utf8View, _) if rhs_type.is_numeric() => Some(Utf8View),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the only code change

@Omega359
Copy link
Contributor

Looking good, thx for putting this together

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants