Skip to content

Fill in missing utf8view support in function type coercion - #23916

Open
Jefffrey wants to merge 1 commit into
apache:mainfrom
Jefffrey:type-coercion-123
Open

Fill in missing utf8view support in function type coercion#23916
Jefffrey wants to merge 1 commit into
apache:mainfrom
Jefffrey:type-coercion-123

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Fill in some missing support for utf8view (and date64) in function type coercion. Main affected functions are UDFs that use exact/uniform type signature; for example in date_bin it couldnt coerce utf8view to its input types (even though utf8 worked)

What changes are included in this PR?

Add support for casting to/from utf8view in some arms.

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions Bot added logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) labels Jul 27, 2026
(
Timestamp(TimeUnit::Nanosecond, None),
Null | Timestamp(_, None) | Date32 | Utf8 | LargeUtf8,
Null | Timestamp(_, None) | Date32 | Date64 | Utf8 | LargeUtf8 | Utf8View,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added date64 for the sake of it, since we already have date32 here


# test with utf8view
query P
SELECT DATE_BIN(arrow_cast('5 month', 'Utf8View'), '2022-01-01T00:00:00Z');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this was failing on main before, just an example of what this fix can affect

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.66%. Comparing base (77b172e) to head (2114f83).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23916      +/-   ##
==========================================
- Coverage   80.67%   80.66%   -0.01%     
==========================================
  Files        1094     1095       +1     
  Lines      371770   372293     +523     
  Branches   371770   372293     +523     
==========================================
+ Hits       299907   300305     +398     
- Misses      53964    54067     +103     
- Partials    17899    17921      +22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coerced_from in functions.rs seems to be missing Utf8View in some cases

2 participants