Could you help me with the problem of Hive Query Efficiency? I have two queries working on the same issue. I just can't understand why it is much faster than the other. If you know, please feel free to give an idea. Any information is appreciated!
Problem . I am trying to check the minimum value of a group of variables in a hive parquet table.
Requests . I tried the following two queries:
query 1
drop table if exists tb_1 purge;
create table if not exists tb_1 as
select 'v1' as name, min(v1) as min_value from src_tb union all
select 'v2' as name, min(v2) as min_value from src_tb union all
select 'v3' as name, min(v3) as min_value from src_tb union all
...
select 'v200' as name, min(v200) as min_value from src_tb
;
query 2
drop table if exists tb_2 purge;
create table if not exists tb_2 as
select min(v1) as min_v1
, min(v2) as min_v2
, min(v3) as min_v3
...
, min(v200) as min_v200
from src_tb
;
: 2 , 1. 5 . , 1. , , , , , . . .
? .