Skip to content

docs: Clarify first_value usage in select vs aggregate#1348

Merged
timsaucer merged 3 commits intoapache:mainfrom
AdMub:fix-docs-first-value
Feb 12, 2026
Merged

docs: Clarify first_value usage in select vs aggregate#1348
timsaucer merged 3 commits intoapache:mainfrom
AdMub:fix-docs-first-value

Conversation

@AdMub
Copy link
Contributor

@AdMub AdMub commented Jan 22, 2026

I investigated Issue #1300 and confirmed that the crash occurs because first_value (an aggregate function) is used inside .select(), which is not supported by the physical planner. This PR updates the docstring to explicitly warn users that first_value should be used with .aggregate() and not .select(). Closes #1300.

AdMub added 2 commits January 22, 2026 06:14
Clarifies that aggregate functions like first_value must be used within .aggregate() and not .select(). Closes apache#1300.
)


def last_value(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the same type of clarification be done on last_value as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

This example also needs to be changed right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar example as the first_value one.

@timsaucer
Copy link
Member

Thanks for the investigation and PR! I took the liberty of pushing a change that follows @nuno-faria 's request and I checked every other aggregate function while I was at it. I think just having correct usage solves the real problem rather than saying how to not use it.

@timsaucer timsaucer merged commit 024c86b into apache:main Feb 12, 2026
18 checks passed
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.

first_value doesn't work when applied to window function output

3 participants