Summaries/Apache/Apache Hive/_ Functions.md

788 B

title updated created
# Functions 2022-04-03 16:58:17Z 2022-04-03 13:36:09Z
SELECT concat('1','+','3','=',cast((1 + 3) as string)) as res;

SELECT
SIZE(work_place) as array_size,
SIZE(skills_score) as map_size,
SIZE(depart_title) as complex_size,
SIZE(depart_title["Product"]) as nest_size
FROM employee;

SELECT
array_contains(work_place, 'Toronto') as is_Toronto,
sort_array(work_place) as sorted_array
FROM employee;

Date

SELECT TO_DATE(FROM_UNIXTIME(UNIX_TIMESTAMP())) as currentdate;
SELECT
reverse(split(reverse('/user/john/data/employee.txt'),'/')[0])
as linux_file_name;

Opposite of explode

SELECT
collect_set(gender_age.gender) as gender_set,
collect_list(gender_age.gender) as gender_list
FROM employee;