Skip to content

[BUG] Head command doesn't take effect #5114

Closed

Description

@qianheng-aws

What is the bug?
PPL query:

source=employees | eval a = rand() | sort a | fields id | head 5

returns rows more than 5.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Put documents more than the head limiation
POST localhost:9200/{{index}}/_bulk
{"index":{"_id":"1"}}
{"id":1,"name":"Dev","reportsTo":"Eliot"}
{"index":{"_id":"2"}}
{"id":2,"name":"Eliot","reportsTo":"Ron"}
{"index":{"_id":"3"}}
{"id":3,"name":"Ron","reportsTo":"Andrew"}
{"index":{"_id":"4"}}
{"id":4,"name":"Andrew","reportsTo":null}
{"index":{"_id":"5"}}
{"id":5,"name":"Asya","reportsTo":"Ron"}
{"index":{"_id":"6"}}
{"id":6,"name":"Dan","reportsTo":"Andrew"}
  1. Query using above query
source=employees | eval a = rand() | sort a | fields id | head 5

It return all 6 rows.

What is the expected behavior?
Should return 5 rows.

What is your host/environment?

  • OS: MacOs
  • Version 3.5.0-SNAPSHOT
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

Activity

  1. added
    bug
    on Feb 5, 2026
  2. added
    PPL
    calcite
    on Feb 10, 2026
  3. moved this from Not Started to Done in PPL Trackeron Feb 17, 2026
  4. added a commit that references this issue on Feb 17, 2026
    7a6a3a5
  5. added a commit that references this issue on Feb 24, 2026
    ef94e4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PPLbugcalcite

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions