您现在的位置是:网站首页> 编程资料编程资料
hive中将string数据转为bigint的操作_MsSql_
2023-05-26
406人已围观
简介 hive中将string数据转为bigint的操作_MsSql_
使用 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的操作就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
相关内容
- SQL Server 使用join all优化 or 查询速度_MsSql_
- SQL删除语句DROP、TRUNCATE、 DELETE 的区别_MsSql_
- 详解partition by和group by对比_MsSql_
- 分区表场景下的 SQL 优化_MsSql_
- SQL Server异常代码处理的深入讲解_MsSql_
- SQL Server中的集合运算: UNION, EXCEPT和INTERSECT示例代码详解_MsSql_
- 图书管理系统的sqlserver数据库设计示例_MsSql_
- sql server 交集,差集的用法详解_MsSql_
- SQL Server中row_number分页查询的用法详解_MsSql_
- 秒懂drop、truncate和delete的区别_MsSql_
