anujphadke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/9346 )

Change subject: IMPALA-6230, IMPALA-6468: Fix the output type of round() and 
related fns
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/9346/1/be/src/exprs/math-functions-ir.cc
File be/src/exprs/math-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/9346/1/be/src/exprs/math-functions-ir.cc@121
PS1, Line 121:       v.val * pow(10.0, scale.val) + ((v.val < 0) ? -0.5 : 0.5)) 
/ pow(10.0, scale.val));
Should we also check for overflows here , set FunctionContext with an error and 
return a NULL?
ctx->SetError

Found a couple of possible inconsistencies (without your change). If your 
change fixes it we can add these tests?

[nightly-unsecure-2.gce.cloudera.com:21000] > select dround(cast(2.500001 as 
double), 256);
Query: select dround(cast(2.500001 as double), 256)
Query submitted at: 2018-03-02 16:44:05 (Coordinator: 
http://nightly-unsecure-2.gce.cloudera.com:25000)
Query progress can be monitored at: 
http://nightly-unsecure-2.gce.cloudera.com:25000/query_plan?query_id=c5421271ce74b797:4da8702100000000
+---------------------------------------+
| dround(cast(2.500001 as double), 256) |
+---------------------------------------+
| 2.500001                              |
+---------------------------------------+
Fetched 1 row(s) in 0.01s
[nightly-unsecure-2.gce.cloudera.com:21000] > select dround(cast(2.500001 as 
double), 257);
Query: select dround(cast(2.500001 as double), 257)
Query submitted at: 2018-03-02 16:44:09 (Coordinator: 
http://nightly-unsecure-2.gce.cloudera.com:25000)
Query progress can be monitored at: 
http://nightly-unsecure-2.gce.cloudera.com:25000/query_plan?query_id=d4969d969dba34a:639969f00000000
+---------------------------------------+
| dround(cast(2.500001 as double), 257) |
+---------------------------------------+
| 2.500001000000001                     |
+---------------------------------------+
Fetched 1 row(s) in 0.01s

[nightly-unsecure-2.gce.cloudera.com:21000] > select dround(cast(2.500001 as 
double), 400);
Query: select dround(cast(2.500001 as double), 400)
Query submitted at: 2018-03-02 16:50:01 (Coordinator: 
http://nightly-unsecure-2.gce.cloudera.com:25000)
Query progress can be monitored at: 
http://nightly-unsecure-2.gce.cloudera.com:25000/query_plan?query_id=c741e669098c64a0:d7514ce100000000
+---------------------------------------+
| dround(cast(2.500001 as double), 400) |
+---------------------------------------+
| NaN                                   |
+---------------------------------------+
Fetched 1 row(s) in 0.01s



--
To view, visit http://gerrit.cloudera.org:8080/9346
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77541678012edab70b182378b11ca8753be53f97
Gerrit-Change-Number: 9346
Gerrit-PatchSet: 1
Gerrit-Owner: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Zach Amsden <zams...@cloudera.com>
Gerrit-Reviewer: anujphadke <apha...@cloudera.com>
Gerrit-Comment-Date: Sat, 03 Mar 2018 00:58:46 +0000
Gerrit-HasComments: Yes

Reply via email to