Materialized view optimization should occur if the materialized view represents a domain which is a superset of the base query. However, this does not occur in many cases due to type mismatch failures. These type mismatch exceptions are thrown even when one would expect type coercion to allow for comparison (e.g. comparison between integer and bigint) The line of failure is when DomainTranslator#fromPredicate is called:
Materialized view optimization should occur if the materialized view represents a domain which is a superset of the base query. However, this does not occur in many cases due to type mismatch failures. These type mismatch exceptions are thrown even when one would expect type coercion to allow for comparison (e.g. comparison between integer and bigint) The line of failure is when
DomainTranslator#fromPredicate
is called:https://github.com/prestodb/presto/blob/4cb639c9056a965054ceaa7b51b46a38a82c1749/presto-main/src/main/java/com/facebook/presto/sql/analyzer/MaterializedViewQueryOptimizer.java#L496
An example test failure:
https://github.com/Sullivan-Patrick/presto/commit/9714c95cc9b0ae8cea213ef24c3c0d81c74fabc3