网络编程
位置:首页>> 网络编程>> 数据库>> hive中将string数据转为bigint的操作

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

作者:曳落  发布时间:2024-01-20 15:37:18 

标签:hive,string,bigint

使用 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)

来源:https://blog.csdn.net/xieganyu3460/article/details/82780115

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com