Uh oh!
There was an error while loading. Please reload this page.
[SPARK-17206][SQL] Support ANALYZE TABLE on analyzable temporary view - #14780
[SPARK-17206][SQL] Support ANALYZE TABLE on analyzable temporary view#14780viirya wants to merge 4 commits into
Conversation
@hvanhovell Based on the prior discussion, I opened a JIRA and this PR. Can you review it if it is on the right direction? Thanks. |
SparkQA
commented
Aug 24, 2016
Test build #64330 has finished for PR 14780 at commit
|
viirya
commented
Aug 29, 2016
@hvanhovell@cloud-fan Can you help review this? |
Conflicts: sql/core/src/main/scala/org/apache/spark/sql/execution/command/AnalyzeTableCommand.scala sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/LogicalRelation.scala
viirya
commented
Sep 6, 2016
cc @hvanhovell@cloud-fan Can you take a look? Thanks. |
what's the main benefit to analyze a temp view? I think table analyzing is an expensive operation, for temp views, we can't put the resulting statistics into metastore and it will go away if session terminates. |
@cloud-fan I have a discussion with @hvanhovell at #14729 (comment). I think the main benefit is the CBO can work on all tables. If we can't analyze on a temp view, the query plan involving temp views will not be applied on CBO. We might not be able to correctly guess the use case of users. I try to image an use case like: If the user creates a temp view on a data source relation as in @hvanhovell's comment, because the data is temporary and will be changed, so the user doesn't need it to be persisted in metastore. But the user needs the query involving the temp view to execute in cost-efficient way with CBO. |
SparkQA
commented
Sep 6, 2016
Test build #64986 has finished for PR 14780 at commit
|
SparkQA
commented
Sep 6, 2016
Test build #64991 has finished for PR 14780 at commit
|
viirya
commented
Sep 10, 2016
ping @hvanhovell@cloud-fan any more thoughts on this? |
viirya
commented
Sep 16, 2016
@hvanhovell Would you like to comment on this? Thanks. |
hvanhovell
commented
Sep 21, 2016
@viirya this seems like a good idea. However, I want to wait with adding this until we have finished merging all the CBO related statistics stuff. |
viirya
commented
Sep 22, 2016
@hvanhovell ok. Thanks! |
SparkQA
commented
Oct 29, 2016
Test build #67746 has finished for PR 14780 at commit
|
viirya
commented
Jan 5, 2017
I close this for now and maybe reopen it when all the CBO related statistics stuff are merged. |
What changes were proposed in this pull request?
Currently
ANALYZE TABLEDDL command can't work on temporary view. However, for the specified type of temporary view which is analyzable, we can support the DDL command for it. So the CBO can work with temporary view too.How was this patch tested?
Jenkins tests.