kasakrisz opened a new pull request #3014: URL: https://github.com/apache/hive/pull/3014
### What changes were proposed in this pull request? 1. When rewriting queries automatically to use MVs lookup the MVs by the AST of the subquery should be rewritten. 2. Store MVs AST in `HiveRelOptMaterialization` 3. To get the expanded subquery AST required the lookup generate the expanded query test only one by using `UnparseTranslator` and `TokeRewriteStream` and call the parser with the expanded sql query text to get the AST. ### Why are the changes needed? `UnparseTranslator` and `TokeRewriteStream` are called for each subquery and complex queries containing lots of subqueries require more compilation time. By generating the expanded sql query text of the whole query once and comparing the ASTs of the subqueries runs faster. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? ``` mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=materialized_view_rewrite_by_text.q,materialized_view_rewrite_by_text_3.q,materialized_view_rewrite_by_text_4.q,materialized_view_rewrite_by_text_5.q,materialized_view_rewrite_by_text_6.q,materialized_view_rewrite_by_text_7.q,materialized_view_rewrite_by_text_8.q -pl itests/qtest -Pitests mvn test -Dtest=TestMaterializedViewsCache -pl ql ``` -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
