在使用Amazon Athena服务格式化时间戳时,我遇到了一些问题.
select date_format(current_timestamp, 'y')
返回'y'(字符串).
我发现在Amazon Athena中设置日期格式的唯一方法是低谷CONCAT+ YEAR+ MONTH+ DAY函数,如下所示:
select CONCAT(cast(year(current_timestamp) as varchar), '_', cast(day(current_timestamp) as varchar))