June 2018
Beginner to intermediate
210 pages
5h 12m
English
Using regular aggregate functions in window functions brings more flexibility than GROUP BY, which requires all grouped columns in the select list. Since Hive v2.2.0, DISTINCT has been supported for use with aggregate functions in window functions:
> CREATE TABLE IF NOT EXISTS employee_contract ( > name string, > dept_num int, > employee_id int, > salary int, > type string, > start_date date > ) > ROW FORMAT DELIMITED > FIELDS TERMINATED BY '|' > STORED as TEXTFILE; No rows affected (0.282 seconds) > LOAD DATD INPATH '/tmp/hivedemo/data/employee_contract.txt' > OVERWRITE INTO TABLE employee_contract; No rows affected (0.48 seconds)
Read now
Unlock full access