0

Hive SQL's on empty partitions giving no result instead of 0 rows or actual value. For example -

--Create external Table

  1. Create external table test_tbl ( name string) partitioned by ( company string, processdate string) stored as orc location '/my/some/random/location';

– Add partion

  1. Alter table test_tbl add partition ( company='aquaifer', processdate='20220101');

– Execute following SQL's which returns no records.

  1. select max( company ) , processdate from test_tbl group by processdate ;

  2. select max(processdate ) from test_tbl ;

Same SQL (#3 & #4 above) , when execute with SPARK, returns '0' count and '20220101' respectively.

Why is this behavior difference ? How can we have a table partition with 0 rows in Hive?

dinesh028
  • 2,137
  • 5
  • 30
  • 47
  • It can be due to this bug https://issues.apache.org/jira/browse/TEZ-1135 Check your Tez version the same as one of affected versions in Jira – leftjoin Jan 06 '22 at 10:01
  • We are on Tez 0.9.1.3.1.5.0-152. The bug mentioned was fixed in 0.5.0 – dinesh028 Jan 07 '22 at 00:23

0 Answers0