Hussain Towaileb has posted comments on this change. ( 
https://asterix-gerrit.ics.uci.edu/3433 )

Change subject: [ASTERIXDB-2584][FUN] Support rounding digit for round()
......................................................................


Patch Set 9:

(4 comments)

https://asterix-gerrit.ics.uci.edu/#/c/3433/9//COMMIT_MSG
Commit Message:

https://asterix-gerrit.ics.uci.edu/#/c/3433/9//COMMIT_MSG@10
PS9, Line 10:   - user can pass optional 2nd argument to round() function
> minor. fix indentation
I put it on purpose to indicate that this belongs to the item above it.
I will check if we have a standard for writing those to be consistent. :)


https://asterix-gerrit.ics.uci.edu/#/c/3433/9/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/NumericRoundFunctionTypeComputer.java
File 
asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/NumericRoundFunctionTypeComputer.java:

https://asterix-gerrit.ics.uci.edu/#/c/3433/9/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/NumericRoundFunctionTypeComputer.java@83
PS9, Line 83:             case ANY:
> ANY could be FLOAT or DOUBLE at runtime, so we should also return nullable
As discussed, since the type is "any", it will be already wrapped in a 
unknowable type from the AbstractTypeComputer.

However, I will do a quick test to confirm that to be on the safe side.


https://asterix-gerrit.ics.uci.edu/#/c/3433/9/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/NumericRoundEvaluator.java
File 
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/NumericRoundEvaluator.java:

https://asterix-gerrit.ics.uci.edu/#/c/3433/9/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/NumericRoundEvaluator.java@175
PS9, Line 175:             double multiplier = Math.pow(10, 
Math.abs(roundingDigit));
> minor. Math.abs() is redundant here because roundingDigit >= 0 at this poin
You're right, I'll do that in a follow up change.


https://asterix-gerrit.ics.uci.edu/#/c/3433/9/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/NumericRoundEvaluator.java@213
PS9, Line 213:             double multiplier = Math.pow(10, 
Math.abs(roundingDigit));
> minor. You know that roundingDigit is < 0 at this point, so could just do -
You're right, I'll do that in a follow up change.



--
To view, visit https://asterix-gerrit.ics.uci.edu/3433
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibdde2745e8bc440556e45ed07262eb33327f842b
Gerrit-Change-Number: 3433
Gerrit-PatchSet: 9
Gerrit-Owner: Hussain Towaileb <hussai...@gmail.com>
Gerrit-Reviewer: Ali Alsuliman <ali.al.solai...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose (1000171)
Gerrit-Reviewer: Dmitry Lychagin <dmitry.lycha...@couchbase.com>
Gerrit-Reviewer: Hussain Towaileb <hussai...@gmail.com>
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Comment-Date: Wed, 12 Jun 2019 21:46:18 +0000
Gerrit-HasComments: Yes

Reply via email to