Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hadoop 配置单元在将一列与int或decimal值相乘时获取Null_Hadoop_Null_Hive - Fatal编程技术网

Hadoop 配置单元在将一列与int或decimal值相乘时获取Null

Hadoop 配置单元在将一列与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

在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
加载到中间表中-表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