[KYLIN-5401]Optimize code logic for pushdown queries #2077
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
It is found that the push-down query in kylin4.0.x is very slow for the simple query eg:
select * from table limit 10
. It should respond in seconds, but it often takes a few minutes, and the larger the query data set, the more time-consuming it takes Long, which is very abnormal.BI tools often execute some simple queries to display detailed data. Abnormal query duration often causes BI tools to time out and return error messages, which is very unfriendly to user experience.Through investigation, it is found that there is a shuffle process in the query plan of this very simple detailed query, which is outrageous.
The main logic of Kylin executing push-down query is concentrated in
org.apache.kylin.query.pushdown.SparkSqlClient
.Unnecessary Spark DataFrame type transform inorg.apache.kylin.query.pushdown.SparkSqlClient#DFToList
is the main cause of this problem.Branch to commit
Types of changes
What types of changes does your code introduce to Kylin?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at [email protected] or [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...