You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Alexander Pivovarov (JIRA)" <ji...@apache.org> on 2015/04/24 21:53:39 UTC

[jira] [Commented] (HIVE-3404) UDF to obtain the quarter of an year if a date or timestamp is given .

    [ https://issues.apache.org/jira/browse/HIVE-3404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14511625#comment-14511625 ] 

Alexander Pivovarov commented on HIVE-3404:
-------------------------------------------

The following expression can be used to get quarter
{code}
select cast((month('2015-12-30') + 2) / 3 as int);
4
{code}

> UDF to obtain the quarter of an year if a date or timestamp is given .
> ----------------------------------------------------------------------
>
>                 Key: HIVE-3404
>                 URL: https://issues.apache.org/jira/browse/HIVE-3404
>             Project: Hive
>          Issue Type: New Feature
>          Components: UDF
>            Reporter: Sanam Naz
>         Attachments: HIVE-3404.1.patch.txt
>
>
> Hive current releases lacks a function which returns the quarter of an year if a date or timestamp is given .The function QUARTER(date) would return the quarter  from a date / timestamp .This can be used in HiveQL.This will be useful for different domains like retail ,finance etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)