Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (2)

Problem: Certain arithmetic operations return the wrong result in Phoenix.

For example:

0: jdbc:phoenix:> select 2/4 ;
+----+
| 0  |
+----+
| 0  |
+----+
1 row selected (0.014 seconds)

Cause: This is because the result is returned as an int rather than a decimal

See PHOENIX-3312

Workaround: Provide decimal values within the SQL

e.g.
0: jdbc:phoenix:> select 2.0/4.0 ;
+------+
| 0.5  |
+------+
| 0.5  |
+------+
1 row selected (0.011 seconds)
265 Views
0 Kudos
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎06-11-2017 09:50 AM
Updated by:
 
Contributors
Top Kudoed Authors