diff --git a/lib/result/ArrowResultConverter.ts b/lib/result/ArrowResultConverter.ts index 57fa02af..b4f36fe6 100644 --- a/lib/result/ArrowResultConverter.ts +++ b/lib/result/ArrowResultConverter.ts @@ -205,7 +205,7 @@ export default class ArrowResultConverter implements IResultsProvider } // Return other values as is - return typeof value === 'bigint' ? Number(value) : value; + return value; } private convertThriftTypes(record: Record): any { diff --git a/lib/result/utils.ts b/lib/result/utils.ts index 4bbdf418..47de8351 100644 --- a/lib/result/utils.ts +++ b/lib/result/utils.ts @@ -49,12 +49,11 @@ function convertJSON(value: any, defaultValue: any): any { } function convertBigInt(value: any): any { - if (typeof value === 'bigint') { - return Number(value); - } if (value instanceof Int64) { - return value.toNumber(); + return BigInt(value.toString()); } + + // Do not convert a BigInt away from the BigInt type return value; }