tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject [3/6] tajo git commit: TAJO-2108: Refactor Schema to be immutable.
Date Wed, 20 Apr 2016 20:39:36 GMT
http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestUniformRangePartition.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestUniformRangePartition.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestUniformRangePartition.java
index ece17c7..f57f5f2 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestUniformRangePartition.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestUniformRangePartition.java
@@ -19,7 +19,7 @@
 package org.apache.tajo.engine.planner;
 
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.catalog.SortSpec;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.datum.DatumFactory;
@@ -39,8 +39,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForINT2Asc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.INT2);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT2)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -69,8 +70,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForINT2Desc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.INT2);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT2)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -100,8 +102,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForINT4Asc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.INT4);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT4)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -130,8 +133,7 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForINT4Desc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.INT4);
+    Schema schema = SchemaBuilder.builder().add("col1", Type.INT4).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -161,8 +163,8 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForINT8Asc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.INT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT8).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -191,8 +193,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForInt8Desc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.INT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT8)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -222,8 +225,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForFloat4Asc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.FLOAT4);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.FLOAT4)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -252,8 +256,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForFloat4Desc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.FLOAT4);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.FLOAT4)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -283,8 +288,7 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForFloat8Asc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.FLOAT8);
+    Schema schema = SchemaBuilder.builder().add("col1", Type.FLOAT8).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -313,8 +317,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForFloat8Desc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.FLOAT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.FLOAT8)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -347,9 +352,10 @@ public class TestUniformRangePartition {
    */
   @Test
   public void testIncrementOfText() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_returnflag", Type.TEXT)
-        .addColumn("l_linestatus", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .build();
 
     SortSpec[] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -394,9 +400,10 @@ public class TestUniformRangePartition {
    */
   @Test
   public void testIncrementOfText2() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_returnflag", Type.TEXT)
-        .addColumn("l_linestatus", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -439,10 +446,11 @@ public class TestUniformRangePartition {
    */
   @Test
   public void testIncrementOfText3() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_returnflag", Type.TEXT)
-        .addColumn("l_linestatus", Type.TEXT)
-        .addColumn("final", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .add("final", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -472,8 +480,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testIncrementOfUnicode() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -500,8 +509,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testIncrementOfUnicodeOneCharSinglePartition() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -530,8 +540,8 @@ public class TestUniformRangePartition {
 
   @Test
   public void testIncrementOfUnicodeOneCharMultiPartition() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -560,8 +570,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForUnicodeTextAsc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -590,9 +601,7 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForUnicodeDiffLenBeginTextAsc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
-
+    Schema schema = SchemaBuilder.builder().add("col1", Type.TEXT).build();
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
     VTuple s = new VTuple(1);
@@ -620,8 +629,7 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForUnicodeDiffLenEndTextAsc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder().add("col1", Type.TEXT).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -650,8 +658,7 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForUnicodeTextDesc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder().add("col1", Type.TEXT).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -681,8 +688,7 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForUnicodeDiffLenBeginTextDesc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder().add("col1", Type.TEXT).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -712,8 +718,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForUnicodeDiffLenEndTextDesc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("col1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -743,9 +750,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testIncrementOfInt8() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_orderkey", Type.INT8)
-        .addColumn("l_linenumber", Type.INT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_orderkey", Type.INT8)
+        .add("l_linenumber", Type.INT8)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -770,10 +778,11 @@ public class TestUniformRangePartition {
   }
 
   @Test public void testIncrementOfInt8AndFinal() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_orderkey", Type.INT8)
-        .addColumn("l_linenumber", Type.INT8)
-        .addColumn("final", Type.INT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_orderkey", Type.INT8)
+        .add("l_linenumber", Type.INT8)
+        .add("final", Type.INT8)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -803,10 +812,11 @@ public class TestUniformRangePartition {
 
   @Test
   public void testIncrementOfFloat8() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_orderkey", Type.FLOAT8)
-        .addColumn("l_linenumber", Type.FLOAT8)
-        .addColumn("final", Type.FLOAT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_orderkey", Type.FLOAT8)
+        .add("l_linenumber", Type.FLOAT8)
+        .add("final", Type.FLOAT8)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -836,10 +846,11 @@ public class TestUniformRangePartition {
 
   @Test
   public void testIncrementOfInet4() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_orderkey", Type.INET4)
-        .addColumn("l_linenumber", Type.INET4)
-        .addColumn("final", Type.INET4);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_orderkey", Type.INET4)
+        .add("l_linenumber", Type.INET4)
+        .add("final", Type.INET4)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -869,9 +880,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartition() {
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("l_returnflag", Type.TEXT);
-    schema.addColumn("l_linestatus", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -898,9 +910,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForOnePartNum() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_returnflag", Type.TEXT)
-        .addColumn("l_linestatus", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -920,9 +933,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForOnePartNumWithOneOfTheValueNull() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_returnflag", Type.TEXT)
-        .addColumn("l_linestatus", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -942,8 +956,8 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForMultipleChars() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("KEY1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("KEY1", Type.TEXT).build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -971,8 +985,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForMultipleChars2() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("KEY1", Type.TEXT);
+    Schema schema = SchemaBuilder
+        .builder()
+        .add("KEY1", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -1002,8 +1018,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForMultipleChars2Desc() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("KEY1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("KEY1", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
     sortSpecs[0].setDescOrder();
@@ -1034,8 +1051,9 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForMultipleCharsWithSameFirstChar() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("KEY1", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("KEY1", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -1065,9 +1083,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionForOnePartNumWithBothValueNull() {
-    Schema schema = SchemaFactory.newV1()
-        .addColumn("l_returnflag", Type.TEXT)
-        .addColumn("l_linestatus", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -1087,9 +1106,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionWithNull() {
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("l_returnflag", Type.TEXT);
-    schema.addColumn("l_linestatus", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.TEXT)
+        .add("l_linestatus", Type.TEXT)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
@@ -1116,9 +1136,10 @@ public class TestUniformRangePartition {
 
   @Test
   public void testPartitionWithINET4() {
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("l_returnflag", Type.INET4);
-    schema.addColumn("l_linestatus", Type.INET4);
+    Schema schema = SchemaBuilder.builder()
+        .add("l_returnflag", Type.INET4)
+        .add("l_linestatus", Type.INET4)
+        .build();
 
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
index 788ebeb..d2d7810 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
@@ -103,7 +103,7 @@ public class TestExternalSortExec {
     catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
     conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString());
 
-    tableSchema = SchemaFactory.newV1(new Column[] {
+    tableSchema = SchemaBuilder.builder().addAll(new Column[] {
         new Column("managerid", Type.INT8),
         new Column("empid", Type.INT4),
         new Column("deptname", Type.TEXT),
@@ -119,7 +119,7 @@ public class TestExternalSortExec {
         new Column("col10", Type.INT8),
         new Column("col11", Type.INT8),
         new Column("col12", Type.INT8)
-    });
+    }).build();
 
     TableMeta employeeMeta = CatalogUtil.newTableMeta("TEXT");
     Path employeePath = new Path(testDir, "employee.csv");
@@ -215,10 +215,10 @@ public class TestExternalSortExec {
     Tuple curVal;
     int cnt = 0;
     exec.init();
-    Schema sortSchema = SchemaFactory.newV1(new Column[] {
+    Schema sortSchema = SchemaBuilder.builder().addAll(new Column[] {
         new Column("managerid", Type.INT8),
         new Column("empid", Type.INT4),
-    });
+    }).build();
 
     BaseTupleComparator comparator = new BaseTupleComparator(sortSchema,
         new SortSpec[]{

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
index 40dc373..1d2e6b5 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
@@ -101,10 +101,11 @@ public class TestFullOuterHashJoinExec {
     //  7     | dep_7     | 1007
     //  8     | dep_8     | 1008
     //  9     | dep_9     | 1009
-    Schema dep3Schema = SchemaFactory.newV1();
-    dep3Schema.addColumn("dep_id", Type.INT4);
-    dep3Schema.addColumn("dep_name", Type.TEXT);
-    dep3Schema.addColumn("loc_id", Type.INT4);
+    Schema dep3Schema = SchemaBuilder.builder()
+        .add("dep_id", Type.INT4)
+        .add("dep_name", Type.TEXT)
+        .add("loc_id", Type.INT4)
+        .build();
 
 
     TableMeta dep3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -131,9 +132,10 @@ public class TestFullOuterHashJoinExec {
     //   102    |  job_102
     //   103    |  job_103
 
-    Schema job3Schema = SchemaFactory.newV1();
-    job3Schema.addColumn("job_id", Type.INT4);
-    job3Schema.addColumn("job_title", Type.TEXT);
+    Schema job3Schema = SchemaBuilder.builder()
+        .add("job_id", Type.INT4)
+        .add("job_title", Type.TEXT)
+        .build();
 
 
     TableMeta job3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -166,13 +168,14 @@ public class TestFullOuterHashJoinExec {
     //  21     |  fn_21     |  ln_21    |  1     | 123    | 101
     //  23     |  fn_23     |  ln_23    |  3     | 369    | 103
 
-    Schema emp3Schema = SchemaFactory.newV1();
-    emp3Schema.addColumn("emp_id", Type.INT4);
-    emp3Schema.addColumn("first_name", Type.TEXT);
-    emp3Schema.addColumn("last_name", Type.TEXT);
-    emp3Schema.addColumn("dep_id", Type.INT4);
-    emp3Schema.addColumn("salary", Type.FLOAT4);
-    emp3Schema.addColumn("job_id", Type.INT4);
+    Schema emp3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("first_name", Type.TEXT)
+        .add("last_name", Type.TEXT)
+        .add("dep_id", Type.INT4)
+        .add("salary", Type.FLOAT4)
+        .add("job_id", Type.INT4)
+        .build();
 
 
     TableMeta emp3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -222,9 +225,10 @@ public class TestFullOuterHashJoinExec {
     // -----------------------------------------------
     // this table is empty, no rows
 
-    Schema phone3Schema = SchemaFactory.newV1();
-    phone3Schema.addColumn("emp_id", Type.INT4);
-    phone3Schema.addColumn("phone_number", Type.TEXT);
+    Schema phone3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("phone_number", Type.TEXT)
+        .build();
 
 
     TableMeta phone3Meta = CatalogUtil.newTableMeta("TEXT");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
index 9c426ad..0fb7bbb 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
@@ -28,12 +28,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
@@ -105,10 +105,11 @@ public class TestFullOuterMergeJoinExec {
     //  7     | dep_7     | 1007
     //  8     | dep_8     | 1008
     //  9     | dep_9     | 1009
-    Schema dep3Schema = SchemaFactory.newV1();
-    dep3Schema.addColumn("dep_id", Type.INT4);
-    dep3Schema.addColumn("dep_name", Type.TEXT);
-    dep3Schema.addColumn("loc_id", Type.INT4);
+    Schema dep3Schema = SchemaBuilder.builder()
+        .add("dep_id", Type.INT4)
+        .add("dep_name", Type.TEXT)
+        .add("loc_id", Type.INT4)
+        .build();
 
 
     TableMeta dep3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -143,10 +144,11 @@ public class TestFullOuterMergeJoinExec {
     //  8     | dep_8     | 1008
     //  9     | dep_9     | 1009
     // 10     | dep_10    | 1010
-    Schema dep4Schema = SchemaFactory.newV1();
-    dep4Schema.addColumn("dep_id", Type.INT4);
-    dep4Schema.addColumn("dep_name", Type.TEXT);
-    dep4Schema.addColumn("loc_id", Type.INT4);
+    Schema dep4Schema = SchemaBuilder.builder()
+        .add("dep_id", Type.INT4)
+        .add("dep_name", Type.TEXT)
+        .add("loc_id", Type.INT4)
+        .build();
 
 
     TableMeta dep4Meta = CatalogUtil.newTableMeta("TEXT");
@@ -175,9 +177,10 @@ public class TestFullOuterMergeJoinExec {
     //   102    |  job_102
     //   103    |  job_103
 
-    Schema job3Schema = SchemaFactory.newV1();
-    job3Schema.addColumn("job_id", Type.INT4);
-    job3Schema.addColumn("job_title", Type.TEXT);
+    Schema job3Schema = SchemaBuilder.builder()
+        .add("job_id", Type.INT4)
+        .add("job_title", Type.TEXT)
+        .build();
 
 
     TableMeta job3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -210,13 +213,14 @@ public class TestFullOuterMergeJoinExec {
     //  21     |  fn_21     |  ln_21    |  1     | 123    | 101
     //  23     |  fn_23     |  ln_23    |  3     | 369    | 103
 
-    Schema emp3Schema = SchemaFactory.newV1();
-    emp3Schema.addColumn("emp_id", Type.INT4);
-    emp3Schema.addColumn("first_name", Type.TEXT);
-    emp3Schema.addColumn("last_name", Type.TEXT);
-    emp3Schema.addColumn("dep_id", Type.INT4);
-    emp3Schema.addColumn("salary", Type.FLOAT4);
-    emp3Schema.addColumn("job_id", Type.INT4);
+    Schema emp3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("first_name", Type.TEXT)
+        .add("last_name", Type.TEXT)
+        .add("dep_id", Type.INT4)
+        .add("salary", Type.FLOAT4)
+        .add("job_id", Type.INT4)
+        .build();
 
 
     TableMeta emp3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -266,9 +270,10 @@ public class TestFullOuterMergeJoinExec {
     // -----------------------------------------------
     // this table is empty, no rows
 
-    Schema phone3Schema = SchemaFactory.newV1();
-    phone3Schema.addColumn("emp_id", Type.INT4);
-    phone3Schema.addColumn("phone_number", Type.TEXT);
+    Schema phone3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("phone_number", Type.TEXT)
+        .build();
 
 
     TableMeta phone3Meta = CatalogUtil.newTableMeta("TEXT");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
index f4257f1..cd04ea0 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -78,11 +78,12 @@ public class TestHashAntiJoinExec {
     catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
     conf = util.getConfiguration();
 
-    Schema employeeSchema = SchemaFactory.newV1();
-    employeeSchema.addColumn("managerid", Type.INT4);
-    employeeSchema.addColumn("empid", Type.INT4);
-    employeeSchema.addColumn("memid", Type.INT4);
-    employeeSchema.addColumn("deptname", Type.TEXT);
+    Schema employeeSchema = SchemaBuilder.builder()
+        .add("managerid", Type.INT4)
+        .add("empid", Type.INT4)
+        .add("memid", Type.INT4)
+        .add("deptname", Type.TEXT)
+        .build();
 
     TableMeta employeeMeta = CatalogUtil.newTableMeta("TEXT");
     Path employeePath = new Path(testDir, "employee.csv");
@@ -105,11 +106,12 @@ public class TestHashAntiJoinExec {
     employee = CatalogUtil.newTableDesc("default.employee", employeeSchema, employeeMeta, employeePath);
     catalog.createTable(employee);
 
-    Schema peopleSchema = SchemaFactory.newV1();
-    peopleSchema.addColumn("empid", Type.INT4);
-    peopleSchema.addColumn("fk_memid", Type.INT4);
-    peopleSchema.addColumn("name", Type.TEXT);
-    peopleSchema.addColumn("age", Type.INT4);
+    Schema peopleSchema = SchemaBuilder.builder()
+        .add("empid", Type.INT4)
+        .add("fk_memid", Type.INT4)
+        .add("name", Type.TEXT)
+        .add("age", Type.INT4)
+        .build();
     TableMeta peopleMeta = CatalogUtil.newTableMeta("TEXT");
     Path peoplePath = new Path(testDir, "people.csv");
     appender = ((FileTablespace) TablespaceManager.getLocalFs())

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
index 0731d9c..cdf9068 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
@@ -29,12 +29,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
@@ -80,11 +80,12 @@ public class TestHashJoinExec {
     catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
     conf = util.getConfiguration();
 
-    Schema employeeSchema = SchemaFactory.newV1();
-    employeeSchema.addColumn("managerid", Type.INT4);
-    employeeSchema.addColumn("empid", Type.INT4);
-    employeeSchema.addColumn("memid", Type.INT4);
-    employeeSchema.addColumn("deptname", Type.TEXT);
+    Schema employeeSchema = SchemaBuilder.builder()
+        .add("managerid", Type.INT4)
+        .add("empid", Type.INT4)
+        .add("memid", Type.INT4)
+        .add("deptname", Type.TEXT)
+        .build();
 
     TableMeta employeeMeta = CatalogUtil.newTableMeta("TEXT");
     Path employeePath = new Path(testDir, "employee.csv");
@@ -104,11 +105,12 @@ public class TestHashJoinExec {
     employee = CatalogUtil.newTableDesc("default.employee", employeeSchema, employeeMeta, employeePath);
     catalog.createTable(employee);
 
-    Schema peopleSchema = SchemaFactory.newV1();
-    peopleSchema.addColumn("empid", Type.INT4);
-    peopleSchema.addColumn("fk_memid", Type.INT4);
-    peopleSchema.addColumn("name", Type.TEXT);
-    peopleSchema.addColumn("age", Type.INT4);
+    Schema peopleSchema = SchemaBuilder.builder()
+        .add("empid", Type.INT4)
+        .add("fk_memid", Type.INT4)
+        .add("name", Type.TEXT)
+        .add("age", Type.INT4)
+        .build();
     TableMeta peopleMeta = CatalogUtil.newTableMeta("TEXT");
     Path peoplePath = new Path(testDir, "people.csv");
     appender = ((FileTablespace) TablespaceManager.getLocalFs())

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
index 5244652..026bbe2 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -78,11 +78,12 @@ public class TestHashSemiJoinExec {
     catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
     conf = util.getConfiguration();
 
-    Schema employeeSchema = SchemaFactory.newV1();
-    employeeSchema.addColumn("managerid", Type.INT4);
-    employeeSchema.addColumn("empid", Type.INT4);
-    employeeSchema.addColumn("memid", Type.INT4);
-    employeeSchema.addColumn("deptname", Type.TEXT);
+    Schema employeeSchema = SchemaBuilder.builder()
+        .add("managerid", Type.INT4)
+        .add("empid", Type.INT4)
+        .add("memid", Type.INT4)
+        .add("deptname", Type.TEXT)
+        .build();
 
     TableMeta employeeMeta = CatalogUtil.newTableMeta("TEXT");
     Path employeePath = new Path(testDir, "employee.csv");
@@ -105,11 +106,12 @@ public class TestHashSemiJoinExec {
     employee = CatalogUtil.newTableDesc("default.employee", employeeSchema, employeeMeta, employeePath);
     catalog.createTable(employee);
 
-    Schema peopleSchema = SchemaFactory.newV1();
-    peopleSchema.addColumn("empid", Type.INT4);
-    peopleSchema.addColumn("fk_memid", Type.INT4);
-    peopleSchema.addColumn("name", Type.TEXT);
-    peopleSchema.addColumn("age", Type.INT4);
+    Schema peopleSchema = SchemaBuilder.builder()
+        .add("empid", Type.INT4)
+        .add("fk_memid", Type.INT4)
+        .add("name", Type.TEXT)
+        .add("age", Type.INT4)
+        .build();
     TableMeta peopleMeta = CatalogUtil.newTableMeta("TEXT");
     Path peoplePath = new Path(testDir, "people.csv");
     appender = ((FileTablespace) TablespaceManager.getLocalFs())

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
index 61ccd00..c308065 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
@@ -99,10 +99,11 @@ public class TestLeftOuterHashJoinExec {
     //  7     | dep_7     | 1007
     //  8     | dep_8     | 1008
     //  9     | dep_9     | 1009
-    Schema dep3Schema = SchemaFactory.newV1();
-    dep3Schema.addColumn("dep_id", Type.INT4);
-    dep3Schema.addColumn("dep_name", Type.TEXT);
-    dep3Schema.addColumn("loc_id", Type.INT4);
+    Schema dep3Schema = SchemaBuilder.builder()
+    .add("dep_id", Type.INT4)
+    .add("dep_name", Type.TEXT)
+    .add("loc_id", Type.INT4)
+        .build();
 
 
     TableMeta dep3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -129,9 +130,10 @@ public class TestLeftOuterHashJoinExec {
     //   102    |  job_102
     //   103    |  job_103
 
-    Schema job3Schema = SchemaFactory.newV1();
-    job3Schema.addColumn("job_id", Type.INT4);
-    job3Schema.addColumn("job_title", Type.TEXT);
+    Schema job3Schema = SchemaBuilder.builder()
+        .add("job_id", Type.INT4)
+        .add("job_title", Type.TEXT)
+        .build();
 
 
     TableMeta job3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -165,13 +167,14 @@ public class TestLeftOuterHashJoinExec {
     //  21     |  fn_21     |  ln_21    |  1     | 123    | 101
     //  23     |  fn_23     |  ln_23    |  3     | 369    | 103
 
-    Schema emp3Schema = SchemaFactory.newV1();
-    emp3Schema.addColumn("emp_id", Type.INT4);
-    emp3Schema.addColumn("first_name", Type.TEXT);
-    emp3Schema.addColumn("last_name", Type.TEXT);
-    emp3Schema.addColumn("dep_id", Type.INT4);
-    emp3Schema.addColumn("salary", Type.FLOAT4);
-    emp3Schema.addColumn("job_id", Type.INT4);
+    Schema emp3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("first_name", Type.TEXT)
+        .add("last_name", Type.TEXT)
+        .add("dep_id", Type.INT4)
+        .add("salary", Type.FLOAT4)
+        .add("job_id", Type.INT4)
+        .build();
 
 
     TableMeta emp3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -222,9 +225,10 @@ public class TestLeftOuterHashJoinExec {
     // -----------------------------------------------
     // this table is empty, no rows
 
-    Schema phone3Schema = SchemaFactory.newV1();
-    phone3Schema.addColumn("emp_id", Type.INT4);
-    phone3Schema.addColumn("phone_number", Type.TEXT);
+    Schema phone3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("phone_number", Type.TEXT)
+        .build();
 
 
     TableMeta phone3Meta = CatalogUtil.newTableMeta("TEXT");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
index 88018e9..5819003 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
@@ -28,12 +28,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.plan.logical.JoinNode;
@@ -78,11 +78,12 @@ public class TestMergeJoinExec {
     catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
     conf = util.getConfiguration();
 
-    Schema employeeSchema = SchemaFactory.newV1();
-    employeeSchema.addColumn("managerid", Type.INT4);
-    employeeSchema.addColumn("empid", Type.INT4);
-    employeeSchema.addColumn("memid", Type.INT4);
-    employeeSchema.addColumn("deptname", Type.TEXT);
+    Schema employeeSchema = SchemaBuilder.builder()
+        .add("managerid", Type.INT4)
+        .add("empid", Type.INT4)
+        .add("memid", Type.INT4)
+        .add("deptname", Type.TEXT)
+        .build();
 
     TableMeta employeeMeta = CatalogUtil.newTableMeta("TEXT");
     Path employeePath = new Path(testDir, "employee.csv");
@@ -108,11 +109,12 @@ public class TestMergeJoinExec {
     employee = CatalogUtil.newTableDesc("default.employee", employeeSchema, employeeMeta, employeePath);
     catalog.createTable(employee);
 
-    Schema peopleSchema = SchemaFactory.newV1();
-    peopleSchema.addColumn("empid", Type.INT4);
-    peopleSchema.addColumn("fk_memid", Type.INT4);
-    peopleSchema.addColumn("name", Type.TEXT);
-    peopleSchema.addColumn("age", Type.INT4);
+    Schema peopleSchema = SchemaBuilder.builder()
+        .add("empid", Type.INT4)
+        .add("fk_memid", Type.INT4)
+        .add("name", Type.TEXT)
+        .add("age", Type.INT4)
+        .build();
     TableMeta peopleMeta = CatalogUtil.newTableMeta("TEXT");
     Path peoplePath = new Path(testDir, "people.csv");
     appender = ((FileTablespace) TablespaceManager.getLocalFs())

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
index 28d99b1..694193d 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
@@ -104,16 +104,18 @@ public class TestPhysicalPlanner {
       catalog.createFunction(funcDesc);
     }
 
-    Schema employeeSchema = SchemaFactory.newV1();
-    employeeSchema.addColumn("name", Type.TEXT);
-    employeeSchema.addColumn("empid", Type.INT4);
-    employeeSchema.addColumn("deptname", Type.TEXT);
-
-    Schema scoreSchema = SchemaFactory.newV1();
-    scoreSchema.addColumn("deptname", Type.TEXT);
-    scoreSchema.addColumn("class", Type.TEXT);
-    scoreSchema.addColumn("score", Type.INT4);
-    scoreSchema.addColumn("nullable", Type.TEXT);
+    Schema employeeSchema = SchemaBuilder.builder()
+        .add("name", Type.TEXT)
+        .add("empid", Type.INT4)
+        .add("deptname", Type.TEXT)
+        .build();
+
+    Schema scoreSchema = SchemaBuilder.builder()
+        .add("deptname", Type.TEXT)
+        .add("class", Type.TEXT)
+        .add("score", Type.INT4)
+        .add("nullable", Type.TEXT)
+        .build();
 
     TableMeta employeeMeta = CatalogUtil.newTableMeta("TEXT");
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestProgressExternalSortExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestProgressExternalSortExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestProgressExternalSortExec.java
index 21a08bd..eeb179f 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestProgressExternalSortExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestProgressExternalSortExec.java
@@ -80,10 +80,11 @@ public class TestProgressExternalSortExec {
     catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
     conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString());
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("managerid", TajoDataTypes.Type.INT4);
-    schema.addColumn("empid", TajoDataTypes.Type.INT4);
-    schema.addColumn("deptname", TajoDataTypes.Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("managerid", TajoDataTypes.Type.INT4)
+        .add("empid", TajoDataTypes.Type.INT4)
+        .add("deptname", TajoDataTypes.Type.TEXT)
+        .build();
 
     TableMeta employeeMeta = CatalogUtil.newTableMeta(BuiltinStorages.RAW);
     Path employeePath = new Path(testDir, "employee.raw");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRadixSort.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRadixSort.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRadixSort.java
index 8246834..f357379 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRadixSort.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRadixSort.java
@@ -21,7 +21,7 @@ package org.apache.tajo.engine.planner.physical;
 import org.apache.tajo.SessionVars;
 import org.apache.tajo.catalog.Column;
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.catalog.SortSpec;
 import org.apache.tajo.common.TajoDataTypes.DataType;
 import org.apache.tajo.common.TajoDataTypes.Type;
@@ -63,7 +63,7 @@ public class TestRadixSort {
     queryContext = new QueryContext(new TajoConf());
     queryContext.setInt(SessionVars.TEST_TIM_SORT_THRESHOLD_FOR_RADIX_SORT, 0);
 
-    schema = SchemaFactory.newV1(new Column[]{
+    schema = SchemaBuilder.builder().addAll(new Column[]{
         new Column("col0", Type.INT8),
         new Column("col1", Type.INT4),
         new Column("col2", Type.INT2),
@@ -73,7 +73,7 @@ public class TestRadixSort {
         new Column("col6", Type.INET4),
         new Column("col7", Type.FLOAT4),
         new Column("col8", Type.FLOAT8)
-    });
+    }).build();
   }
 
   private static class Param {

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
index a5c54b8..83d26c7 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.storage.*;
@@ -93,10 +93,11 @@ public class TestRightOuterHashJoinExec {
     //  7     | dep_7     | 1007
     //  8     | dep_8     | 1008
     //  9     | dep_9     | 1009
-    Schema dep3Schema = SchemaFactory.newV1();
-    dep3Schema.addColumn("dep_id", Type.INT4);
-    dep3Schema.addColumn("dep_name", Type.TEXT);
-    dep3Schema.addColumn("loc_id", Type.INT4);
+    Schema dep3Schema = SchemaBuilder.builder()
+        .add("dep_id", Type.INT4)
+        .add("dep_name", Type.TEXT)
+        .add("loc_id", Type.INT4)
+        .build();
 
 
     TableMeta dep3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -124,9 +125,10 @@ public class TestRightOuterHashJoinExec {
     //   102    |  job_102
     //   103    |  job_103
 
-    Schema job3Schema = SchemaFactory.newV1();
-    job3Schema.addColumn("job_id", Type.INT4);
-    job3Schema.addColumn("job_title", Type.TEXT);
+    Schema job3Schema = SchemaBuilder.builder()
+        .add("job_id", Type.INT4)
+        .add("job_title", Type.TEXT)
+        .build();
 
 
     TableMeta job3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -160,13 +162,14 @@ public class TestRightOuterHashJoinExec {
     //  21     |  fn_21     |  ln_21    |  1     | 123    | 101
     //  23     |  fn_23     |  ln_23    |  3     | 369    | 103
 
-    Schema emp3Schema = SchemaFactory.newV1();
-    emp3Schema.addColumn("emp_id", Type.INT4);
-    emp3Schema.addColumn("first_name", Type.TEXT);
-    emp3Schema.addColumn("last_name", Type.TEXT);
-    emp3Schema.addColumn("dep_id", Type.INT4);
-    emp3Schema.addColumn("salary", Type.FLOAT4);
-    emp3Schema.addColumn("job_id", Type.INT4);
+    Schema emp3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("first_name", Type.TEXT)
+        .add("last_name", Type.TEXT)
+        .add("dep_id", Type.INT4)
+        .add("salary", Type.FLOAT4)
+        .add("job_id", Type.INT4)
+        .build();
 
 
     TableMeta emp3Meta = CatalogUtil.newTableMeta("TEXT");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
index 22946e9..4bfe0f7 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
@@ -104,10 +104,11 @@ public class TestRightOuterMergeJoinExec {
     //  7     | dep_7     | 1007
     //  8     | dep_8     | 1008
     //  9     | dep_9     | 1009
-    Schema dep3Schema = SchemaFactory.newV1();
-    dep3Schema.addColumn("dep_id", Type.INT4);
-    dep3Schema.addColumn("dep_name", Type.TEXT);
-    dep3Schema.addColumn("loc_id", Type.INT4);
+    Schema dep3Schema = SchemaBuilder.builder()
+        .add("dep_id", Type.INT4)
+        .add("dep_name", Type.TEXT)
+        .add("loc_id", Type.INT4)
+        .build();
 
 
     TableMeta dep3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -143,10 +144,11 @@ public class TestRightOuterMergeJoinExec {
     //  8     | dep_8     | 1008
     //  9     | dep_9     | 1009
     // 10     | dep_10    | 1010
-    Schema dep4Schema = SchemaFactory.newV1();
-    dep4Schema.addColumn("dep_id", Type.INT4);
-    dep4Schema.addColumn("dep_name", Type.TEXT);
-    dep4Schema.addColumn("loc_id", Type.INT4);
+    Schema dep4Schema = SchemaBuilder.builder()
+        .add("dep_id", Type.INT4)
+        .add("dep_name", Type.TEXT)
+        .add("loc_id", Type.INT4)
+        .build();
 
 
     TableMeta dep4Meta = CatalogUtil.newTableMeta("TEXT");
@@ -176,9 +178,10 @@ public class TestRightOuterMergeJoinExec {
     //   102    |  job_102
     //   103    |  job_103
 
-    Schema job3Schema = SchemaFactory.newV1();
-    job3Schema.addColumn("job_id", Type.INT4);
-    job3Schema.addColumn("job_title", Type.TEXT);
+    Schema job3Schema = SchemaBuilder.builder()
+        .add("job_id", Type.INT4)
+        .add("job_title", Type.TEXT)
+        .build();
 
 
     TableMeta job3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -212,13 +215,14 @@ public class TestRightOuterMergeJoinExec {
     //  21     |  fn_21     |  ln_21    |  1     | 123    | 101
     //  23     |  fn_23     |  ln_23    |  3     | 369    | 103
 
-    Schema emp3Schema = SchemaFactory.newV1();
-    emp3Schema.addColumn("emp_id", Type.INT4);
-    emp3Schema.addColumn("first_name", Type.TEXT);
-    emp3Schema.addColumn("last_name", Type.TEXT);
-    emp3Schema.addColumn("dep_id", Type.INT4);
-    emp3Schema.addColumn("salary", Type.FLOAT4);
-    emp3Schema.addColumn("job_id", Type.INT4);
+    Schema emp3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("first_name", Type.TEXT)
+        .add("last_name", Type.TEXT)
+        .add("dep_id", Type.INT4)
+        .add("salary", Type.FLOAT4)
+        .add("job_id", Type.INT4)
+        .build();
 
 
     TableMeta emp3Meta = CatalogUtil.newTableMeta("TEXT");
@@ -269,10 +273,10 @@ public class TestRightOuterMergeJoinExec {
     // -----------------------------------------------
     // this table is empty, no rows
 
-    Schema phone3Schema = SchemaFactory.newV1();
-    phone3Schema.addColumn("emp_id", Type.INT4);
-    phone3Schema.addColumn("phone_number", Type.TEXT);
-
+    Schema phone3Schema = SchemaBuilder.builder()
+        .add("emp_id", Type.INT4)
+        .add("phone_number", Type.TEXT)
+        .build();
 
     TableMeta phone3Meta = CatalogUtil.newTableMeta("TEXT");
     Path phone3Path = new Path(testDir, "phone3.csv");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
index 43cc719..07b392a 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
@@ -30,7 +30,6 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.conf.TajoConf.ConfVars;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.RangePartitionAlgorithm;
@@ -38,6 +37,7 @@ import org.apache.tajo.engine.planner.UniformRangePartition;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -81,10 +81,11 @@ public class TestSortExec {
     workDir = CommonTestingUtil.getTestDir(TEST_PATH);
     sm = TablespaceManager.getLocalFs();
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("managerid", Type.INT4);
-    schema.addColumn("empid", Type.INT4);
-    schema.addColumn("deptname", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("managerid", Type.INT4)
+        .add("empid", Type.INT4)
+        .add("deptname", Type.TEXT)
+        .build();
 
     employeeMeta = CatalogUtil.newTableMeta("TEXT");
 
@@ -156,8 +157,7 @@ public class TestSortExec {
    * Later it should be moved TestUniformPartitions.
    */
   public void testTAJO_946() {
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("l_orderkey", Type.INT8);
+    Schema schema = SchemaBuilder.builder().add("l_orderkey", Type.INT8).build();
     SortSpec [] sortSpecs = PlannerUtil.schemaToSortSpecs(schema);
 
     VTuple s = new VTuple(1);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
index 2012362..7a9385b 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -84,11 +84,12 @@ public class TestSortIntersectExec {
     catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
     conf = util.getConfiguration();
 
-    Schema employeeSchema1 = SchemaFactory.newV1();
-    employeeSchema1.addColumn("managerid", TajoDataTypes.Type.INT4);
-    employeeSchema1.addColumn("empid", TajoDataTypes.Type.INT4);
-    employeeSchema1.addColumn("memid", TajoDataTypes.Type.INT4);
-    employeeSchema1.addColumn("deptname", TajoDataTypes.Type.TEXT);
+    Schema employeeSchema1 = SchemaBuilder.builder()
+        .add("managerid", TajoDataTypes.Type.INT4)
+        .add("empid", TajoDataTypes.Type.INT4)
+        .add("memid", TajoDataTypes.Type.INT4)
+        .add("deptname", TajoDataTypes.Type.TEXT)
+        .build();
 
     TableMeta employeeMeta1 = CatalogUtil.newTableMeta("TEXT");
     Path employeePath1 = new Path(testDir, "employee1.csv");
@@ -111,11 +112,12 @@ public class TestSortIntersectExec {
     employee1 = CatalogUtil.newTableDesc("default.employee1", employeeSchema1, employeeMeta1, employeePath1);
     catalog.createTable(employee1);
 
-    Schema employeeSchema2 = SchemaFactory.newV1();
-    employeeSchema2.addColumn("managerid", TajoDataTypes.Type.INT4);
-    employeeSchema2.addColumn("empid", TajoDataTypes.Type.INT4);
-    employeeSchema2.addColumn("memid", TajoDataTypes.Type.INT4);
-    employeeSchema2.addColumn("deptname", TajoDataTypes.Type.TEXT);
+    Schema employeeSchema2 = SchemaBuilder.builder()
+        .add("managerid", TajoDataTypes.Type.INT4)
+        .add("empid", TajoDataTypes.Type.INT4)
+        .add("memid", TajoDataTypes.Type.INT4)
+        .add("deptname", TajoDataTypes.Type.TEXT)
+        .build();
 
     TableMeta employeeMeta2 = CatalogUtil.newTableMeta("TEXT");
     Path employeePath2 = new Path(testDir, "employee2.csv");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestTupleSorter.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestTupleSorter.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestTupleSorter.java
index 3485df4..45546d2 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestTupleSorter.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestTupleSorter.java
@@ -24,7 +24,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.tajo.catalog.Column;
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.catalog.SortSpec;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.datum.Datum;
@@ -70,7 +70,7 @@ public class TestTupleSorter {
     Column col4 = new Column("col4", Type.INT8);
     Column col5 = new Column("col5", Type.INTERVAL);
 
-    Schema schema = SchemaFactory.newV1(new Column[] {col0, col1, col2, col3, col4, col5});
+    Schema schema = SchemaBuilder.builder().addAll(new Column[] {col0, col1, col2, col3, col4, col5}).build();
 
     long[] time1 = new long[ITERATION];
     long[] time2 = new long[ITERATION];

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestUnSafeTuple.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestUnSafeTuple.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestUnSafeTuple.java
index e2b865e..996c7d7 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestUnSafeTuple.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestUnSafeTuple.java
@@ -20,7 +20,7 @@ package org.apache.tajo.engine.planner.physical;
 
 import org.apache.tajo.catalog.Column;
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.catalog.SchemaUtil;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.datum.Datum;
@@ -49,7 +49,7 @@ public class TestUnSafeTuple {
     Column col3 = new Column("col3", Type.FLOAT4);
     Column col4 = new Column("col4", Type.FLOAT8);
 
-    schema = SchemaFactory.newV1(new Column[]{col0, col1, col2, col3, col4});
+    schema = SchemaBuilder.builder().addAll(new Column[]{col0, col1, col2, col3, col4}).build();
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
index b346d08..7f7b01f 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
@@ -20,7 +20,7 @@ package org.apache.tajo.engine.query;
 
 import org.apache.tajo.*;
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf.ConfVars;
 import org.apache.tajo.storage.StorageConstants;
@@ -421,11 +421,12 @@ public class TestGroupByQuery extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.TEXT);
-    schema.addColumn("code", Type.TEXT);
-    schema.addColumn("qty", Type.INT4);
-    schema.addColumn("qty2", Type.FLOAT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.TEXT)
+        .add("code", Type.TEXT)
+        .add("qty", Type.INT4)
+        .add("qty2", Type.FLOAT8)
+        .build();
     String[] data = new String[]{"1|a|3|3.0", "1|a|4|4.0", "1|b|5|5.0", "2|a|1|6.0", "2|c|2|7.0", "2|d|3|8.0"};
     TajoTestingCluster.createTable("table10", schema, tableOptions, data);
 
@@ -475,10 +476,11 @@ public class TestGroupByQuery extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.TEXT);
-    schema.addColumn("col2", Type.TEXT);
-    schema.addColumn("col3", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT)
+        .add("col2", Type.TEXT)
+        .add("col3", Type.TEXT)
+        .build();
 
     String[] data = new String[]{
         "a|b-1|\\N",
@@ -505,9 +507,10 @@ public class TestGroupByQuery extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.TEXT);
-    schema.addColumn("col2", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT)
+        .add("col2", Type.TEXT)
+        .build();
 
     String[] data = new String[]{
         "a|\\N",
@@ -692,9 +695,10 @@ public class TestGroupByQuery extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.TEXT);
-    schema.addColumn("col2", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.TEXT)
+        .add("col2", Type.TEXT)
+        .build();
 
     List<String> data = new ArrayList<>();
     int totalBytes = 0;

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
index a179f88..bc4628f 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
@@ -23,11 +23,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.HColumnDescriptor;
-import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.MiniHBaseCluster;
-import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.client.*;
 import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.InclusiveStopFilter;
@@ -37,7 +33,7 @@ import org.apache.tajo.IntegrationTest;
 import org.apache.tajo.QueryTestCaseBase;
 import org.apache.tajo.TajoTestingCluster;
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.catalog.TableDesc;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
@@ -822,9 +818,10 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.TEXT);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.TEXT)
+        .add("name", Type.TEXT)
+        .build();
     List<String> datas = new ArrayList<>();
     DecimalFormat df = new DecimalFormat("000");
     for (int i = 99; i >= 0; i--) {
@@ -878,9 +875,10 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.TEXT);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.TEXT)
+        .add("name", Type.TEXT)
+        .build();
     List<String> datas = new ArrayList<>();
     for (int i = 99; i >= 0; i--) {
       datas.add(i + "|value" + i);
@@ -936,9 +934,10 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.TEXT);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.TEXT)
+        .add("name", Type.TEXT)
+        .build();
     List<String> datas = new ArrayList<>();
     DecimalFormat df = new DecimalFormat("000");
     for (int i = 99; i >= 0; i--) {
@@ -994,10 +993,11 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id1", Type.TEXT);
-    schema.addColumn("id2", Type.TEXT);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id1", Type.TEXT)
+        .add("id2", Type.TEXT)
+        .add("name", Type.TEXT)
+        .build();
     DecimalFormat df = new DecimalFormat("000");
     List<String> datas = new ArrayList<>();
     for (int i = 99; i >= 0; i--) {
@@ -1051,9 +1051,10 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.INT4);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.INT4)
+        .add("name", Type.TEXT)
+        .build();
     List<String> datas = new ArrayList<>();
     for (int i = 99; i >= 0; i--) {
       datas.add(i + "|value" + i);
@@ -1107,11 +1108,12 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("rk", Type.TEXT);
-    schema.addColumn("col2_key", Type.TEXT);
-    schema.addColumn("col2_value", Type.TEXT);
-    schema.addColumn("col3", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("rk", Type.TEXT)
+        .add("col2_key", Type.TEXT)
+        .add("col2_value", Type.TEXT)
+        .add("col3", Type.TEXT)
+        .build();
     List<String> datas = new ArrayList<>();
     for (int i = 20; i >= 0; i--) {
       for (int j = 0; j < 3; j++) {
@@ -1196,9 +1198,10 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.INT4);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.INT4)
+        .add("name", Type.TEXT)
+        .build();
     List<String> datas = new ArrayList<>();
     for (int i = 99; i >= 0; i--) {
       datas.add(i + "|value" + i);
@@ -1268,9 +1271,10 @@ public class TestHBaseTable extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.TEXT);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.TEXT)
+        .add("name", Type.TEXT)
+        .build();
     List<String> datas = new ArrayList<>();
     DecimalFormat df = new DecimalFormat("000");
     for (int i = 99; i >= 0; i--) {
@@ -1389,10 +1393,11 @@ public class TestHBaseTable extends QueryTestCaseBase {
       tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
       tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-      Schema schema = SchemaFactory.newV1();
-      schema.addColumn("id", Type.TEXT);
-      schema.addColumn("name", Type.TEXT);
-      schema.addColumn("comment", Type.TEXT);
+      Schema schema = SchemaBuilder.builder()
+          .add("id", Type.TEXT)
+          .add("name", Type.TEXT)
+          .add("comment", Type.TEXT)
+          .build();
       List<String> datas = new ArrayList<>();
       DecimalFormat df = new DecimalFormat("000");
       for (int i = 99; i >= 0; i--) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
index 34f26a6..4aaca65 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
@@ -146,39 +146,45 @@ public class TestJoinQuery extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", TajoDataTypes.Type.INT4);
-    schema.addColumn("name", TajoDataTypes.Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", TajoDataTypes.Type.INT4)
+        .add("name", TajoDataTypes.Type.TEXT)
+        .build();
     String[] data = new String[]{"1|table11-1", "2|table11-2", "3|table11-3", "4|table11-4", "5|table11-5"};
     TajoTestingCluster.createTable("jointable11", schema, tableOptions, data, 2);
 
-    schema = SchemaFactory.newV1();
-    schema.addColumn("id", TajoDataTypes.Type.INT4);
-    schema.addColumn("name", TajoDataTypes.Type.TEXT);
+    schema = SchemaBuilder.builder()
+        .add("id", TajoDataTypes.Type.INT4)
+        .add("name", TajoDataTypes.Type.TEXT)
+        .build();
     data = new String[]{"1|table12-1", "2|table12-2"};
     TajoTestingCluster.createTable("jointable12", schema, tableOptions, data, 2);
 
-    schema = SchemaFactory.newV1();
-    schema.addColumn("id", TajoDataTypes.Type.INT4);
-    schema.addColumn("name", TajoDataTypes.Type.TEXT);
+    schema = SchemaBuilder.builder()
+        .add("id", TajoDataTypes.Type.INT4)
+        .add("name", TajoDataTypes.Type.TEXT)
+        .build();
     data = new String[]{"2|table13-2", "3|table13-3"};
     TajoTestingCluster.createTable("jointable13", schema, tableOptions, data);
 
-    schema = SchemaFactory.newV1();
-    schema.addColumn("id", TajoDataTypes.Type.INT4);
-    schema.addColumn("name", TajoDataTypes.Type.TEXT);
+    schema = SchemaBuilder.builder()
+        .add("id", TajoDataTypes.Type.INT4)
+        .add("name", TajoDataTypes.Type.TEXT)
+        .build();
     data = new String[]{"1|table14-1", "2|table14-2", "3|table14-3", "4|table14-4"};
     TajoTestingCluster.createTable("jointable14", schema, tableOptions, data);
 
-    schema = SchemaFactory.newV1();
-    schema.addColumn("id", TajoDataTypes.Type.INT4);
-    schema.addColumn("name", TajoDataTypes.Type.TEXT);
+    schema = SchemaBuilder.builder()
+        .add("id", TajoDataTypes.Type.INT4)
+        .add("name", TajoDataTypes.Type.TEXT)
+        .build();
     data = new String[]{};
     TajoTestingCluster.createTable("jointable15", schema, tableOptions, data);
 
-    schema = SchemaFactory.newV1();
-    schema.addColumn("id", TajoDataTypes.Type.INT4);
-    schema.addColumn("name", TajoDataTypes.Type.TEXT);
+    schema = SchemaBuilder.builder()
+        .add("id", TajoDataTypes.Type.INT4)
+        .add("name", TajoDataTypes.Type.TEXT)
+        .build();
     data = new String[]{"1000000|a", "1000001|b", "2|c", "3|d", "4|e"};
     TajoTestingCluster.createTable("jointable1", schema, tableOptions, data, 1);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestNullValues.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
index 2bca027..1966332 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
@@ -22,7 +22,7 @@ import org.apache.tajo.IntegrationTest;
 import org.apache.tajo.TajoTestingCluster;
 import org.apache.tajo.TpchTestBase;
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.client.TajoClient;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.storage.StorageConstants;
@@ -59,10 +59,11 @@ public class TestNullValues {
   @Test
   public final void testIsNull() throws Exception {
     String [] table = new String[] {"nulltable1"};
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.INT4);
-    schema.addColumn("col2", Type.TEXT);
-    schema.addColumn("col3", Type.FLOAT4);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT4)
+        .add("col2", Type.TEXT)
+        .add("col3", Type.FLOAT4)
+        .build();
     Schema [] schemas = new Schema[] {schema};
     String [] data = {
         "1|filled|0.1",
@@ -84,9 +85,10 @@ public class TestNullValues {
   @Test
   public final void testIsNotNull() throws Exception {
     String [] table = new String[] {"nulltable2"};
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.INT4);
-    schema.addColumn("col2", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT4)
+        .add("col2", Type.TEXT)
+        .build();
     Schema [] schemas = new Schema[] {schema};
     String [] data = {
         "1|filled|",
@@ -109,17 +111,18 @@ public class TestNullValues {
   @Test
   public final void testIsNotNull2() throws Exception {
     String [] table = new String[] {"nulltable3"};
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.INT8);
-    schema.addColumn("col2", Type.INT8);
-    schema.addColumn("col3", Type.INT8);
-    schema.addColumn("col4", Type.INT8);
-    schema.addColumn("col5", Type.INT8);
-    schema.addColumn("col6", Type.INT8);
-    schema.addColumn("col7", Type.INT8);
-    schema.addColumn("col8", Type.INT8);
-    schema.addColumn("col9", Type.INT8);
-    schema.addColumn("col10", Type.INT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT8)
+        .add("col2", Type.INT8)
+        .add("col3", Type.INT8)
+        .add("col4", Type.INT8)
+        .add("col5", Type.INT8)
+        .add("col6", Type.INT8)
+        .add("col7", Type.INT8)
+        .add("col8", Type.INT8)
+        .add("col9", Type.INT8)
+        .add("col10", Type.INT8)
+        .build();
     Schema [] schemas = new Schema[] {schema};
     String [] data = {
         ",,,,672287821,1301460,1,313895860387,126288907,1024",
@@ -139,17 +142,18 @@ public class TestNullValues {
   @Test
   public final void testIsNotNull3() throws Exception {
     String [] table = new String[] {"nulltable4"};
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.INT8);
-    schema.addColumn("col2", Type.INT8);
-    schema.addColumn("col3", Type.INT8);
-    schema.addColumn("col4", Type.INT8);
-    schema.addColumn("col5", Type.INT8);
-    schema.addColumn("col6", Type.INT8);
-    schema.addColumn("col7", Type.INT8);
-    schema.addColumn("col8", Type.INT8);
-    schema.addColumn("col9", Type.INT8);
-    schema.addColumn("col10", Type.INT8);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT8)
+        .add("col2", Type.INT8)
+        .add("col3", Type.INT8)
+        .add("col4", Type.INT8)
+        .add("col5", Type.INT8)
+        .add("col6", Type.INT8)
+        .add("col7", Type.INT8)
+        .add("col8", Type.INT8)
+        .add("col9", Type.INT8)
+        .add("col10", Type.INT8)
+        .build();
     Schema [] schemas = new Schema[] {schema};
     String [] data = {
         "\\N,,,,672287821,",
@@ -252,11 +256,12 @@ public class TestNullValues {
 
   private ResultSet runNullTableQuery(String tableName, String query, TajoClient client) throws Exception {
     String [] table = new String[] {tableName};
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("col1", Type.INT4);
-    schema.addColumn("col2", Type.TEXT);
-    schema.addColumn("col3", Type.FLOAT4);
-    schema.addColumn("col4", Type.BOOLEAN);
+    Schema schema = SchemaBuilder.builder()
+        .add("col1", Type.INT4)
+        .add("col2", Type.TEXT)
+        .add("col3", Type.FLOAT4)
+        .add("col4", Type.BOOLEAN)
+        .build();
     Schema [] schemas = new Schema[] {schema};
     String [] data = {
         "\\N|a|1.0|t",

http://git-wip-us.apache.org/repos/asf/tajo/blob/4aef83a3/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
index f206e20..61b5551 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
@@ -23,7 +23,7 @@ import org.apache.tajo.*;
 import org.apache.tajo.TajoProtos.QueryState;
 import org.apache.tajo.catalog.CatalogService;
 import org.apache.tajo.catalog.Schema;
-import org.apache.tajo.catalog.SchemaFactory;
+import org.apache.tajo.catalog.SchemaBuilder;
 import org.apache.tajo.catalog.TableDesc;
 import org.apache.tajo.client.QueryStatus;
 import org.apache.tajo.common.TajoDataTypes.Type;
@@ -499,9 +499,10 @@ public class TestSelectQuery extends QueryTestCaseBase {
     tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
 
-    Schema schema = SchemaFactory.newV1();
-    schema.addColumn("id", Type.INT4);
-    schema.addColumn("name", Type.TEXT);
+    Schema schema = SchemaBuilder.builder()
+        .add("id", Type.INT4)
+        .add("name", Type.TEXT)
+        .build();
     String[] data = new String[]{ "1|table11-1", "2|table11-2", "3|table11-3", "4|table11-4", "5|table11-5" };
     TajoTestingCluster.createTable("testNowInMultipleTasks".toLowerCase(), schema, tableOptions, data, 2);
 


Mime
View raw message