[jira] [Created] (CARBONDATA-1058) When executing select query On boundryvalue an error is displaying "Decimal scale (0) cannot be greater than precision (-28)."

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (CARBONDATA-1058) When executing select query On boundryvalue an error is displaying "Decimal scale (0) cannot be greater than precision (-28)."

Akash R Nilugal (Jira)
SWATI RAO created CARBONDATA-1058:
-------------------------------------

             Summary: When executing select query On boundryvalue an error is displaying "Decimal scale (0) cannot be greater than precision (-28)."
                 Key: CARBONDATA-1058
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-1058
             Project: CarbonData
          Issue Type: Bug
          Components: sql
    Affects Versions: 1.1.0
         Environment: SPARK1.6
            Reporter: SWATI RAO
         Attachments: Test_Data1.csv, Test_Data1_h1.csv

Steps To Reproduce:
CARBONDATA :
CREATE :
0: jdbc:hive2://192.168.2.126:10000> create table Test_Boundary (c1_int int,c2_Bigint Bigint,c3_Decimal Decimal(38,30),c4_double double,c5_string string,c6_Timestamp Timestamp,c7_Datatype_Desc string) STORED BY 'org.apache.carbondata.format'
0: jdbc:hive2://192.168.2.126:10000> ;
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.28 seconds)

LOAD :
0: jdbc:hive2://192.168.2.126:10000> LOAD DATA INPATH 'hdfs://localhost:54311/BabuStore/TestData/Data/Test_Data1.csv' INTO table Test_Boundary OPTIONS('DELIMITER'=',','QUOTECHAR'='','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='');
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (1.912 seconds)

SELECT :
0: jdbc:hive2://192.168.2.126:10000> select c3_Decimal from Test_Boundary where floor(c3_Decimal)=0.00 or floor(c3_Decimal) IS NULL
0: jdbc:hive2://192.168.2.126:10000> ;
Error: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 16.0 failed 1 times, most recent failure: Lost task 0.0 in stage 16.0 (TID 17, localhost): org.apache.spark.sql.AnalysisException: Decimal scale (0) cannot be greater than precision (-28).;
        at org.apache.spark.sql.types.PrecisionInfo.<init>(DecimalType.scala:32)
        at org.apache.spark.sql.types.DecimalType.<init>(DecimalType.scala:68)
        at org.apache.spark.sql.types.DecimalType$.bounded(DecimalType.scala:155)
        at org.apache.spark.sql.types.Decimal.floor(Decimal.scala:326)
        at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificPredicate.eval(Unknown Source)
        at org.apache.spark.sql.catalyst.expressions.codegen.GeneratePredicate$$anonfun$create$2.apply(GeneratePredicate.scala:68)
        at org.apache.spark.sql.catalyst.expressions.codegen.GeneratePredicate$$anonfun$create$2.apply(GeneratePredicate.scala:68)
        at org.apache.spark.sql.execution.Filter$$anonfun$2$$anonfun$apply$2.apply(basicOperators.scala:74)
        at org.apache.spark.sql.execution.Filter$$anonfun$2$$anonfun$apply$2.apply(basicOperators.scala:72)
        at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:390)
        at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
        at scala.collection.Iterator$class.foreach(Iterator.scala:727)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
        at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
        at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:103)
        at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:47)
        at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:273)
        at scala.collection.AbstractIterator.to(Iterator.scala:1157)
        at scala.collection.TraversableOnce$class.toBuffer(TraversableOnce.scala:265)
        at scala.collection.AbstractIterator.toBuffer(Iterator.scala:1157)
        at scala.collection.TraversableOnce$class.toArray(TraversableOnce.scala:252)
        at scala.collection.AbstractIterator.toArray(Iterator.scala:1157)
        at org.apache.spark.rdd.RDD$$anonfun$collect$1$$anonfun$12.apply(RDD.scala:927)
        at org.apache.spark.rdd.RDD$$anonfun$collect$1$$anonfun$12.apply(RDD.scala:927)
        at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1858)
        at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1858)
        at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
        at org.apache.spark.scheduler.Task.run(Task.scala:89)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:227)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Driver stacktrace: (state=,code=0)


HIVE :
CREATE:
0: jdbc:hive2://192.168.2.126:10000> create table Test_Boundary_h1 (c1_int int,c2_Bigint Bigint,c3_Decimal Decimal(38,30),c4_double double,c5_string string,c6_Timestamp Timestamp,c7_Datatype_Desc string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
0: jdbc:hive2://192.168.2.126:10000> ;
+---------+--+
| result  |
+---------+--+
+---------+--+
No rows selected (0.524 seconds)

LOAD :
0: jdbc:hive2://192.168.2.126:10000> load data local inpath '/opt/Carbon/CarbonData/TestData/Data/Test_Data1_h1.csv' OVERWRITE INTO TABLE Test_Boundary_h1
0: jdbc:hive2://192.168.2.126:10000> ;
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.646 seconds)

SELECT :
0: jdbc:hive2://192.168.2.126:10000> select c3_Decimal from Test_Boundary_h1 where floor(c3_Decimal)=0.0 or floor(c3_Decimal) IS NULL
0: jdbc:hive2://192.168.2.126:10000> ;
+-----------------------------------+--+
|            c3_Decimal             |
+-----------------------------------+--+
| 0.123456789009876543211234567890  |
| 0.054000000000000000000000000000  |
| 0.123456789009876543211234567890  |
| 0.000100000000000000000000000000  |
| 0.123456789009876543211234567890  |
| NULL                              |
| 0.800000000000000000000000000000  |
| 0.900000000000000000000000000000  |
| 0E-30                             |
| 0E-30                             |
| 0.123456789009876543211234567890  |
| NULL                              |
| NULL                              |
| NULL                              |
| NULL                              |
| NULL                              |
+-----------------------------------+--+
16 rows selected (0.266 seconds)





--
This message was sent by Atlassian JIRA
(v6.3.15#6346)