presto的转换函数cast

Presto官方函数:http://prestodb-china.com/docs/current/functions.html

SQL语句:

select * from table where date=20180101

在hive中正常执行,presto中会报错:operator equal(varchar, bigint) are not registered

原因:Presto不支持隐式转换,要求什么格式的参数,就一定得是什么格式的参数

改为select * from table where date='20180101'


presto的转换函数:cast

cast ( value AS type )   显式转换一个值的类型 如cast(add_time as timestamp)将add_time转为timestamp类型


猜你喜欢

转载自blog.csdn.net/waiwai3/article/details/79092602
今日推荐