When running in Snowflake the following command:
CREATE MATERIALIZED VIEW MV_CUSTOMER_PREFERENCE as select * from V_CUSTOMER_PREFERENCE;
I get the following error:
SQL compilation error: error line {0} at position {1} Invalid materialized view definition. More than one table referenced in the view definition
V_CUSTOMER_PREFERENCE
is an existing and functioning view (it can be queried separately), that joins information from different tables. I get the same error when I put the original query instead of the view, it's just a long and complicated SQL query.
What can be the problem with the query in the view? I cannot understand it from the error description and I didn't find related restrictions in https://docs.snowflake.net/manuals/user-guide/views-materialized.html