Skip to content

Conversation

Tishj
Copy link
Contributor

@Tishj Tishj commented Jan 27, 2025

This PR fixes https://github.com/duckdblabs/duckdb-internal/issues/3946

Similar to its younger brother TRY_CAST, the TRY expression will prevent errors from interrupting execution, instead turning the result into NULL.

@Tishj
Copy link
Contributor Author

Tishj commented Jan 27, 2025

@Mytherin I had the idea of turning the result type of TRY into a UNION(ok <child_type>, err VARCHAR), this has the benefit of preserving the context that an error actually occurred, and also which error this was.

Copy link
Collaborator

@Mytherin Mytherin 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 the PR! Looks good - some comments:

@duckdb-draftbot duckdb-draftbot marked this pull request as draft January 28, 2025 12:24
@Tishj Tishj marked this pull request as ready for review January 28, 2025 22:07
@duckdb-draftbot duckdb-draftbot marked this pull request as draft January 29, 2025 10:52
@Tishj Tishj marked this pull request as ready for review February 3, 2025 09:20
@duckdb-draftbot duckdb-draftbot marked this pull request as draft February 3, 2025 10:43
…message, using .ok we can replace the error message with a NULL"

This reverts commit aa41ef0.
@Tishj Tishj marked this pull request as ready for review February 3, 2025 23:03
Copy link
Collaborator

@Mytherin Mytherin 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 the fixes! Looks good - some minor comments remain otherwise this is good to go

@duckdb-draftbot duckdb-draftbot marked this pull request as draft February 12, 2025 15:05
@Mytherin Mytherin marked this pull request as ready for review February 12, 2025 16:47
@Mytherin Mytherin added the Needs Documentation Use for issues or PRs that require changes in the documentation label Feb 13, 2025
@Mytherin Mytherin merged commit ec1a7a7 into duckdb:main Feb 13, 2025
51 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

Antonov548 added a commit to Antonov548/duckdb-r that referenced this pull request Feb 27, 2025
krlmlr pushed a commit to duckdb/duckdb-r that referenced this pull request Mar 5, 2025
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 15, 2025
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 15, 2025
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 17, 2025
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Needs Documentation Use for issues or PRs that require changes in the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants