Hi Karthik, Are you querying the MV directly? Can you repro with a simple example and share the list of SQL statements that you are executing to get there?
Some examples of partitioned MVs creation/usage: https://github.com/apache/hive/blob/master/ql/src/test/queries/clientpositive/materialized_view_partitioned.q https://github.com/apache/hive/blob/master/ql/src/test/queries/clientpositive/materialized_view_partitioned_2.q https://github.com/apache/hive/blob/master/ql/src/test/queries/clientpositive/materialized_view_partitioned_3.q Thanks, Jesús From: Karthik Palaniappan <karthikp8...@gmail.com> Reply-To: "dev@hive.apache.org" <dev@hive.apache.org> Date: Friday, September 7, 2018 at 8:11 AM To: "dev@hive.apache.org" <dev@hive.apache.org> Subject: Question on partitioning materialized views Hi All, Created a materialized view with partitions and tblproperties('transactional'='true') in Hive Version 4.0 running on Hadoop 3.1. View gets created properly and I can see one file in each partition. When we tried to query the view though no rows are getting returned. In describe formatted, we see that numFiles and numRows are 0. Tried gathering statistics, MSCK repair table etc and manually dropped and re-added partition. Still the materialized view returns 0 rows. Not quite sure if I am missing something or if this is a bug. Have attached the output of describe and hive-server2 logs that got generated when the materialized view was created. Log shows below error message while gathering statistics: MetaException(message:Cannot change stats state for a transactional table without providing the transactional write state for verification (new write ID 0, valid write IDs default.test_fact_mv:0:9223372036854775807::; Can you please give me some pointers to get the above materialized view working? Thanks, Karthik