Commit f258df4
committed
feat: add preserveBigNumericPrecision connection option (Thrift + SEA)
The result converter coerces DECIMAL to an IEEE-754 double and BIGINT to a JS
number, silently rounding high-precision decimals and integers beyond 2^53.
This affects BOTH backends (verified end-to-end on Thrift:
CAST('123456789012345.6789' AS DECIMAL(38,4)) -> 123456789012345.67;
CAST(9007199254740993 AS BIGINT) -> 9007199254740992).
Expose `preserveBigNumericPrecision` as a public ConnectionOption (default
false → existing representation preserved, non-breaking). When enabled, DECIMAL
is returned as an exact string and BIGINT as a JS `bigint`. Threaded through
ClientConfig to both the Thrift (ARROW_BASED / URL_BASED ArrowResultConverter)
and SEA operation backends. SeaOperationBackend now reads the option instead of
hardcoding it on.
Verified end-to-end on Thrift: OFF → 123456789012345.67 / 9007199254740992
(number); ON → "123456789012345.6789" (string) / 9007199254740993 (bigint).
Build (tsconfig.build.json) + unit tests + prettier + eslint pass.
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 0b75982 commit f258df4
5 files changed
Lines changed: 29 additions & 6 deletions
File tree
- lib
- contracts
- sea
- thrift-backend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
604 | 606 | | |
605 | 607 | | |
606 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
607 | 614 | | |
608 | 615 | | |
609 | 616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
767 | 767 | | |
768 | 768 | | |
769 | 769 | | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
775 | 774 | | |
776 | | - | |
| 775 | + | |
777 | 776 | | |
778 | 777 | | |
779 | 778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| 345 | + | |
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
| |||
0 commit comments