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

Fallback to Utf8View for Dict(_, Utf8View) in type_union_resolution_coercion #14602

Merged
merged 6 commits into from
Feb 13, 2025

Conversation

jayzhan211
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

utf8view is good enough, there is no reason we need dict(_, utf8view).

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Copy link

@davidhewitt davidhewitt 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 fixing this!

new_value_type.map(|t| DataType::Dictionary(index_type.clone(), Box::new(t)))
match type_union_resolution_coercion(value_type, other_type) {
// Dict(k, Utf8View) is redundant, Utf8View is good enough
Some(DataType::Utf8View) => Some(DataType::Utf8View),

Choose a reason for hiding this comment

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

Possibly also true for binary views (even if I didn't report in my original issue)?

@jayzhan211 jayzhan211 changed the title Fallback to Utf8View for Dict(_, Utf8View) in type_union_resolution_coercion Fallback to Value type for Dict(_, ViewType) in type_union_resolution_coercion Feb 11, 2025
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.

Could we get some tests for this as well?

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Feb 11, 2025
@jayzhan211 jayzhan211 changed the title Fallback to Value type for Dict(_, ViewType) in type_union_resolution_coercion Fallback to Utf8View for Dict(_, Utf8View) in type_union_resolution_coercion Feb 11, 2025
@jayzhan211
Copy link
Contributor Author

It seems binary view is problematic, so I remove it for now. Add it if there is test covered

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.

Thank you @jayzhan211 and @davidhewitt

@alamb alamb merged commit 28856e1 into apache:main Feb 13, 2025
24 checks passed
@jayzhan211 jayzhan211 deleted the utf8view-dict-fix branch February 13, 2025 11:05
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.

coercion of input types in coalesce leads to type unsupported arrow cast
3 participants