0

I have a existing aster script need to migrate into hive language. But i dont understand how the script define the value into the column. I dont know how to change the function so that it can be execute on hive.Anyone can help me? Here are the script.

    create table coll_ledger_cashfprofile_ta distribute by hash(it_ref_no) as (
SELECT * FROM pivot (
ON coll_ledger_cashfprofile_tb
PARTITION BY it_ref_no, file_type, comb_id, startyear
ORDER BY moorder
Partitions ('it_ref_no', 'file_type', 'comb_id', 'startyear')
Rows (45)
Metrics ('cum_cashflow', 'relcum_cf', 'relcum_cinf')
));
moreApril
  • 1
  • 3
  • May be challenging to do since this uses ROWS instead of the more common PIVOT_COLUMN. The PARTITION BY columns are used for grouping and within the group the rows are ordered by "moorder". Then in each group the first 45 or less distinct values from the metrics are assigned to columns value_0, value_1, ... value_44 – Fred Dec 01 '21 at 16:57
  • @Fred okay thanks but how to change the script into hive. – moreApril Dec 02 '21 at 03:43

0 Answers0