You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/data-types.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The table below provides an overview of all data types supported by the Apache A
18
18
| 4 |[Binary](#binary)| ✅ | ✅ | ✅ |`Uint8Array`|
19
19
| 5 |[Utf8](#utf8)| ✅ | ✅ | ✅ |`string`|
20
20
| 6 |[Bool](#bool)| ✅ | ✅ | ✅ |`boolean`|
21
-
| 7 |[Decimal](#decimal)| ✅ | ✅ | ✅ |`number`, or `bigint`via the `useDecimalBigInt` flag |
21
+
| 7 |[Decimal](#decimal)| ✅ | ✅ | ✅ |`number`, or scaled integers via the `useDecimalInt` flag |
22
22
| 8 |[Date](#date)| ✅ | ✅ | ✅ |`number`, or `Date` via the `useDate` flag. |
23
23
| 9 |[Time](#time)| ✅ | ✅ | ✅ |`number`, or `bigint` for 64-bit values via the `useBigInt` flag |
24
24
| 10 |[Timestamp](#timestamp)| ✅ | ✅ | ✅ |`number`, or `Date` via the `useDate` flag. |
@@ -241,7 +241,7 @@ bool()
241
241
242
242
Create an Decimal data type instance for exact decimal values, represented as a 32, 64, 128, or 256-bit integer value in two's complement. Decimals are fixed point numbers with a set *precision* (total number of decimal digits) and *scale* (number of fractional digits). For example, the number `35.42` can be represented as `3542` with *precision* ≥ 4 and *scale* = 2.
243
243
244
-
By default, Flechette converts decimals to 64-bit floating point numbers upon extraction (e.g., mapping `3542` back to `35.42`). While useful for many downstream applications, this conversion may be lossy and introduce inaccuracies. Pass the `useDecimalBigInt` extraction option (e.g., to [`tableFromIPC`](/flechette/api/#tableFromIPC) or [`tableFromArrays`](/flechette/api/#tableFromArrays)) to instead extract decimal data as `BigInt` values (64-bit or larger decimals) or integer `number` values (32-bit decimals).
244
+
By default, Flechette converts decimals to 64-bit floating point numbers upon extraction (e.g., mapping `3542` back to `35.42`). While useful for many downstream applications, this conversion may be lossy and introduce inaccuracies. Pass the `useDecimalInt` extraction option (e.g., to [`tableFromIPC`](/flechette/api/#tableFromIPC) or [`tableFromArrays`](/flechette/api/#tableFromArrays)) to instead extract decimal data as `BigInt` values (64-bit or larger decimals) or integer `number` values (32-bit decimals).
245
245
246
246
**precision* (`number`): The total number of decimal digits that can be represented.
247
247
**scale* (`number`): The number of fractional digits, beyond the decimal point.
**options* (`ExtractionOptions`): Options for controlling how values are transformed when extracted from an Arrow binary representation.
24
24
**useBigInt* (`boolean`): If true, extract 64-bit integers as JavaScript `BigInt` values. Otherwise, coerce long integers to JavaScript number values (default `false`).
25
25
**useDate* (`boolean`): If true, extract dates and timestamps as JavaScript `Date` objects. Otherwise, return numerical timestamp values (default `false`).
26
-
**useDecimalBigInt* (`boolean`): If true, extract decimal-type data as BigInt values, where fractional digits are scaled to integers. Otherwise, return converted floating-point numbers (default`false`).
26
+
**useDecimalInt* (`boolean`): If true, extract decimal-type data as scaled integer values, where fractional digits are scaled to integer positions. Returned integers are `BigInt` values for decimal bit widths of 64 bits or higher and 32-bit integers (as JavaScript `number`) otherwise. If false, decimals are converted to floating-point numbers (default).
27
27
**useMap* (`boolean`): If true, extract Arrow 'Map' values as JavaScript `Map` instances. Otherwise, return an array of [key, value] pairs compatible with both `Map` and `Object.fromEntries` (default `false`).
28
28
**useProxy* (`boolean`): If true, extract Arrow 'Struct' values and table row objects using zero-copy proxy objects that extract data from underlying Arrow batches. The proxy objects can improve performance and reduce memory usage, but do not support property enumeration (`Object.keys`, `Object.values`, `Object.entries`) or spreading (`{ ...object }`). Otherwise, use standard JS objects for structs and table rows (default `false`).
0 commit comments