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
Is your feature request related to a problem? Please describe.
There is limited support for JOIN queries which needs improvement. In particular, post processing such as filtering and aggregation after inner/outer join is most wanted. This capability is required by PPL lookup command.
Another option we can explore is to reuse legacy JOIN implementation in v2 engine directly by:
ExprValueRow wraps an ExprValue into legacy Row interface.
LegacyToV2Adapter adapts legacy join operator to behave like a V2 operator.
V2ToLegacyAdapter adapts V2 operator for integrating with legacy join operator.
Pros:
Minimum efforts to get JOIN work in v2 engine to a) support lookup in PPL; b) fix most of the issue above.
Legacy code was basically functional tested and performance tested.
Cons:
May have unknown issue with certain data type or functions.
Still single node implementation
The main blocker to make this happen is v2 engine doesn't support symbol resolution very well. For example, SELECT t1.name FROM index t1 ..., alias t1 will be removed after analysis. There is no alias in DSL query and value environment. Finally the value is named t1.name by project operator. This will cause problem in analysis and execution in JOIN case which has 2 or more table aliased (See the column names and null value in result below). Anyway, this is something to improve in v2 engine itself instead of problem in this quick workaround.
Activity
chloe-zh commentedon Jul 26, 2021
JOIN with nested loops join algorithm in new engine
PoC: https://github.com/chloe-zh/opensearch-sql/tree/poc/join
dai-chen commentedon Sep 27, 2022
Inquiry: #857
dai-chen commentedon Oct 6, 2022
Requirements in observability: #892
dai-chen commentedon Dec 9, 2022
Another option we can explore is to reuse legacy JOIN implementation in v2 engine directly by:
ExprValueRowwraps anExprValueinto legacyRowinterface.LegacyToV2Adapteradapts legacy join operator to behave like a V2 operator.V2ToLegacyAdapteradapts V2 operator for integrating with legacy join operator.The main blocker to make this happen is v2 engine doesn't support symbol resolution very well. For example,
SELECT t1.name FROM index t1 ..., aliast1will be removed after analysis. There is no alias in DSL query and value environment. Finally the value is namedt1.nameby project operator. This will cause problem in analysis and execution in JOIN case which has 2 or more table aliased (See the column names and null value in result below). Anyway, this is something to improve in v2 engine itself instead of problem in this quick workaround.Test branch: https://github.com/dai-chen/sql-1/tree/test-legacy-join-port
dai-chen commentedon Jul 30, 2024
#2873