I created a materialized view in Hive 22.214.171.124.0 using this kind of statement:
create materialized view test_materializedvw tblproperties('hive.materializedview.rewriting.time.window'='3min') as
The view was created correctly and the queries execute fast. However, whenever the table which was used in the select statement of the view have new records, these new records are not being automatically updated in the materialized view (even after a long time)
I tried to set also this property hive.materializedview.rewriting.time.window=3min in hive-site.xml but it doesn't work.
On the other hand, if I try to update the view issuing the command:
ALTER MATERIALIZED VIEW test_materializedvw REBUILD;
I get the following error:
java.sql.SQLException: Error while processing statement: FAILED: Hive Internal Error: org.apache.hadoop.hive.ql.metadata.HiveException(Error while invoking FailureHook. hooks: java.lang.NullPointerException
Surprising enough, despite the error, if I perform a select on the view afterwards, I can see that the view data is now updated.
Is there anything wrong with the statement I'm using to create the materialized view. Can you please provide some help?