Skip to content

Commit

Permalink
Deterministic ordering in window tests (#10205)
Browse files Browse the repository at this point in the history
Fixes #10195.

This is similar to the fix in #10143.  This commit changes the test datagens used in
the window function tests such that the order-by columns produce deterministic ordering.

When the ordering is ambiguous, it can produce unexpected results from window functions,
if the `order-by` spec includes the ambiguous columns.

Signed-off-by: MithunR <[email protected]>
  • Loading branch information
mythrocks authored Jan 18, 2024
1 parent 28ac3d3 commit a168f6e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions integration_tests/src/main/python/window_function_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
_grpkey_longs_with_no_nulls = [
('a', RepeatSeqGen(LongGen(nullable=False), length=20)),
('b', IntegerGen()),
('c', IntegerGen())]
('c', UniqueLongGen())]

_grpkey_longs_with_nulls = [
('a', RepeatSeqGen(LongGen(nullable=(True, 10.0)), length=20)),
('b', IntegerGen()),
('c', IntegerGen())]
('c', UniqueLongGen())]

_grpkey_longs_with_dates = [
('a', RepeatSeqGen(LongGen(), length=2048)),
('b', DateGen(nullable=False, start=date(year=2020, month=1, day=1), end=date(year=2020, month=12, day=31))),
('c', IntegerGen())]
('c', UniqueLongGen())]

_grpkey_longs_with_nullable_dates = [
('a', RepeatSeqGen(LongGen(nullable=False), length=20)),
('b', DateGen(nullable=(True, 5.0), start=date(year=2020, month=1, day=1), end=date(year=2020, month=12, day=31))),
('c', IntegerGen())]
('c', UniqueLongGen())]

_grpkey_longs_with_timestamps = [
('a', RepeatSeqGen(LongGen(), length=2048)),
Expand All @@ -57,17 +57,17 @@
_grpkey_longs_with_decimals = [
('a', RepeatSeqGen(LongGen(nullable=False), length=20)),
('b', DecimalGen(precision=18, scale=3, nullable=False)),
('c', DecimalGen(precision=18, scale=3))]
('c', UniqueLongGen())]

_grpkey_longs_with_nullable_decimals = [
('a', RepeatSeqGen(LongGen(nullable=(True, 10.0)), length=20)),
('b', DecimalGen(precision=18, scale=10, nullable=True)),
('c', DecimalGen(precision=18, scale=10, nullable=True))]
('c', UniqueLongGen())]

_grpkey_longs_with_nullable_larger_decimals = [
('a', RepeatSeqGen(LongGen(nullable=(True, 10.0)), length=20)),
('b', DecimalGen(precision=23, scale=10, nullable=True)),
('c', DecimalGen(precision=23, scale=10, nullable=True))]
('c', UniqueLongGen())]

_grpkey_longs_with_nullable_largest_decimals = [
('a', RepeatSeqGen(LongGen(nullable=(True, 10.0)), length=20)),
Expand Down

0 comments on commit a168f6e

Please sign in to comment.