Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Phoenix Select error

Phoenix Select error

I am getting the following error while executing the below commands.

Phoenix version used is : 4.8.1

But when i change the select query as this, I dont see error. Just multiplying it by 1.0 . Though it is stored as decimal, when i try to retrieve , i get the error

SELECT (9.71221055496e-05*REPORT_NUM)*(1-DEDUCT_NUM/100)*1.0*MULTIPLER FROM MY_TEST_TABLE;

CREATE TABLE MY_TEST_TABLE(  UUID1 VARCHAR NOT NULL,  UUID2 VARCHAR NOT NULL,  ACTION_DATE DATE NOT NULL,  ACTION_ID BIGINT NOT NULL,  REPORT_NUM DECIMAL(23,6),  MULTIPLER DECIMAL(23,6),  DEDUCT_NUM DECIMAL(23,6)CONSTRAINT PK PRIMARY KEY (UUID1,UUID2,ACTION_DATE,ACTION_ID));

upsert into MY_TEST_TABLE(UUID1,UUID2,ACTION_DATE,ACTION_ID,REPORT_NUM,MULTIPLER,DEDUCT_NUM) values ('k1','k2','2018-01-18',10105736387,135228000,1.0,0.0);

SELECT (9.71221055496e-05*REPORT_NUM)*(1-DEDUCT_NUM/100)*MULTIPLER FROM MY_TEST_TABLE;


Error: ERROR 206 (22003): The data exceeds the max capacity for the data type. DECIMAL(38,34) (state=22003,code=206)
java.sql.SQLException: ERROR 206 (22003): The data exceeds the max capacity for the data type. DECIMAL(38,34)
at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:455)
at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
at org.apache.phoenix.exception.DataExceedsCapacityException.<init>(DataExceedsCapacityException.java:34)
at org.apache.phoenix.expression.DecimalMultiplyExpression.evaluate(DecimalMultiplyExpression.java:67)
at org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:69)
at org.apache.phoenix.jdbc.PhoenixResultSet.getObject(PhoenixResultSet.java:524)
at sqlline.Rows$Row.<init>(Rows.java:157)
at sqlline.BufferedRows.<init>(BufferedRows.java:38)
at sqlline.SqlLine.print(SqlLine.java:1649)
at sqlline.Commands.execute(Commands.java:833)
at sqlline.Commands.sql(Commands.java:732)
at sqlline.SqlLine.dispatch(SqlLine.java:807)
at sqlline.SqlLine.begin(SqlLine.java:681)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:292)

Don't have an account?
Coming from Hortonworks? Activate your account here