Skip to content

update decimal.Decimal to *apd.Decimal#2643

Open
jennifersp wants to merge 20 commits into
mainfrom
jennifer/apd
Open

update decimal.Decimal to *apd.Decimal#2643
jennifersp wants to merge 20 commits into
mainfrom
jennifer/apd

Conversation

@jennifersp
Copy link
Copy Markdown
Contributor

@jennifersp jennifersp commented Apr 27, 2026

@jennifersp jennifersp requested a review from zachmu April 27, 2026 17:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Main PR
covering_index_scan_postgres 1344.45/s 1334.08/s -0.8%
index_join_postgres 188.57/s 186.04/s -1.4%
index_join_scan_postgres 197.16/s 195.72/s -0.8%
index_scan_postgres 12.15/s 12.23/s +0.6%
oltp_point_select 2490.54/s 2441.50/s -2.0%
oltp_read_only 1858.63/s 1857.88/s -0.1%
select_random_points 127.04/s 129.81/s +2.1%
select_random_ranges 1065.88/s 1068.93/s +0.2%
table_scan_postgres 11.67/s 11.98/s +2.6%
types_table_scan_postgres 5.35/s 5.55/s +3.7%

Copy link
Copy Markdown
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, but we need to standardize these values across all three packages. See specific comments.

Final PR should have tests of storing NaN, Infinity, etc. in column values and reading them back.

Comment thread server/expression/gms_cast.go Outdated
Comment thread server/functions/numeric.go Outdated
Comment thread server/functions/numeric.go Outdated
Comment thread server/functions/numeric.go Outdated
Comment thread server/functions/trunc.go
Comment thread server/types/numeric.go Outdated
Comment thread server/types/numeric.go Outdated
Comment thread server/types/numeric.go
Comment thread server/types/typeinfo.go Outdated
Comment thread testing/go/framework.go Outdated
@jennifersp jennifersp requested a review from zachmu May 5, 2026 23:03
@jennifersp jennifersp linked an issue May 5, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Main PR
Total 42090 42090
Successful 18017 18105
Failures 24073 23985
Partial Successes1 5372 5377
Main PR
Successful 42.8059% 43.0150%
Failures 57.1941% 56.9850%

${\color{lightgreen}Progressions (93)}$

float4

QUERY: SELECT 'nan'::numeric::float4;

float8

QUERY: SELECT 'nan'::numeric::float8;

numeric

QUERY: INSERT INTO num_exp_div VALUES (0,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (0,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (1,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (1,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (2,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (2,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (3,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (3,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (4,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (4,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (5,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (5,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (6,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (6,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (7,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (7,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (8,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (8,1,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (9,0,'NaN');
QUERY: INSERT INTO num_exp_div VALUES (9,1,'NaN');
QUERY: INSERT INTO num_exp_ln VALUES (0,'NaN');
QUERY: INSERT INTO num_exp_ln VALUES (1,'NaN');
QUERY: INSERT INTO num_exp_log10 VALUES (0,'NaN');
QUERY: INSERT INTO num_exp_log10 VALUES (1,'NaN');
QUERY: INSERT INTO num_exp_power_10_ln VALUES (0,'NaN');
QUERY: INSERT INTO num_exp_power_10_ln VALUES (1,'NaN');
QUERY: SELECT 'nan'::numeric / '0';
QUERY: SELECT 'nan'::numeric % '0';
QUERY: SELECT div('nan'::numeric, '0');
QUERY: WITH v(x) AS
  (VALUES('0'::numeric),('1'),('-1'),('4.2'),('-7.777'),('1e340'),('-1e340'),
         ('inf'),('-inf'),('nan'),
         ('inf'),('-inf'),('nan'))
SELECT substring(x::text, 1, 32)
FROM v ORDER BY x;
QUERY: SELECT power('-2'::numeric, '3');
QUERY: SELECT power('-2'::numeric, '3.3');
QUERY: SELECT power('-2'::numeric, '-1.5');
QUERY: SELECT power('inf'::numeric, '-2');
QUERY: SELECT power('inf'::numeric, '-inf');
QUERY: SELECT power('-inf'::numeric, '2');
QUERY: SELECT power('-inf'::numeric, '3');
QUERY: SELECT power('-inf'::numeric, '-2');

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

@jennifersp jennifersp changed the title update decimal.Decimal to apd.Decimal update decimal.Decimal to *apd.Decimal May 12, 2026
Copy link
Copy Markdown
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread server/functions/ln.go Outdated
Comment thread server/functions/log.go Outdated
Comment thread server/functions/numeric.go
Comment thread server/functions/sqrt.go Outdated
Comment thread server/functions/to_char.go Outdated
Comment thread testing/go/operators_test.go Outdated
Comment thread testing/go/operators_test.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SELECT 'NaN'::numeric --> spurious error

2 participants