You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] fields is changing the outcome of the following commands that depend on selected fields #2739
What is the bug?
When running stats count() operation on a nested parameter the result seems to just return 0. If the field is specified before running the count, it will show the correct value.
How can one reproduce the bug?
Steps to reproduce the behavior:
Is this fixed with the related OpenSearch issue @LantaoJin?
No. It's not an OpenSearch Core bug. The aggregation query on a nested field should build Nested Aggregations builder, but in our v2 engine, the information of nested field is missing during expression analysis. We mistakenly use an normal aggregation builder to query on a nested field, rather than nested aggregation builder. I'm investigating how to store the nested field information in expression analyzing and trigger nested aggregation builder in v2.
Activity
LantaoJin commentedon Jun 14, 2024
This may be not a bug of SQL plugin. Regarding to nested field, OpenSearch DSL query will return
0value too. Try below DSLPPL
source = jaeger-span-* | stats count (references.refType)equals to above DSL query. Butsource = jaeger-span-* | fields references.refType | stats count (references.refType)equals searching keywordpatients.namefirst then aggregate.LantaoJin commentedon Jun 14, 2024
Open opensearch-project/OpenSearch#14347 to track
dblock commentedon Jul 1, 2024
Is this fixed with the related OpenSearch issue @LantaoJin?
[Catch All Triage - Attendees 1, 2, 3, 4, 5]
LantaoJin commentedon Jul 9, 2024
No. It's not an OpenSearch Core bug. The aggregation query on a nested field should build Nested Aggregations builder, but in our v2 engine, the information of nested field is missing during expression analysis. We mistakenly use an normal aggregation builder to query on a nested field, rather than nested aggregation builder. I'm investigating how to store the nested field information in expression analyzing and trigger nested aggregation builder in v2.
LantaoJin commentedon May 27, 2025
#2814 is stalled, I am going to raise another PR to fix this issue for PPL first.
LantaoJin commentedon Jan 5, 2026
Resolved by #4979