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

hive中将string数据转为bigint的 *** 作,第1张

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)

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/886348.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-14
下一篇 2022-05-14

发表评论

登录后才能评论

评论列表(0条)

保存