[ 
https://issues.apache.org/jira/browse/IMPALA-3117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Russell resolved IMPALA-3117.
----------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 2.0

All the references to rounding were removed some time back, and examples added 
showing how e.g. 'Q' always represents the start of the quarter. The fix was 
backported to all older versions of Impala docs. (I think this was all before 
theĀ arrival of the Apache Impala upstream docs.)

> Incorrect TRUNC documentation
> -----------------------------
>
>                 Key: IMPALA-3117
>                 URL: https://issues.apache.org/jira/browse/IMPALA-3117
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Docs
>    Affects Versions: Impala 2.1.1, Impala 2.2
>            Reporter: Matthew Isanuk
>            Assignee: John Russell
>            Priority: Minor
>              Labels: documentation
>             Fix For: Impala 2.0
>
>
> The current TRUNC() documentation incorrectly states that these functions 
> round a date to the sixteenth of the month. However, these functions actually 
> round to the first of the month (which is arguably the desired behavior). 
> Therefore, I'd suggest the documentation be fixed to reflect the actual 
> behavior.
> *Existing Documentation*
> trunc(timestamp, string unit)
> Purpose: Strips off fields and optionally rounds a TIMESTAMP value.
> Unit argument: The unit argument value is case-sensitive. This argument 
> string can be one of:
> SYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y: Year (rounds up on July 1).
> Q: Quarter (rounds up on the sixteenth day of the second month of the 
> quarter).
> MONTH, MON, MM, RM: Month (rounds up on the sixteenth day).
> WW, W: Same day of the week as the first day of the month.
> DDD, DD, J: Day of the month.
> DAY, DY, D: Starting day of the week.
> HH, HH12, HH24: Hour. A TIMESTAMP value rounded or truncated to the hour is 
> always represented in 24-hour notation, even for the HH12 argument string.
> MI: Minute.
> *Suggested Correction*
> trunc(timestamp, string unit)
> Purpose: Strips off fields and optionally rounds a TIMESTAMP value.
> Unit argument: The unit argument value is case-sensitive. This argument 
> string can be one of:
> SYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y: Year (rounds to the first day of the 
> year).
> Q: Quarter (rounds to the first day of the first month of the quarter).
> MONTH, MON, MM, RM: Month (rounds to the first day of the month).
> WW, W: Same day of the week as the first day of the month.
> DDD, DD, J: Day of the month.
> DAY, DY, D: First day of the week. (Week defaults to a Sunday-to-Saturday 
> definition)
> HH, HH12, HH24: Hour. A TIMESTAMP value rounded or truncated to the hour is 
> always represented in 24-hour notation, even for the HH12 argument string.
> MI: Minute.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to