Hive CAST 到 BIGINT returns 空

Hive CAST to BIGINT returns null

我需要将它转换为双整数,因为我需要与我的配置单元结果中的另一个双整数 (123456789123) 进行异或运算。

select cast("18072662652752953069" as bigint);

returns NULL;

我是不是遗漏了什么。

它 returns NULL 只是因为您提供的数字大于 bigint 可以表示的最大数字。

根据这个Language Manual

BIGINT (8-byte signed integer, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)