kasakrisz opened a new pull request #1706: URL: https://github.com/apache/hive/pull/1706
### What changes were proposed in this pull request? * Add feature: Enable materialized view rewrite of a query if the query text is the same as the query defined in the materialized view. * Enable unparsing for all queries in order to generate the expanded query text for comparison. * Refactor and extend the `HiveMaterializedViewsRegistry` with the lookup by query text functionality. ### Why are the changes needed? This patch provides an alternative way to rewrite queries using materialized views. Materialized view query definitions has some limitations like can't have `UNION`, `SORT BY` operator. These are enabled when using the text based rewrite. ### Does this PR introduce _any_ user-facing change? In some cases when rewrite was not possible because of the limitations mentioned above. With this patch the rewriting will be executed and it will have an effect of the output of `EXPLAIN`, `EXPLAIN CBO` commands: instead of the original query plan a scan on the materialized view will appear. ### How was this patch tested? ``` mvn test -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=mv_rewrite_by_text.q,masking_14.q,masking_mv.q,schq_materialized.q,sketches_materialized_view_safety.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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
