-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23103/#review47167
-----------------------------------------------------------



exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateDateArithmeticFunctions.java
<https://reviews.apache.org/r/23103/#comment82770>

    We will be performing comparison of the input string for every row, even 
though the input string is a constant. 
    
    I think it makes sense to explode the functions and have individual 
implementations for every possible input string. For example date_trunc('year', 
date '2008-2-23') should be rewritten as date_trunc_year and there would be a 
separate implementation for month as date_trunc_month and so on.
    
    Also, please take a look at extract functions and see if we really need to 
have a new implementation for date_trunc from what I can tell you might just be 
able to rewrite date_trunc as an extractXXX function. 


- Mehant Baid


On June 27, 2014, 1:34 a.m., Cliff Buchanan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23103/
> -----------------------------------------------------------
> 
> (Updated June 27, 2014, 1:34 a.m.)
> 
> 
> Review request for drill.
> 
> 
> Repository: drill-git
> 
> 
> Description
> -------
> 
> * Added date_trunc to DateDateArithmeticFunctions
> * Do rounding with Joda
> 
> 
> Diffs
> -----
> 
>   
> exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/DateDateArithmeticFunctions.java
>  676df67 
>   
> exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
>  ff45bb5 
>   exec/java-exec/src/test/resources/functions/date/date_trunc_arithmetic.json 
> PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/23103/diff/
> 
> 
> Testing
> -------
> 
> * Added tests (which may be timezone dependent)
> * Tested w/ sqlline (to check that the right types were getting returned)
> 
> 
> Thanks,
> 
> Cliff Buchanan
> 
>

Reply via email to