Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mihaibudiu
Copy link
Contributor

Fixes #5491
Fixes #5493

I also documented our (partial) support for FIRST_VALUE and LAST_VALUE window aggregates.

Copilot AI review requested due to automatic review settings January 22, 2026 23:03
@mihaibudiu mihaibudiu enabled auto-merge January 22, 2026 23:03
@mihaibudiu mihaibudiu requested a review from rivudhk January 22, 2026 23:03
Copy link
Contributor

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.

Pull request overview

This PR fixes three bugs related to SQL compilation and adds documentation for window aggregate functions. The changes include fixing issues #5491 and #5493, along with improvements to variable naming and code organization in the compiler internals.

Changes:

  • Fixed bug related to safe cast operations in SQL compilation
  • Fixed bug related to lateness types handling in incremental compilation
  • Improved variable naming and index tracking in join operations for better code clarity
  • Added documentation for FIRST_VALUE and LAST_VALUE window aggregate functions

Reviewed changes

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

Show a summary per file
File Description
Regression2Tests.java Added test case for issue #5493 validating SAFE_CAST with MAP types
IncrementalRegressionTests.java Re-enabled test for issue #5491 (previously ignored) by removing @ignore annotation
InsertLimiters.java Improved variable naming and fixed index tracking bug in join filter processing
ExpandSafeCasts.java Fixed bug by moving nullable handling outside conditional block and removed unused import
ReferenceMap.java Enhanced error message to include declaration IDs for better debugging
CalciteToDBSPCompiler.java Fixed variable scope issue by creating new variable per iteration in projection loop
aggregates.md Added documentation for FIRST_VALUE and LAST_VALUE window aggregate functions

<tr>
<td><a id="last_value"></a><code>LAST_VALUE(expression)</code></td>
<td>Returns the value of <code>expression</code> at the last row of the window frame.
Currently only supported for windows with <code>UNLIMITED RANGE</code></td>
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

Missing period at the end of the sentence for consistency with other function descriptions.

Suggested change
Currently only supported for windows with <code>UNLIMITED RANGE</code></td>
Currently only supported for windows with <code>UNLIMITED RANGE</code>.</td>

Copilot uses AI. Check for mistakes.
@mihaibudiu mihaibudiu added this pull request to the merge queue Jan 23, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 23, 2026
@mihaibudiu mihaibudiu added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit b57fb64 Jan 23, 2026
1 check passed
@mihaibudiu mihaibudiu deleted the issue5491 branch January 23, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants