You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Mehant Baid <ba...@gmail.com> on 2014/07/02 04:17:15 UTC
Re: Review Request 22607: Drill-988: Trunc func injects a long cast which
would cause loss of data
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22607/#review47174
-----------------------------------------------------------
exec/java-exec/src/main/codegen/templates/MathFunctions.java
<https://reviews.apache.org/r/22607/#comment82799>
We don't need to do anything if we are truncating a non fractional input (like int or long). Only in the case of float or double do we need to actually truncate. Could you make the change so we use BigDecimal only for double and float.
Also could you add tests to TestFunctionsQuery.
- Mehant Baid
On June 18, 2014, 2:38 a.m., Yash Sharma wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22607/
> -----------------------------------------------------------
>
> (Updated June 18, 2014, 2:38 a.m.)
>
>
> Review request for drill and Mehant Baid.
>
>
> Repository: drill-git
>
>
> Description
> -------
>
> Drill-988 - Trunc func injects a long cast which would cause loss of data
> Added BigDecimal for truncation and return type is same as passed params.
>
>
> Diffs
> -----
>
> exec/java-exec/src/main/codegen/data/MathFunc.tdd 8180141
> exec/java-exec/src/main/codegen/templates/MathFunctions.java d1ba6e8
>
> Diff: https://reviews.apache.org/r/22607/diff/
>
>
> Testing
> -------
>
> Via Sqlline
>
>
> Thanks,
>
> Yash Sharma
>
>