You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by ji...@apache.org on 2013/12/07 14:29:53 UTC
git commit: TAJO-391: Change the default type of real values from
FLOAT4 to FLOAT8 when parsing the user queries. (DaeMyung Kang via jihoon)
Updated Branches:
refs/heads/master 469c5a243 -> b444061e2
TAJO-391: Change the default type of real values from FLOAT4 to FLOAT8 when parsing the user queries. (DaeMyung Kang via jihoon)
Project: http://git-wip-us.apache.org/repos/asf/incubator-tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tajo/commit/b444061e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/b444061e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/b444061e
Branch: refs/heads/master
Commit: b444061e2739f71de6d5ce39c2b8bc60b2fa0d9b
Parents: 469c5a2
Author: Jihoon Son <ji...@apache.org>
Authored: Sat Dec 7 22:29:36 2013 +0900
Committer: Jihoon Son <ji...@apache.org>
Committed: Sat Dec 7 22:29:36 2013 +0900
----------------------------------------------------------------------
CHANGES.txt | 3 +++
.../java/org/apache/tajo/benchmark/TPCH.java | 20 +++++++-------
.../tajo/engine/planner/LogicalPlanner.java | 4 +--
.../tajo/engine/function/TestMathFunctions.java | 28 ++++++++++----------
.../tajo/engine/query/TestInsertQuery.java | 10 +++----
.../src/site/markdown/tajo-0.2.0-doc.md | 2 +-
.../src/site/markdown/tajo-0.8.0-doc.md | 2 +-
7 files changed, 36 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/b444061e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 32735e1..728858e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -62,6 +62,9 @@ Release 0.8.0 - unreleased
IMPROVEMENTS
+ TAJO-391: Change the default type of real values from FLOAT4 to FLOAT8
+ when parsing the user queries. (DaeMyung Kang via jihoon)
+
TAJO-304: drop table command should not remove data files in default.
(hyunsik)
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/b444061e/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/TPCH.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/TPCH.java b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/TPCH.java
index 841b7cf..d11941d 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/TPCH.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/TPCH.java
@@ -67,10 +67,10 @@ public class TPCH extends BenchmarkSet {
.addColumn("l_partkey", Type.INT4) // 1
.addColumn("l_suppkey", Type.INT4) // 2
.addColumn("l_linenumber", Type.INT4) // 3
- .addColumn("l_quantity", Type.FLOAT4) // 4
- .addColumn("l_extendedprice", Type.FLOAT4) // 5
- .addColumn("l_discount", Type.FLOAT4) // 6
- .addColumn("l_tax", Type.FLOAT4) // 7
+ .addColumn("l_quantity", Type.FLOAT8) // 4
+ .addColumn("l_extendedprice", Type.FLOAT8) // 5
+ .addColumn("l_discount", Type.FLOAT8) // 6
+ .addColumn("l_tax", Type.FLOAT8) // 7
// TODO - This is temporal solution. 8 and 9 are actually Char type.
.addColumn("l_returnflag", Type.TEXT) // 8
.addColumn("l_linestatus", Type.TEXT) // 9
@@ -89,7 +89,7 @@ public class TPCH extends BenchmarkSet {
.addColumn("c_address", Type.TEXT) // 2
.addColumn("c_nationkey", Type.INT4) // 3
.addColumn("c_phone", Type.TEXT) // 4
- .addColumn("c_acctbal", Type.FLOAT4) // 5
+ .addColumn("c_acctbal", Type.FLOAT8) // 5
.addColumn("c_mktsegment", Type.TEXT) // 6
.addColumn("c_comment", Type.TEXT); // 7
schemas.put(CUSTOMER, customer);
@@ -109,7 +109,7 @@ public class TPCH extends BenchmarkSet {
.addColumn("p_type", Type.TEXT) // 4
.addColumn("p_size", Type.INT4) // 5
.addColumn("p_container", Type.TEXT) // 6
- .addColumn("p_retailprice", Type.FLOAT4) // 7
+ .addColumn("p_retailprice", Type.FLOAT8) // 7
.addColumn("p_comment", Type.TEXT); // 8
schemas.put(PART, part);
@@ -123,7 +123,7 @@ public class TPCH extends BenchmarkSet {
.addColumn("o_orderkey", Type.INT4) // 0
.addColumn("o_custkey", Type.INT4) // 1
.addColumn("o_orderstatus", Type.TEXT) // 2
- .addColumn("o_totalprice", Type.FLOAT4) // 3
+ .addColumn("o_totalprice", Type.FLOAT8) // 3
// TODO - This is temporal solution. o_orderdate is actually Date type.
.addColumn("o_orderdate", Type.TEXT) // 4
.addColumn("o_orderpriority", Type.TEXT) // 5
@@ -136,7 +136,7 @@ public class TPCH extends BenchmarkSet {
.addColumn("ps_partkey", Type.INT4) // 0
.addColumn("ps_suppkey", Type.INT4) // 1
.addColumn("ps_availqty", Type.INT4) // 2
- .addColumn("ps_supplycost", Type.FLOAT4) // 3
+ .addColumn("ps_supplycost", Type.FLOAT8) // 3
.addColumn("ps_comment", Type.TEXT); // 4
schemas.put(PARTSUPP, partsupp);
@@ -146,14 +146,14 @@ public class TPCH extends BenchmarkSet {
.addColumn("s_address", Type.TEXT) // 2
.addColumn("s_nationkey", Type.INT4) // 3
.addColumn("s_phone", Type.TEXT) // 4
- .addColumn("s_acctbal", Type.FLOAT4) // 5
+ .addColumn("s_acctbal", Type.FLOAT8) // 5
.addColumn("s_comment", Type.TEXT); // 6
schemas.put(SUPPLIER, supplier);
}
public void loadOutSchema() {
Schema q2 = new Schema()
- .addColumn("s_acctbal", Type.FLOAT4)
+ .addColumn("s_acctbal", Type.FLOAT8)
.addColumn("s_name", Type.TEXT)
.addColumn("n_name", Type.TEXT)
.addColumn("p_partkey", Type.INT4)
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/b444061e/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
index dad418d..76b9239 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
@@ -1060,7 +1060,7 @@ public class LogicalPlanner extends BaseAlgebraVisitor<LogicalPlanner.PlanContex
case Unsigned_Large_Integer:
return new ConstEval(DatumFactory.createInt8(literal.getValue()));
case Unsigned_Float:
- return new ConstEval(DatumFactory.createFloat4(literal.getValue()));
+ return new ConstEval(DatumFactory.createFloat8(literal.getValue()));
default:
throw new RuntimeException("Unsupported type: " + literal.getValueType());
}
@@ -1329,4 +1329,4 @@ public class LogicalPlanner extends BaseAlgebraVisitor<LogicalPlanner.PlanContex
return projected;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/b444061e/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestMathFunctions.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestMathFunctions.java b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestMathFunctions.java
index d905a1b..fa9e40d 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestMathFunctions.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestMathFunctions.java
@@ -85,8 +85,8 @@ public class TestMathFunctions extends ExprTestBase {
@Test
public void testSin() throws IOException {
testSimpleEval("select sin(0.0) as col1 ", new String[]{"0.0"});
- testSimpleEval("select sin(0.7) as col1 ", new String[]{"0.6442176781200616"});
- testSimpleEval("select sin(1.2) as col1 ", new String[]{"0.9320391032457895"});
+ testSimpleEval("select sin(0.7) as col1 ", new String[]{"0.644217687237691"});
+ testSimpleEval("select sin(1.2) as col1 ", new String[]{"0.9320390859672263"});
// testSimpleEval("select sin(-0.5) as col1 ", new String[]{"-0.479425538604203"});
Schema schema = new Schema();
@@ -102,8 +102,8 @@ public class TestMathFunctions extends ExprTestBase {
@Test
public void testCos() throws IOException {
testSimpleEval("select cos(0.0) as col1 ", new String[]{"1.0"});
- testSimpleEval("select cos(0.7) as col1 ", new String[]{"0.7648421949641616"});
- testSimpleEval("select cos(1.2) as col1 ", new String[]{"0.36235771003358624"});
+ testSimpleEval("select cos(0.7) as col1 ", new String[]{"0.7648421872844885"});
+ testSimpleEval("select cos(1.2) as col1 ", new String[]{"0.3623577544766736"});
// testSimpleEval("select cos(-0.5) as col1 ", new String[]{"0.8775825618903728"});
Schema schema = new Schema();
@@ -118,8 +118,8 @@ public class TestMathFunctions extends ExprTestBase {
@Test
public void testTan() throws IOException {
testSimpleEval("select tan(0.0) as col1 ", new String[]{"0.0"});
- testSimpleEval("select tan(0.3) as col1 ", new String[]{"0.30933626267125297"});
- testSimpleEval("select tan(0.8) as col1 ", new String[]{"1.0296385816093323"});
+ testSimpleEval("select tan(0.3) as col1 ", new String[]{"0.30933624960962325"});
+ testSimpleEval("select tan(0.8) as col1 ", new String[]{"1.0296385570503641"});
// testSimpleEval("select tan(-0.5) as col1 ", new String[]{"-0.5463024898437905"});
Schema schema = new Schema();
@@ -134,8 +134,8 @@ public class TestMathFunctions extends ExprTestBase {
@Test
public void testAsin() throws IOException {
testSimpleEval("select asin(0.0) as col1 ", new String[]{"0.0"});
- testSimpleEval("select asin(0.3) as col1 ", new String[]{"0.3046926665119266"});
- testSimpleEval("select asin(0.8) as col1 ", new String[]{"0.9272952378698274"});
+ testSimpleEval("select asin(0.3) as col1 ", new String[]{"0.3046926540153975"});
+ testSimpleEval("select asin(0.8) as col1 ", new String[]{"0.9272952180016123"});
// testSimpleEval("select asin(-0.5) as col1 ", new String[]{"-0.5235987755982989"});
Schema schema = new Schema();
@@ -150,8 +150,8 @@ public class TestMathFunctions extends ExprTestBase {
@Test
public void testAcos() throws IOException {
testSimpleEval("select acos(0.0) as col1 ", new String[]{"1.5707963267948966"});
- testSimpleEval("select acos(0.3) as col1 ", new String[]{"1.26610366028297"});
- testSimpleEval("select acos(0.8) as col1 ", new String[]{"0.6435010889250692"});
+ testSimpleEval("select acos(0.3) as col1 ", new String[]{"1.2661036727794992"});
+ testSimpleEval("select acos(0.8) as col1 ", new String[]{"0.6435011087932843"});
// testSimpleEval("select acos(-0.5) as col1 ", new String[]{"2.0943951023931957"});
Schema schema = new Schema();
@@ -166,8 +166,8 @@ public class TestMathFunctions extends ExprTestBase {
@Test
public void testAtan() throws IOException {
testSimpleEval("select atan(0.0) as col1 ", new String[]{"0.0"});
- testSimpleEval("select atan(0.8) as col1 ", new String[]{"0.6747409494924117"});
- testSimpleEval("select atan(1.2) as col1 ", new String[]{"0.8760580701406995"});
+ testSimpleEval("select atan(0.8) as col1 ", new String[]{"0.6747409422235527"});
+ testSimpleEval("select atan(1.2) as col1 ", new String[]{"0.8760580505981934"});
// testSimpleEval("select atan(-0.5) as col1 ", new String[]{"-0.4636476090008061"});
Schema schema = new Schema();
@@ -182,8 +182,8 @@ public class TestMathFunctions extends ExprTestBase {
@Test
public void testAtan2() throws IOException {
testSimpleEval("select atan2(0.8, 0.0) as col1 ", new String[]{"1.5707963267948966"});
- testSimpleEval("select atan2(0.8, 1.1) as col1 ", new String[]{"0.6287962831935603"});
- testSimpleEval("select atan2(2.7, 0.3) as col1 ", new String[]{"1.460139103198048"});
+ testSimpleEval("select atan2(0.8, 1.1) as col1 ", new String[]{"0.628796286415433"});
+ testSimpleEval("select atan2(2.7, 0.3) as col1 ", new String[]{"1.460139105621001"});
// testSimpleEval("select atan(-0.5, 0.3) as col1 ", new String[]{"-1.0303768265243125"});
// testSimpleEval("select atan(-0.2, -1.3) as col1 ", new String[]{"-2.988943325194528"});
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/b444061e/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestInsertQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestInsertQuery.java b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestInsertQuery.java
index 9882bc6..b770de5 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestInsertQuery.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestInsertQuery.java
@@ -53,7 +53,7 @@ public class TestInsertQuery {
@Test
public final void testInsertOverwrite() throws Exception {
String tableName ="InsertOverwrite";
- ResultSet res = tpch.execute("create table " + tableName +" (col1 int4, col2 int4, col3 float4)");
+ ResultSet res = tpch.execute("create table " + tableName +" (col1 int4, col2 int4, col3 float8)");
res.close();
TajoTestingCluster cluster = tpch.getTestingCluster();
CatalogService catalog = cluster.getMaster().getCatalog();
@@ -70,7 +70,7 @@ public class TestInsertQuery {
@Test
public final void testInsertOverwriteSmallerColumns() throws Exception {
String tableName = "insertoverwritesmallercolumns";
- ResultSet res = tpch.execute("create table " + tableName + " (col1 int4, col2 int4, col3 float4)");
+ ResultSet res = tpch.execute("create table " + tableName + " (col1 int4, col2 int4, col3 float8)");
res.close();
TajoTestingCluster cluster = tpch.getTestingCluster();
CatalogService catalog = cluster.getMaster().getCatalog();
@@ -87,7 +87,7 @@ public class TestInsertQuery {
@Test
public final void testInsertOverwriteWithTargetColumns() throws Exception {
String tableName = "InsertOverwriteWithTargetColumns";
- ResultSet res = tpch.execute("create table " + tableName + " (col1 int4, col2 int4, col3 float4)");
+ ResultSet res = tpch.execute("create table " + tableName + " (col1 int4, col2 int4, col3 float8)");
res.close();
TajoTestingCluster cluster = tpch.getTestingCluster();
CatalogService catalog = cluster.getMaster().getCatalog();
@@ -204,7 +204,7 @@ public class TestInsertQuery {
@Test
public final void testInsertOverwriteWithCompression() throws Exception {
String tableName = "testInsertOverwriteWithCompression";
- ResultSet res = tpch.execute("create table " + tableName + " (col1 int4, col2 int4, col3 float4) USING csv WITH ('csvfile.delimiter'='|','compression.codec'='org.apache.hadoop.io.compress.DeflateCodec')");
+ ResultSet res = tpch.execute("create table " + tableName + " (col1 int4, col2 int4, col3 float8) USING csv WITH ('csvfile.delimiter'='|','compression.codec'='org.apache.hadoop.io.compress.DeflateCodec')");
res.close();
TajoTestingCluster cluster = tpch.getTestingCluster();
CatalogService catalog = cluster.getMaster().getCatalog();
@@ -240,4 +240,4 @@ public class TestInsertQuery {
assertTrue(codec instanceof DeflateCodec);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/b444061e/tajo-project/src/site/markdown/tajo-0.2.0-doc.md
----------------------------------------------------------------------
diff --git a/tajo-project/src/site/markdown/tajo-0.2.0-doc.md b/tajo-project/src/site/markdown/tajo-0.2.0-doc.md
index 772f4b3..705be58 100644
--- a/tajo-project/src/site/markdown/tajo-0.2.0-doc.md
+++ b/tajo-project/src/site/markdown/tajo-0.2.0-doc.md
@@ -743,7 +743,7 @@ But, they do not support case-insensitive operators.
INSERT OVERWRITE statement overwrites a table data of an existing table or a data in a given directory. Tajo's INSERT OVERWRITE statement follows 'INSERT INTO SELECT' statement of SQL. The examples are as follows:
```
-create table t1 (col1 int8, col2 int4, col3 float4);
+create table t1 (col1 int8, col2 int4, col3 float8);
-- when a target table schema and output schema are equivalent to each other
INSERT OVERWRITE INTO t1 SELECT l_orderkey, l_partkey, l_quantity FROM lineitem;
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/b444061e/tajo-project/src/site/markdown/tajo-0.8.0-doc.md
----------------------------------------------------------------------
diff --git a/tajo-project/src/site/markdown/tajo-0.8.0-doc.md b/tajo-project/src/site/markdown/tajo-0.8.0-doc.md
index 3642093..2de57f8 100644
--- a/tajo-project/src/site/markdown/tajo-0.8.0-doc.md
+++ b/tajo-project/src/site/markdown/tajo-0.8.0-doc.md
@@ -743,7 +743,7 @@ But, they do not support case-insensitive operators.
INSERT OVERWRITE statement overwrites a table data of an existing table or a data in a given directory. Tajo's INSERT OVERWRITE statement follows 'INSERT INTO SELECT' statement of SQL. The examples are as follows:
```
-create table t1 (col1 int8, col2 int4, col3 float4);
+create table t1 (col1 int8, col2 int4, col3 float8);
-- when a target table schema and output schema are equivalent to each other
INSERT OVERWRITE INTO t1 SELECT l_orderkey, l_partkey, l_quantity FROM lineitem;