在hive中我有一个内部表table1
desc table1;
col_name data_type
id int
acct_cnt1 bigint
acct_cnt2 bigint
select * from table1;
id enrl_acct_cnt unenrl_acct_cnt
27 1 7040
493 1 175
513 1 44
515 3 3810
531 1 1956
加载到中间表 - table2
export OP_RTO=2
export RUN_ID_VAR=418
hive -e "CREATE TABLE TABLE2_$RUN_ID_VAR AS SELECT ID,ACCT_CNT1,ACCT_CNT2, $OP_RTO * ACCT_CNT1 as prod_of_op_ratio_and_acct_cnt1 FROM DBNAME.TABLE1";
在最后一列中获取NULL - prod_of_op_ratio_and_acct_cnt1
select * from TABLE2_$RUN_ID_VAR;
id acct_cnt1 acct_cnt2 prod_of_op_ratio_and_acct_cnt1
27 1 7040 NULL
493 1 175 NULL
513 1 44 NULL