在hive中如何将下面字段变成可以做正常正序排序的int类型?

根据你提供的信息,你的字段中的数值有单位,那么解决方法就是对单位进行换算,将万的单位换算为亿之后再进行排序,sql语句如下:
SELECT id, (
case when locate('万', price )>0
THEN CAST(REGEXP_REPLACE(price, '万', '') AS DOUBLE)/10000
ELSE CAST(REGEXP_REPLACE(price, '亿', '') AS DOUBLE)
END
) as price from table_test order by price
原始测试数据:

