Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DD7B410737 for ; Fri, 20 Feb 2015 23:44:46 +0000 (UTC) Received: (qmail 18902 invoked by uid 500); 20 Feb 2015 23:44:12 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 18837 invoked by uid 500); 20 Feb 2015 23:44:12 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 18824 invoked by uid 500); 20 Feb 2015 23:44:12 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 18821 invoked by uid 99); 20 Feb 2015 23:44:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2015 23:44:12 +0000 Date: Fri, 20 Feb 2015 23:44:12 +0000 (UTC) From: "Xiaobing Zhou (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-9480) Build UDF TRUNC to implement FIRST_DAY as compared with LAST_DAY MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-9480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiaobing Zhou updated HIVE-9480: -------------------------------- Attachment: (was: HIVE-9480.5.patch) > Build UDF TRUNC to implement FIRST_DAY as compared with LAST_DAY > ---------------------------------------------------------------- > > Key: HIVE-9480 > URL: https://issues.apache.org/jira/browse/HIVE-9480 > Project: Hive > Issue Type: Bug > Components: UDF > Affects Versions: 0.14.0 > Reporter: Xiaobing Zhou > Assignee: Xiaobing Zhou > Attachments: HIVE-9480.1.patch, HIVE-9480.3.patch, HIVE-9480.4.patch > > > Hive already supports LAST_DAY UDF, in some cases, FIRST_DAY is necessary to do date/timestamp related computation. This JIRA is to track such an implementation. Choose to impl TRUNC, a more standard way to get the first day of a a month, e.g., SELECT TRUNC('2009-12-12', 'MM'); will return 2009-12-01, SELECT TRUNC('2009-12-12', 'YEAR'); will return 2009-01-01. > BTW, this TRUNC is not as feature complete as aligned with Oracle one. only 'MM' and 'YEAR' are supported as format, however, it's a base to add on other formats. -- This message was sent by Atlassian JIRA (v6.3.4#6332)