string - Hive:将字符串转换为整数

标签 string hive user-defined-functions hiveql

我正在寻找一个内置 UDF,将我的 hive 表中的字符串列的值转换为整数,以便使用 SELECT 和 ORDER BY 进行排序。我在语言手册中搜索过,但没有用。也欢迎任何其他建议。

最佳答案

cast(str_column as int)

来自:Language manual UDFs - type conversion functions

关于string - Hive:将字符串转换为整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12346750/

相关文章:

mysql - 如何在 hive 查询中使用 collect_set

c - 如何定义和初始化结构体内部的字符串数组?

PHP 不区分大小写和重音搜索数组

hadoop - Apache Airflow : No such file or directory: 'beeline' when trying to execute DAG with HiveOperator

Python - PySpark 的 Pickle Spacy

sql - spark sql-是否使用行转换或UDF

python - 对于 Apache Pig,如何在 python 中编写 Load UDF

c - 如何动态创建字符串数组,同时从数组条目中删除空格?

c# - 从正则表达式 C# 中的字符串替换空格 (x0020)

java - 如何修复 Hadoop : the Definitive Guide? 中 Hive UDAF 示例的 NoMatchingMethodException