Skip to content

Fix so window functions are run before any where statement #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 7, 2025

Conversation

Ulimo
Copy link
Contributor

@Ulimo Ulimo commented Apr 7, 2025

This allows using window functions in the where statement for filtering.

This allows using window functions in the where statement for filtering.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 01e3290 Previous: 22d4209 Ratio
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.InnerJoin 402028500 ns (± 5153287.315151368) 458826533.3333333 ns (± 10640413.19005047) 0.88
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.LeftJoin 494493100 ns (± 23456714.6544912) 564994640 ns (± 28550338.329818636) 0.88
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.ProjectionAndNormalization 153231730 ns (± 11859188.990239687) 169842820 ns (± 7144067.768715523) 0.90
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.SumAggregation 159438294.44444445 ns (± 7053451.4679182265) 171581250 ns (± 12415362.812660772) 0.93
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.ListAggWithMapAggregation 1808789850 ns (± 64070904.465968184) 1982296640 ns (± 123349811.75190067) 0.91
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.WindowSum 365323210 ns (± 12760915.101934414)

This comment was automatically generated by workflow using github-action-benchmark.

Ulimo added 2 commits April 7, 2025 09:58
…ojection

This is required since the filter removes row
The where filter changes the window, so they must be seperate.
@Ulimo Ulimo requested a review from Copilot April 7, 2025 09:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

tests/FlowtideDotNet.AcceptanceTests/WindowFunctionTests.cs:708

  • [nitpick] There is an inconsistency in the naming of RowNumberResult properties: earlier properties are accessed using PascalCase (e.g. CompanyId, UserKey) but later referenced in lowercase (e.g. value, userkey, companyId). Consider using consistent naming conventions throughout the test to improve clarity.
.Where(x => x.value == 1)

@Ulimo Ulimo requested a review from Copilot April 7, 2025 09:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

tests/FlowtideDotNet.AcceptanceTests/WindowFunctionTests.cs:708

  • [nitpick] Ensure consistent property naming for RowNumberResult fields; the test uses 'value' in one place and 'userkey'/'companyId' in another, which may reflect an inconsistency in property casing.
.Where(x => x.value == 1)

@Ulimo Ulimo merged commit 7ec4ea4 into main Apr 7, 2025
7 checks passed
@Ulimo Ulimo deleted the window_function_before_where branch April 7, 2025 10:30
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.

1 participant