Hadoop 配置单元在将一列与int或decimal值相乘时获取Null
在hive中,我有一个内部表table1Hadoop 配置单元在将一列与int或decimal值相乘时获取Null,hadoop,null,hive,Hadoop,Null,Hive,在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 5
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
加载到中间表中-表2
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-生产比率和会计科目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
这在Hive 1.2.1中不可复制。顺便说一句,在您的示例中,
description
和select
中的列名是不同的。id acct_cnt1 acct_cnt2 27 1 7040 493 1 175 513 1 44 515 3 3810 531 1956这在Hive 1.2.1中是不可复制的。顺便说一句,在您的示例中,description
和select
中的列名是不同的。id acct_cnt1 acct_cnt2 27 1 7040 493 1 175 513 1 44 515 3 3810 531 1956