opendistro-for-elasticsearch / sql

🔍 Open Distro SQL Plugin
https://opendistro.github.io/for-elasticsearch/features/SQL%20Support.html
Apache License 2.0
621 stars 186 forks source link

Aggregation support for JOIN on multiple indices #110

Open pradeepthota07 opened 5 years ago

pradeepthota07 commented 5 years ago

I have tried joining two indices similar to sql. Here are the observations below.

  1. I see it returns only max of 200 results and not all the results.
  2. Joins does not support the aggregate functions like count, max, min etc

PS: I am using opendistro 0.9.0

Any help is appreciated. Thanks

dai-chen commented 5 years ago

I have tried joining two indices similar to sql. Here are the observations below.

  1. I see it returns only max of 200 results and not all the results.
  2. Joins does not support the aggregate functions like count, max, min etc

PS: I am using opendistro 0.9.0

Any help is appreciated. Thanks

Thanks for reporting the issue. Please find the answer below.

  1. Yes, we use 200 by default on the safe side because we don't support cursor for now. We may remove it in future. The workaround is to use LIMIT in your query with a large number.
  2. Yes, we generate query plan for JOIN like other SQL query engine. For now we only support limited post-processing operator in the plan. (if I recall right probably only Sort operator for ORDER BY and Project for column projection: https://github.com/opendistro-for-elasticsearch/sql/tree/master/src/main/java/com/amazon/opendistroforelasticsearch/sql/query/planner/physical/node)