如何在 Hive SQL 中选择当前日期 [英] How to select current date in Hive SQL
问题描述
我们如何在 Hive 中获取当前系统日期?在 MySQL 中我们有 select now(),有谁可以帮我得到查询结果.我对 Hive 非常陌生,是否有适当的 Hive 文档,其中提供了有关伪列和内置函数的详细信息.
How do we get the current system date in Hive? In MySQL we have select now(), can any one please help me to get the query results. I am very new to Hive, is there a proper documentation for Hive that gives the details information about the pseudo columns, and built-in functions.
推荐答案
根据LanguageManual,您可以使用 unix_timestamp()
获取使用默认时区的当前时间戳".如果您需要将其转换为更易读的内容,您可以使用 from_unixtime(unix_timestamp())
.
According to the LanguageManual, you can use unix_timestamp()
to get the "current time stamp using the default time zone." If you need to convert that to something more human-readable, you can use from_unixtime(unix_timestamp())
.
希望有所帮助.
这篇关于如何在 Hive SQL 中选择当前日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!