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

Changes INT/INTEGER to be an alias for INT4 #1473

Merged
merged 1 commit into from
May 30, 2024
Merged

Changes INT/INTEGER to be an alias for INT4 #1473

merged 1 commit into from
May 30, 2024

Conversation

RCHowell
Copy link
Member

@RCHowell RCHowell commented May 29, 2024

Relevant Issues

#1471

Description

Details are in the linked issue. Effectively this PR makes INT an alias for INT4. Today, the typing and handling of the 32-bit integer is covered by INT4, but we have (for historical reasons) had INT as the Ion unbounded integer. This has created a situation in which INT != INT4 and INT has no precision whereas BIGINT does; therefore BIGINT < INT.

The other systems we integrate with all have INT = INT4 because SQL dictates you must have a bound precision for the INTEGER type and pretty much every implementation uses 32-bit precision.

Update

SMALLINT    -> 16-bit
INT         -> 32-bit
BIGINT      -> 64-bit

Now, this PR is a somewhat sly half-measure by making INT an alias to INT4 so that I don't have to change any planning/typing logic. John is working on updates to typing logic now, so I've simply made a tiny parser change. For version 1.0 we will flip this and make INT4 an alias for INT.

For the unbounded integer in other systems, we use DECIMAL(38,0) as this is typically the maximum size (e.g. Presto, Snowflake, SQL Server, Impala) but some allow higher precision (postgres).

Other Information

  • Updated Unreleased Section in CHANGELOG: [YES/NO]
    Yes

  • Any backward-incompatible changes? [YES/NO]
    Yes, behavioral change. Detailed note in changelog.

  • Any new external dependencies? [YES/NO]
    No

  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? [YES/NO]
    YEs

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@RCHowell RCHowell requested a review from johnedquinn May 29, 2024 01:19
@RCHowell RCHowell merged commit a2d5398 into main May 30, 2024
10 checks passed
@RCHowell RCHowell deleted the int-fix branch May 30, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants