Skip to content

Commit

Permalink
Data precision tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarbcs16 committed Feb 22, 2019
1 parent fb3b7a3 commit 93e9228
Show file tree
Hide file tree
Showing 68 changed files with 90 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
300057.3299998181
300057.3299997481
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/1.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.00000068987
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/1.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.00000068989 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/10.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.004
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/10.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.004 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/11.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.03000000001
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/11.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.03 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/12.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/12.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.2 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/13.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.788
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/13.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(1.787 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/14.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.78784
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/14.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(1.7878 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/15.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.7878788878
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/15.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(1.7878787878 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/16.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.78788
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/16.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(1.78787 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/17.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.6767679
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/17.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(12.676767 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/18.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
134.67670001
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/18.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(134.6767 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/19.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1444.666
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/19.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(1444.676 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/2.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.000000688
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/2.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.000000678 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/20.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15833.6767776
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/20.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(15833.6767676 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/21.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
233345.6766767
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/21.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(233345.67676767 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/22.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4523214.78
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/22.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(4523214.76 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/23.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1444.676677
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/23.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(1444.676676 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/24.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1444.676676677
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/24.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(1444.676676676 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/25.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15833.67677
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/25.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(15833.67676 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/26.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15833.676768
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/26.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(15833.676767 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/27.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15833.6767677
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/27.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(15833.6767676 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/28.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15833.67676768
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/28.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(15833.67676767 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/29.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15833.676767668
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/29.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(15833.676767667 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/3.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0000006
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/3.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.0000006 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/30.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15833.67676766768
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/30.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(15833.67676766767 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/31.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
233345.6767676768
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/31.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(233345.6767676767 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/32.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
233345.676767676768
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/32.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(233345.676767676767 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/4.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.00000589
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/4.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.00000689 as double);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/5.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0001689
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/5.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.0000689 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/6.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.000009
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/6.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.000006 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/7.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.005
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/7.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.00689 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/8.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.00008
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/8.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.00006 as float);
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/9.e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.00037
1 change: 1 addition & 0 deletions framework/resources/Functional/DataPrecision/9.q
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(0.0005 as float);
22 changes: 22 additions & 0 deletions framework/resources/Functional/DataPrecision/dataprecison.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testId": "dataprecision",
"type": "group",
"description": "Test data precision queries via jdbc",
"submit-type": "jdbc",
"categories": [
"dataprecision"
],
"matrices": [
{
"query-file": ".*.q",
"schema": "dfs.root",
"output-format": "tsv",
"expected-file": ".*.e",
"verification-type": [
"in-memory"
]
}
],
"datasources": [
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class CmdParam {
public double precisionFloat = 1.0E-6;

@Parameter(names = {"-pD"}, description = "precision value for double values", required=false)
public double precisionDouble = 1.0E-12;
public double precisionDouble = 1.0E-7;

@Parameter(names = {"-w"}, description = "enable write actual query result to file", required=false)
public boolean outputQueryResult = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.sql.Types;
import java.util.List;


/**
* Class modeling a row in a ResultSet. It also stores a values of types of each
* cell shared by all rows in a given ResultSet.
Expand Down Expand Up @@ -161,12 +162,7 @@ public int compare(ColumnList o1, ColumnList o2) {
if ((f1 + f2) / 2 != 0) {
if (!(Math.abs((f1 - f2) / ((f1 + f2) / 2)) < TestDriver.cmdParam.precisionFloat)){
if (!(Math.abs((f1 - f2) / ((f1 + f2) / 2)) < TestDriver.cmdParam.precisionFloat*10)){
if (!(Math.abs((f1 - f2) / ((f1 + f2) / 2)) < TestDriver.cmdParam.precisionFloat*100)){
return 0;
}
else{
return -1;//data precision error
}
return 0;
}
else{
return -1;
Expand Down

0 comments on commit 93e9228

Please sign in to comment.