qiuchenjian opened a new pull request #3129: [CARBONDATA-3295] Fix that MV datamap throw exception because its rewrite algorithm when multiply subquery
URL: https://github.com/apache/carbondata/pull/3129 ### [Problem] Error: `java.lang.UnsupportedOperationException was thrown. java.lang.UnsupportedOperationException at org.apache.carbondata.mv.plans.util.SQLBuildDSL$Fragment.productArity(SQLBuildDSL.scala:36) at scala.runtime.ScalaRunTime$$anon$1.<init>(ScalaRunTime.scala:174) at scala.runtime.ScalaRunTime$.typedProductIterator(ScalaRunTime.scala:172)` MV sql: `create datamap data_table_mv using 'mv' as SELECT STARTTIME,LAYER4ID, COALESCE (SUM(seq),0) AS seq_c, COALESCE (SUM(succ),0) AS succ_c FROM data_table GROUP BY STARTTIME,LAYER4ID` Query sql: `SELECT MT.`3600` AS `3600`, MT.`2250410101` AS `2250410101`, (CASE WHEN (SUM(COALESCE(seq_c, 0))) = 0 THEN NULL ELSE (CASE WHEN (CAST((SUM(COALESCE(seq_c, 0))) AS int)) = 0 THEN 0 ELSE ((CAST((SUM(COALESCE(succ_c, 0))) AS double)) / (CAST((SUM(COALESCE(seq_c, 0))) AS double))) END) * 100 END) AS rate FROM ( SELECT sum_result.*, H_REGION.`2250410101` FROM (SELECT cast(floor((starttime + 28800) / 3600) * 3600 - 28800 as int) AS `3600`, LAYER4ID, COALESCE(SUM(seq), 0) AS seq_c, COALESCE(SUM(succ), 0) AS succ_c FROM data_table WHERE STARTTIME >= 1549866600 AND STARTTIME < 1549899900 GROUP BY cast(floor((STARTTIME + 28800) / 3600) * 3600 - 28800 as int),LAYER4ID )sum_result LEFT JOIN (SELECT l4id AS `225040101`, l4name AS `2250410101`, l4name AS NAME_2250410101 FROM region GROUP BY l4id, l4name) H_REGION ON sum_result.LAYER4ID = H_REGION.`225040101` WHERE H_REGION.NAME_2250410101 IS NOT NULL ) MT GROUP BY MT.`3600`, MT.`2250410101` ORDER BY `3600` ASC LIMIT 5000` ### [Solution] Fix the mv rewrite algorithm to fix this Be sure to do all of the following checklist to help us incorporate your contribution quickly and easily: - [ ] Any interfaces changed? - [ ] Any backward compatibility impacted? - [ ] Document update required? - [ ] Testing done Please provide details on - Whether new unit test cases have been added or why no new tests are required? - How it is tested? Please attach test report. - Is it a performance related change? Please attach the performance test report. - Any additional information to help reviewers in testing this change. - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [hidden email] With regards, Apache Git Services |
Free forum by Nabble | Edit this page |