GeorgeLeePatterson opened a new pull request, #379:
URL: https://github.com/apache/arrow-js/pull/379

   
   ## Summary
   - fix "'`IntervalMonthDayNano` conversion to avoid `BigInt(number)` 
precision traps for unsafe integers
   - add regression coverage in 
`test/unit/vector/interval-month-day-nano-tests.ts` for known failing values 
from issue #15
   - add `parseArrowJSON()` (`src/util/json.ts`) to normalize unsafe integer 
`number` values from `json-bignum` into `BigNumber`
   - use `parseArrowJSON()` in JSON ingestion scripts:
     - `bin/json-to-arrow.ts`
     - `bin/integration.ts`
     - `src/bin/arrow2csv.ts`
   
   ## Rationale
   `json-bignum` can yield unsafe integers as `number` for values whose decimal 
text round-trips through `Number#toString()`. Passing those numbers directly 
into `BigInt(...)` can introduce nanosecond deltas in `IntervalMonthDayNano` 
integration comparisons.
   
   This PR removes that loss path in two places:
   1. conversion edge (`toIntervalMonthDayNanoInt32Array`)
   2. JSON parser boundary normalization (`parseArrowJSON`)
   
   ## Testing
   - `yarn eslint src/util/json.ts src/util/interval.ts src/bin/arrow2csv.ts 
test/unit/vector/interval-month-day-nano-tests.ts`
   - `yarn jest test/unit/vector/interval-month-day-nano-tests.ts --runInBand`
   - `yarn jest test/unit/vector --runInBand`
   
   ## Notes
   - Integration tests were not run locally.
   
   Ref: #15


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

Reply via email to