trxcllnt commented on code in PR #379: URL: https://github.com/apache/arrow-js/pull/379#discussion_r2794596906
########## src/util/json.ts: ########## @@ -0,0 +1,28 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// @ts-ignore +import jsonBigInt from 'json-bigint'; + +const parseJSON = jsonBigInt({ useNativeBigInt: true }).parse; Review Comment: Should we use `useNativeBigInt: true` here? From the [Note on native BigInt support](https://www.npmjs.com/package/json-bigint#note-on-native-bigint-support) section of the readme, it seems BigInts are converted to JS Numbers, which doesn't seem correct? From the description it seems we might want to set `storeAsString: true` instead, since we're more concerned about accuracy, not trying to infer the value type based on the representation in the data. For example, we know the values in the IntervalMonthDayYear `DATA` array are 64-bit signed integers, regardless whether they're stored as strings in the JSON. Thoughts? -- 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]
