aminghadersohi opened a new pull request, #44743:
URL: https://github.com/apache/superset/pull/44743

   ### SUMMARY
   
   A SQL Lab query fails outright when a result contains an integer above 
`2**63 - 1`, such as a MySQL, SingleStore or other MySQL-family `BIGINT 
UNSIGNED` value up to `18446744073709551615`. The error is:
   
   ```
   OverflowError: Python int too large to convert to C long
   ```
   
   `SupersetResultSet.__init__` builds each column with `pa.array(col_values)`. 
For these values PyArrow raises `OverflowError`, which is not among the 
exceptions that trigger the existing fallback to strings.
   
   This PR adds `OverflowError` to that list, so the affected column is 
stringified the way other values Arrow cannot represent already are. Strings 
are also the only way the grid can show such a value exactly, because a 
JavaScript number is precise only up to `2**53`. Other columns in the same 
result are unchanged.
   
   ### BEFORE/AFTER
   
   Before: the query errors and no rows are shown.
   After: the column is returned as strings (`"18446744073709551615"`, `"0"`, 
`None`); integer columns within int64 stay integers.
   
   ### TESTING INSTRUCTIONS
   
   - New unit test `test_integers_outside_int64_are_stringified` in 
`tests/unit_tests/result_set_test.py`. It fails on `master` with the 
`OverflowError` above and passes with this change.
   - Reproduced end to end against a local SingleStore 9.1.1 container: 
`SELECT` on a `BIGINT UNSIGNED` column holding `18446744073709551615` through 
`SupersetResultSet`.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to