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.
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
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.