приведенные ниже запросы могут быть вам полезны,
ответ @Gordon.
set hive.cli.print.header=true;
use hive_db;
create table if not exists account_table(account_number string,score string) row format delimited fields terminated by ',' stored as textfile;
insert overwrite table account_table values ("A1","600"),("A2","600"),("B1","700"),("B2","700"),("B3","700"),("C1","800"),("C2","800")
create table if not exists credit_score ( score string, balance string) row format delimited fields terminated by ',' stored as textfile;
insert overwrite table credit_score values ("600","1000"),("700","6000"),("800","8000")
select a.*,
cs.balance / count(*) over (partition by cs.score) as balance
from account_table a join
credit_score cs
on cs.score = a.score;
'''
a.account_number a.score balance
A1 600 500.0
A2 600 500.0
B1 700 2000.0
B2 700 2000.0
B3 700 2000.0
C1 800 4000.0
C2 800 4000.0
'''