How to select current date in Hive SQL

后端 未结 6 830
谎友^
谎友^ 2020-12-24 00:11

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 d

6条回答
  •  清酒与你
    2020-12-24 00:53

    select from_unixtime(unix_timestamp(current_date, 'yyyyMMdd'),'yyyy-MM-dd');
    

    current_date - current date

    yyyyMMdd - my systems current date format;

    yyyy-MM-dd - if you wish to change the format to a diff one.

提交回复
热议问题