0

I am running the below hive query. After the mapreduce is complete I see that no data is inserted.

create table t_123 as
  select  * from
(
  select * from t1 union all
  select * from t2 union all
  select * from t3   
) X

But if i just run the select query as below i get results. Data type of t1, t2 and t3 are same. Towards the end I get the below statement:

"numFiles = 27 , numRows = 0 and totalSize = 34567...."

select * from t1 union all
select * from t2 union all
select * from t3 

Any thoughts what could be the issue. I'm running this using TEZ.

Binary Nerd
  • 13,872
  • 4
  • 42
  • 44
user1206412
  • 63
  • 1
  • 10
  • Are you checking the table also using Tez? Create table as select+union on Tez will create subfolders in table location (one subfolder per subquery in UNION). Then you should set some properties to be able to query table in MR(not tez). SET hive.mapred.supports.subdirectories=TRUE; SET mapred.input.dir.recursive=TRUE; – leftjoin Sep 29 '16 at 10:31
  • see this: http://stackoverflow.com/q/26767713/2700344 – leftjoin Sep 29 '16 at 10:35

0 Answers0