Skip to content

fix: Widen Athena integer type mapping for unsigned ints - #6739

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
nikolauspschuetz:fix/athena-uint-widening
Aug 18, 2026
Merged

fix: Widen Athena integer type mapping for unsigned ints#6739
ntkathole merged 1 commit into
feast-dev:masterfrom
nikolauspschuetz:fix/athena-uint-widening

Conversation

@nikolauspschuetz

@nikolauspschuetz nikolauspschuetz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What

pa_to_athena_value_type in sdk/python/feast/type_map.py maps every unsigned Arrow int (uint8/uint16/uint32/uint64) to Athena tinyint. Athena tinyint is signed 8-bit (-128..127), so any unsigned value above 127 — e.g. a uint32 column — overflows the type in the generated CREATE TABLE DDL.

Fix

Widen each unsigned type to the next-larger signed Athena type that holds its full range (Athena has no unsigned integer types):

Arrow before after
uint8 tinyint smallint
uint16 tinyint int
uint32 tinyint bigint
uint64 tinyint bigint

Same widening arrow_to_pg_type already applies for Postgres. (pa_to_mssql_type keeps uint8->tinyint because SQL Server's tinyint is unsigned.) Signed inputs are unchanged.

Test

Regression test in sdk/python/tests/unit/test_type_map.py: fails before (assert 'tinyint' == 'smallint'), 2 passed after.


drafted with AI assistance; verified locally (red -> green on the added test).

@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.98%. Comparing base (602d752) to head (f70192f).
⚠️ Report is 6 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6739      +/-   ##
==========================================
+ Coverage   46.91%   46.98%   +0.06%     
==========================================
  Files         416      416              
  Lines       50545    50606      +61     
  Branches     7252     7262      +10     
==========================================
+ Hits        23714    23775      +61     
+ Misses      25157    25147      -10     
- Partials     1674     1684      +10     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.31% <ø> (+0.06%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/type_map.py 62.56% <ø> (+0.36%) ⬆️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 934d341...f70192f. Read the comment docs.

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

@nikolauspschuetz
nikolauspschuetz marked this pull request as ready for review August 16, 2026 15:12
@nikolauspschuetz
nikolauspschuetz requested a review from a team as a code owner August 16, 2026 15:12
pa_to_athena_value_type mapped every unsigned Arrow int (uint8/16/32/64)
to Athena tinyint, a signed 8-bit type (-128..127). Any unsigned value
above 127 (e.g. a uint32 column) overflows the type in the generated
CREATE TABLE DDL built by aws_utils.py.

Widen each unsigned type to the next-larger signed Athena type, matching
the widening already used for Postgres in arrow_to_pg_type in this module
(uint8->smallint, uint16->int, uint32/uint64->bigint). Signed inputs are
unchanged. Adds a regression test for both the widened and signed cases.

Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
@ntkathole
ntkathole force-pushed the fix/athena-uint-widening branch from 22d0661 to f70192f Compare August 18, 2026 04:41
@ntkathole
ntkathole merged commit 3425783 into feast-dev:master Aug 18, 2026
16 of 22 checks passed
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.

3 participants