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

ASF subversion and git services commented on IMPALA-7202:
---------------------------------------------------------

Commit 632e0e2e36463fc8dce7a50ddf2defe8dae25def in impala's branch 
refs/heads/master from Zoltan Borok-Nagy
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=632e0e2 ]

IMPALA-7412: width_bucket() function overflows too easily

Running the tests of https://gerrit.cloudera.org/#/c/10859/
it turned out that the width_bucket() function overflows
very often.

A common problem is that the function tries to cast the
'num_buckets' parameter to the decimal determined by the
Frontend. When the Frontend determined the precision and
scale of this decimal it only considered the decimal
arguments and ignored everything else. Therefore the
determined precision and scale is often not suitable for
the 'num_buckets' parameter.

WidthBucketImpl() has three decimal arguments, all of them
have the same byte size, precision, and scale. So it is
possible to interpret them as plain integers and still
calculate the proper bucket.

I included the python test cases from IMPALA-7202 developed
by Taras Bobrovytsky.
I also extended the backend tests with new test cases.

For performance test I used the following query:

SELECT sum(width_bucket(cast(l_orderkey AS DECIMAL(30, 10)),
           0, 5500000, 1000000))
FROM tpch_parquet.lineitem;

The new implementation executed it in ~0.3 seconds.
The old implementation executed it in ~0.8 seconds.

Change-Id: I68262698144029ef7f54e027e586eaf105f36ab3
Reviewed-on: http://gerrit.cloudera.org:8080/11282
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Add WIDTH_BUCKET() function to the decimal fuzz test
> ----------------------------------------------------
>
>                 Key: IMPALA-7202
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7202
>             Project: IMPALA
>          Issue Type: Task
>          Components: Infrastructure
>            Reporter: Taras Bobrovytsky
>            Assignee: Zoltán Borók-Nagy
>            Priority: Critical
>             Fix For: Impala 3.1.0
>
>
> We need to add the new WIDTH_BUCKET() function to the decimal fuzz test for 
> better coverage.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to