Visitar URL original
SELECT col, now() … ORDER BY 2 throws The query is not order by identifiers in SelectionPartiallyOrderedByDescOperation · Issue #19701 · apache/pinot · GitHub
Skip to content

SELECT col, now() … ORDER BY 2 throws The query is not order by identifiers in SelectionPartiallyOrderedByDescOperation #19701

Description

@shuturmurgh

Single-stage selection queries that order by now() fail when the select list also projects another column. Server throws during plan construction:

java.lang.IllegalArgumentException: The query is not order by identifiers
  at org.apache.pinot.core.operator.query.SelectionPartiallyOrderedByDescOperation.<init>(SelectionPartiallyOrderedByDescOperation.java:52)
  at org.apache.pinot.core.plan.SelectionPlanNode.run(SelectionPlanNode.java:100)
Same failure for ORDER BY 2, ORDER BY 2 ASC, ORDER BY 2 DESC, and ORDER BY now().

Reproduction

Fails:

SELECT col, now() AS t
FROM my_table
ORDER BY 2 DESC
LIMIT 1;

Works:

SELECT now() AS t
FROM my_table
ORDER BY 1 DESC
LIMIT 1;

Works:

SELECT col, now() AS t
FROM my_table
ORDER BY col DESC
LIMIT 1;

Activity

added
bugSomething is not working as expected
queryRelated to query processing
on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working as expectedqueryRelated to query processing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions