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
[Enhancement] Better error handling for JOIN query limitation #4058
According to the official documentation: OpenSearch doc - JOIN does not support aggregations on the joined result, JOIN queries in today's SQL plugin has certain limitations for aggregated join result. However, currently we do not have certain error handling to capture these limitations to warn users.
Reproduce of the issue
Env Setup - latest version of opensearch
Construct a JOIN query with some aggregate functions, e.g.
Execute the above query in the latest OS version, and from the response, it will output the column with aliasing issue - count(b.channel) c incorrectly generates duplicate columns a.c and b.c with null values instead of the expected aggregation result
In the query explanation, the symptoms are:
No aggregation operator in the logical or physical plan
"Project [ columns=[interaction_aggregate_0.COUNT, hcp_1.COUNT, hcp_1.country_code] ]" in response indicates that the SQL engine is treating the COUNT(...) expressions as literal field names, not as functions to be evaluated, because it cannot resolve an aggregation function over joined data.
JOIN followed by projection, not aggregation
The physical plan is using a BlockHashJoin, then directly projecting the COUNT columns from both sources
Activity
RyanL1997 commentedon Aug 18, 2025
Targeting
v3.4.0v3.3.0