Skip to content

Conversation

nickgerrets
Copy link
Contributor

@nickgerrets nickgerrets commented Nov 6, 2023

fixes #5328

This PR adds better support for casting from string to integers (including HUGEINT) when exponents and/or decimals are involved.

Examples:
'1.234e3'::INTEGER was previously evaluated to 1000 and is now evaluated to 1234.
'125e-1'::INTEGER was previously evaluated to 12 and is now evaluated to 13.
'150e-1'::TINYINT was previously considered a Conversion Error and is now evaluated to 15.

@Mytherin Mytherin added the Draft label Nov 8, 2023
@nickgerrets nickgerrets changed the base branch from main to feature November 8, 2023 14:22
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 more comments:

@github-actions github-actions bot marked this pull request as draft December 4, 2023 15:19
@nickgerrets nickgerrets marked this pull request as ready for review December 4, 2023 15:19
@github-actions github-actions bot marked this pull request as draft December 4, 2023 15:49
@nickgerrets nickgerrets marked this pull request as ready for review December 4, 2023 15:49
@github-actions github-actions bot marked this pull request as draft December 6, 2023 08:41
@nickgerrets nickgerrets marked this pull request as ready for review December 6, 2023 09:24
@nickgerrets nickgerrets requested a review from Mytherin December 6, 2023 12:48
@Mytherin Mytherin merged commit 18c88b7 into duckdb:main Dec 7, 2023
@Mytherin
Copy link
Collaborator

Mytherin commented Dec 7, 2023

Thanks!

@nickgerrets nickgerrets deleted the string_to_int branch December 8, 2023 08:49
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Dec 14, 2023
Merge pull request duckdb/duckdb#9581 from nickgerrets/string_to_int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String to HUGEINT cast bug
3 participants