Skip to content

update decimal.Decimal to apd.Decimal#2643

Open
jennifersp wants to merge 10 commits intomainfrom
jennifer/apd
Open

update decimal.Decimal to apd.Decimal#2643
jennifersp wants to merge 10 commits intomainfrom
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 1488.18/s 1497.01/s +0.5%
index_join_postgres 268.58/s 271.68/s +1.1%
index_join_scan_postgres 287.26/s 284.96/s -0.9%
index_scan_postgres 15.16/s 15.42/s +1.7%
oltp_point_select 2953.74/s 2879.39/s -2.6%
oltp_read_only 2265.77/s 2259.89/s -0.3%
select_random_points 185.77/s 186.49/s +0.3%
select_random_ranges 1157.42/s 1156.90/s -0.1%
table_scan_postgres 14.73/s 15.20/s +3.1%
types_table_scan_postgres 6.68/s 6.86/s +2.6%

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 18095
Failures 24073 23995
Partial Successes1 5372 5376
Main PR
Successful 42.8059% 42.9912%
Failures 57.1941% 57.0088%

${\color{red}Regressions (7)}$

numeric

QUERY:          INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
    FROM num_data t1, num_data t2
    WHERE t2.val != '0.0';
RECEIVED ERROR: invalid operation (errno 1105) (sqlstate HY000)
QUERY:          INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
    FROM num_data t1, num_data t2
    WHERE t2.val != '0.0';
RECEIVED ERROR: invalid operation (errno 1105) (sqlstate HY000)
QUERY:          INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200))))
    FROM num_data
    WHERE val != '0.0';
RECEIVED ERROR: invalid operation (errno 1105) (sqlstate HY000)
QUERY:          SELECT a, ceil(a), ceiling(a), floor(a), round(a) FROM ceil_floor_round;
RECEIVED ERROR: could not find the following row in the result set:
        {"0.0000001", "1", "1", "0", "0"}
QUERY:          INSERT INTO num_variance VALUES (4e-500 - 1e-16383);
RECEIVED ERROR: underflow, subnormal
QUERY:          INSERT INTO num_variance VALUES (-4e-500 + 1e-16383);
RECEIVED ERROR: underflow, subnormal

subselect

QUERY:          select * from float_table
  where float_col in (select num_col from numeric_table);
RECEIVED ERROR: expected row count 3 but received 0

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

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 t1.id1, t1.id2, t1.result, t2.expected
    FROM num_result t1, num_exp_div t2
    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
    AND t1.result != t2.expected;
QUERY: SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
    FROM num_result t1, num_exp_div t2
    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
    AND t1.result != round(t2.expected, 80);
QUERY: SELECT t1.id1, t1.result, t2.expected
    FROM num_result t1, num_exp_power_10_ln t2
    WHERE t1.id1 = t2.id
    AND t1.result != t2.expected;
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, '3');

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.

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