Posted by
GitBox on
Dec 16, 2020; 1:35pm
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-Indhumathi27-opened-a-new-pull-request-4038-WIP-Fix-MV-having-Subquery-alias-used-n-tp104172p104826.html
akashrn5 commented on a change in pull request #4038:
URL:
https://github.com/apache/carbondata/pull/4038#discussion_r544302352##########
File path: integration/spark/src/test/scala/org/apache/carbondata/view/rewrite/MVCreateTestCase.scala
##########
@@ -428,6 +428,25 @@ class MVCreateTestCase extends QueryTest with BeforeAndAfterAll {
sql(s"drop materialized view mv_sub")
}
+ test("test create materialized view used as sub-query in actual query") {
+ sql("drop materialized view if exists mv_sub")
+ sql("create materialized view mv_sub as select empname, utilization result from fact_table1")
+ val df1 = sql("select empname, sum(result) sum_ut from " +
+ "(select empname, utilization result from fact_table1) fact_table1 " +
+ "group by empname")
+ val df2 = sql("select emp, sum(result) sum_ut from " +
+ "(select empname emp, utilization result from fact_table1) fact_table1 " +
+ "group by emp")
+ assert(TestUtil.verifyMVHit(df1.queryExecution.optimizedPlan, "mv_sub"))
Review comment:
please add a assert for `df2` also
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]