欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

hive中将string数据转为bigint的操作

程序员文章站 2022-09-06 09:35:35
使用 cast 函数将 string 转为 bigint:select cast('00321' as bigint) from table;as a bigint it will show on t...

使用 cast 函数将 string 转为 bigint:

select cast('00321' as bigint) from table;

as a bigint it will show on the screen and in delimited text files as 321.

参考:hive - converting a string to bigint

补充知识:hive中bigint和varchar字段做关联,关联数据错误的解决方法

把bigint和varchar都隐式转换成string类型的就可以关联出正确的结果了

cast(t1.party_num as string)=cast(t12.customerid as string)

以上这篇hive中将string数据转为bigint的操作就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。