Skip to content

feat(sql): add last(array) function#6291

Merged
bluestreak01 merged 11 commits intoquestdb:masterfrom
mcadariu:port_last_array_to_off_heap_data_structures
Oct 30, 2025
Merged

feat(sql): add last(array) function#6291
bluestreak01 merged 11 commits intoquestdb:masterfrom
mcadariu:port_last_array_to_off_heap_data_structures

Conversation

@mcadariu
Copy link
Copy Markdown
Contributor

@mcadariu mcadariu commented Oct 21, 2025

The next step after #6237

It relates to #4120.

In #4097, a specialized allocator for aggregate functions was introduced and a couple of them migrated to use it. This PR follows up with the implementation of last(array).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 21, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mcadariu mcadariu marked this pull request as draft October 21, 2025 16:38
@puzpuzpuz puzpuzpuz added Enhancement Enhance existing functionality SQL Issues or changes relating to SQL execution labels Oct 22, 2025
@mcadariu
Copy link
Copy Markdown
Contributor Author

While working on this, I have identified two other tasks:

  • update docs (after this PR is merged). I noticed that first does not mention the array type now, but I have just seen it working. This update would be fine to do even now, but can do it together with last in one go.
  • update FirstArrayGroupByFunction to use GroupByArraySink for consistency with LastArrayGroupByFunction

@mcadariu mcadariu force-pushed the port_last_array_to_off_heap_data_structures branch from 07c6034 to 244b35f Compare October 24, 2025 10:51
@puzpuzpuz
Copy link
Copy Markdown
Contributor

@mcadariu the PR looks good, but it's still marked as a draft. Are you planning to push some additional changes?

@mcadariu mcadariu marked this pull request as ready for review October 24, 2025 11:09
@mcadariu
Copy link
Copy Markdown
Contributor Author

mcadariu commented Oct 24, 2025

@puzpuzpuz Yes, I have just pushed this commit to remove unnecessary code additions. I'm now making the most out of the existing test setup introduced by the first(array) to test last(array). I won't make other changes. Thanks for the review!

@puzpuzpuz puzpuzpuz self-requested a review October 24, 2025 11:17
puzpuzpuz
puzpuzpuz previously approved these changes Oct 24, 2025
@puzpuzpuz
Copy link
Copy Markdown
Contributor

Many thanks for another solid contribution!

@mcadariu mcadariu changed the title Implement last(array) function Implement last(array) function using off-heap data structure Oct 29, 2025
@puzpuzpuz puzpuzpuz changed the title Implement last(array) function using off-heap data structure feat(sql): add last(array) function Oct 30, 2025
@bluestreak01 bluestreak01 merged commit b3d9f36 into questdb:master Oct 30, 2025
21 checks passed
nwoolmer added a commit to questdb/documentation that referenced this pull request Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Enhance existing functionality SQL Issues or changes relating to SQL execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants