Skip to content

fix(tests): use correct compact table row format in std_dev and variance tests#1043

Merged
benbellick merged 2 commits intomainfrom
fix/std-dev-variance-compact-table-format
Apr 13, 2026
Merged

fix(tests): use correct compact table row format in std_dev and variance tests#1043
benbellick merged 2 commits intomainfrom
fix/std-dev-variance-compact-table-format

Conversation

@benbellick
Copy link
Copy Markdown
Member

@benbellick benbellick commented Apr 10, 2026

The compact aggregate test format uses each inner parenthesis group as a row. The std_dev and variance test files were using a flat list of values in a single group, e.g. ((1.0, 2.0, 3.0)), which parses as 1 row with 3 columns rather than 3 rows with 1 column.

This changes them to the correct per-row format: ((1.0), (2.0), (3.0)).

This format is documented here (this is format 2):

Aggregate test cases support 3 formats:
1. **Single Argument**: The test case for an aggregate function with single argument as a column in a table. The table is defined in the test case.
```code
sum((1, 2, 3, 4, 5)::i8) = 15::i8 # addition of two numbers
```
2. **Multiple Columns Compact**: The test case for an aggregate function with on one or more columns of a table as argument. The table is defined before the function name, in the same line as the testcase.
```code
((20, 20), (-3, -3), (1, 1), (10,10), (5,5)) corr(col0::fp32, col1::fp32) = 1::fp64
```
3. **Multiple Columns Verbose**: The test case for an aggregate function with one or more columns of a table as arguments. The table is defined before the function name. The function arguments refer to the columns in a table.
```code
DEFINE t1(fp32, fp32) = ((20, 20), (-3, -3), (1, 1), (10,10), (5,5))
corr(t1.col0, t1.col1) = 1::fp64
```

This came up in some work on substrait-go.

(I opened #1042 to discuss how the inline-format 1 above could be used in the future. We would have to figure out how to deal with intermixing enum args.)

🤖 Generated with Claude Code


This change is Reviewable

@benbellick benbellick force-pushed the fix/std-dev-variance-compact-table-format branch from a73fbb3 to a45f0ee Compare April 10, 2026 20:42
@benbellick benbellick marked this pull request as ready for review April 10, 2026 20:47
Comment thread tests/cases/arithmetic/std_dev.test
…nce tests

The compact aggregate test format uses each inner parenthesis group as a
row, with literals inside representing column values for that row. The
std_dev and variance test files were using a flat list of values in a
single group, e.g. `((1.0, 2.0, 3.0))`, which parses as 1 row with 3
columns rather than 3 rows with 1 column.

This changes them to the correct per-row format: `((1.0), (2.0), (3.0))`.

See #1042 for a grammar improvement that would allow a cleaner inline
format for these test cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@benbellick benbellick force-pushed the fix/std-dev-variance-compact-table-format branch from a45f0ee to af9a681 Compare April 10, 2026 21:54
Copy link
Copy Markdown
Member

@nielspardon nielspardon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for catching this

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@benbellick benbellick merged commit 357d639 into main Apr 13, 2026
13 checks passed
@benbellick benbellick deleted the fix/std-dev-variance-compact-table-format branch April 13, 2026 18:07
benbellick added a commit to substrait-io/substrait-go that referenced this pull request Apr 13, 2026
The single-column compact table format used in these test files was
corrected in substrait-io/substrait#1043, released in v0.88.0.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants