Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[multistage] run planner for routing on controller #10871

Open
walterddr opened this issue Jun 7, 2023 · 7 comments
Open

[multistage] run planner for routing on controller #10871

walterddr opened this issue Jun 7, 2023 · 7 comments
Assignees
Labels
bugfix feature multi-stage Related to the multi-stage query engine

Comments

@walterddr
Copy link
Contributor

Description

when query broker for a specific query. there's no need to parse out the tenant info.
however when using the Pinot controller UI. controller needs to first detect all the tables accessed by the query, then find the common tenant of a broker to route the query to.

Status Quo

currently this is done via a util done in #10336. however this util has lots of drawback and overhead. b/c it is not running the actual planner.

Proposed solution

  1. run the calcite planner on controller (QueryEnvironment.compileQuery)
  2. and use RelOptUtils.findTables to find all tables accessed by this query.
  3. use the same util currently available to find common broker tenant list.
@walterddr walterddr added feature bugfix multi-stage Related to the multi-stage query engine labels Jun 7, 2023
@walterddr
Copy link
Contributor Author

CC @tibrewalpratik17 and @abhioncbr

@tibrewalpratik17
Copy link
Contributor

@walterddr Just curious will this not add an additional dependency of pinot-controller module on pinot-query-planner?And what will we pass as WorkerManager to the QueryEnvironment object as it looks specific to broker / server configs?

Also for 2. we can use RelToPlanNodeConverter.getTableNamesFromRelRoot(relRoot.rel) which internally uses RelOptUtils.findAllTableQualifiedNames(relRoot) at the moment. This is a part of pinot-query-planner module itself.

@tibrewalpratik17
Copy link
Contributor

tibrewalpratik17 commented Jun 7, 2023

And what will we pass as WorkerManager to the QueryEnvironment object as it looks specific to broker / server configs?

On deeper look I see we don't need WorkerManager in the compileQuery path.
Seems doable to me.

@abhioncbr
Copy link
Contributor

Sounds good to me. I can work on this if it's not urgent. Thanks.

@walterddr
Copy link
Contributor Author

walterddr commented Jun 8, 2023

@walterddr Just curious will this not add an additional dependency of pinot-controller module on pinot-query-planner?And what will we pass as WorkerManager to the QueryEnvironment object as it looks specific to broker / server configs?

Controller is never designed for sustained QPS workload --> in fact each pending query will hog up a thread/cpu thus it can handle maximum no_of_core query at a time.
So I think it is fairly ok to add a bit of overhead to this exploratory API for the UI and for improved user-experience.

Also for 2. we can use RelToPlanNodeConverter.getTableNamesFromRelRoot(relRoot.rel) which internally uses RelOptUtils.findAllTableQualifiedNames(relRoot) at the moment. This is a part of pinot-query-planner module itself.

yes, that's what I meant, we dont need to configure WorkerManager as we are not assigning worker at the moment, we only want to do the planning part.

Sounds good to me. I can work on this if it's not urgent. Thanks.

Thank you @abhioncbr, sorry I was originally intended to @ankitsultana but yes this is not urgent. please feel free to pick this one up at your convenience. (assigned to you)

@tibrewalpratik17
Copy link
Contributor

Hey @abhioncbr is it okay if i pick this up and get this assigned to me?

@abhioncbr
Copy link
Contributor

Hey @abhioncbr is it okay if i pick this up and get this assigned to me?

Sure. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix feature multi-stage Related to the multi-stage query engine
Projects
None yet
Development

No branches or pull requests

3 participants