tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject [36/39] tajo git commit: Completed.
Date Wed, 02 Sep 2015 11:06:59 GMT
Completed.


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/a6380ccc
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/a6380ccc
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/a6380ccc

Branch: refs/heads/TAJO-1730
Commit: a6380ccc7627f1dbf8acb93836e2158fe43f92af
Parents: e3a9262
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Wed Sep 2 19:13:09 2015 +0900
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Wed Sep 2 19:13:09 2015 +0900

----------------------------------------------------------------------
 .../storage/jdbc/JdbcMetadataProviderBase.java  |   2 +-
 .../apache/tajo/storage/jdbc/JdbcScanner.java   |  16 +-
 .../storage/jdbc/SQLExpressionGenerator.java    |  26 ++-
 .../dataset/TestMysqlJdbcTableSpace/.marker     |   0
 .../results/TestMysqlJdbcTableSpace/.marker     |   0
 tajo-storage/tajo-storage-pgsql/pom.xml         |   2 +-
 .../tajo/storage/pgsql/PgSQLTablespace.java     |  12 +-
 .../tajo/storage/pgsql/EmbedPgSQLServer.java    | 174 -----------------
 .../tajo/storage/pgsql/PgSQLTestServer.java     | 193 +++++++++++++++++++
 .../storage/pgsql/TestPgSQLEndPointTests.java   |  18 +-
 .../storage/pgsql/TestPgSQLJdbcTableSpace.java  |  12 +-
 .../pgsql/TestPgSQLMetadataProvider.java        |   6 +-
 .../tajo/storage/pgsql/TestPgSQLQueryTests.java |  40 +++-
 .../pgsql/TestPgSQLSimpleQueryTests.java        |   4 +-
 .../src/test/resources/pgsql/customer.sql       |  10 +
 .../src/test/resources/pgsql/datetime_types.sql |   5 +
 .../src/test/resources/pgsql/datetime_types.txt |   4 +
 .../src/test/resources/pgsql/lineitem.sql       |  18 ++
 .../src/test/resources/pgsql/nation.sql         |   6 +
 .../src/test/resources/pgsql/orders.sql         |  11 ++
 .../src/test/resources/pgsql/part.sql           |  11 ++
 .../src/test/resources/pgsql/partsupp.sql       |   7 +
 .../src/test/resources/pgsql/region.sql         |   5 +
 .../src/test/resources/pgsql/supplier.sql       |   9 +
 .../TestPgSQLQueryTests/testDateTimeTypes.sql   |   1 +
 .../testFixedLengthFields.sql                   |   1 +
 .../testProjectedColumns.sql                    |   1 +
 .../queries/TestPgSQLQueryTests/testTPCH_Q1.sql |  21 ++
 .../TestPgSQLQueryTests/testTPCH_Q2_Part.sql    |  18 ++
 .../testVariableLengthFields.sql                |   1 +
 .../testDateTimeTypes.result                    |   6 +
 .../testFixedLengthFields.result                |   5 +
 .../testProjectedColumns.result                 |   5 +
 .../TestPgSQLQueryTests/testSimpleFilter.result |   6 +-
 .../TestPgSQLQueryTests/testTPCH_Q1.result      |   4 +
 .../TestPgSQLQueryTests/testTPCH_Q2_Part.result |   3 +
 .../testVariableLengthFields.result             |   5 +
 .../testSelectAll.result                        |  10 +-
 .../testSelectLimit.result                      |   6 +-
 .../src/test/resources/tpch/pgsql/customer.sql  |  10 -
 .../src/test/resources/tpch/pgsql/lineitem.sql  |  18 --
 .../src/test/resources/tpch/pgsql/nation.sql    |   6 -
 .../src/test/resources/tpch/pgsql/orders.sql    |  11 --
 .../src/test/resources/tpch/pgsql/part.sql      |  11 --
 .../src/test/resources/tpch/pgsql/partsupp.sql  |   7 -
 .../src/test/resources/tpch/pgsql/region.sql    |   5 -
 .../src/test/resources/tpch/pgsql/supplier.sql  |   9 -
 47 files changed, 456 insertions(+), 305 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcMetadataProviderBase.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcMetadataProviderBase.java b/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcMetadataProviderBase.java
index f623f14..d6ac46c 100644
--- a/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcMetadataProviderBase.java
+++ b/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcMetadataProviderBase.java
@@ -195,7 +195,7 @@ public abstract class JdbcMetadataProviderBase implements MetadataProvider {
         final String qualifier = resultForColumns.getString("TABLE_NAME");
         final String columnName = resultForColumns.getString("COLUMN_NAME");
         final TypeDesc type = convertDataType(resultForColumns);
-        final Column c = new Column(CatalogUtil.buildFQName(qualifier, columnName), type);
+        final Column c = new Column(CatalogUtil.buildFQName(databaseName, qualifier, columnName), type);
 
         columns.add(new Pair<>(ordinalPos, c));
       }

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcScanner.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcScanner.java b/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcScanner.java
index 897f6c5..c08451d 100644
--- a/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcScanner.java
+++ b/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcScanner.java
@@ -26,6 +26,7 @@ import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.catalog.TableMeta;
 import org.apache.tajo.catalog.statistics.TableStats;
 import org.apache.tajo.datum.DatumFactory;
+import org.apache.tajo.datum.TimeDatum;
 import org.apache.tajo.exception.TajoInternalError;
 import org.apache.tajo.exception.TajoRuntimeException;
 import org.apache.tajo.exception.UnsupportedDataTypeException;
@@ -203,20 +204,23 @@ public abstract class JdbcScanner implements Scanner {
           tuple.put(column_idx, DatumFactory.createFloat8(resultSet.getDouble(resultIdx)));
           break;
         case CHAR:
+          tuple.put(column_idx, DatumFactory.createText(resultSet.getString(resultIdx)));
+          break;
         case VARCHAR:
         case TEXT:
-          tuple.put(column_idx, DatumFactory.createText(resultSet.getString(resultIdx)));
+          // TODO - trim is unnecessary in many cases, so we can use it for certain cases
+          tuple.put(column_idx, DatumFactory.createText(resultSet.getString(resultIdx).trim()));
           break;
         case DATE:
-          Date date = resultSet.getDate(resultIdx);
-          tuple.put(column_idx, DatumFactory.createDate(date.getYear(), date.getMonth(), date.getDay()));
+          final Date date = resultSet.getDate(resultIdx);
+          tuple.put(column_idx, DatumFactory.createDate(1900 + date.getYear(), 1 + date.getMonth(), date.getDate()));
           break;
         case TIME:
-          tuple.put(column_idx, DatumFactory.createTime(resultSet.getTime(resultIdx).getTime()));
+          tuple.put(column_idx, new TimeDatum(resultSet.getTime(resultIdx).getTime() * 1000));
           break;
         case TIMESTAMP:
           tuple.put(column_idx,
-              DatumFactory.createTimestamp(DateTimeUtil.javaTimeToJulianTime(resultSet.getTime(resultIdx).getTime())));
+              DatumFactory.createTimestmpDatumWithJavaMillis(resultSet.getTimestamp(resultIdx).getTime()));
           break;
         case BINARY:
         case VARBINARY:
@@ -303,7 +307,7 @@ public abstract class JdbcScanner implements Scanner {
       try {
         resultSet.close();
       } catch (SQLException e) {
-        LOG.warn(e);;
+        LOG.warn(e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/SQLExpressionGenerator.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/SQLExpressionGenerator.java b/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/SQLExpressionGenerator.java
index 76c687a..da07257 100644
--- a/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/SQLExpressionGenerator.java
+++ b/tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/SQLExpressionGenerator.java
@@ -18,11 +18,13 @@
 
 package org.apache.tajo.storage.jdbc;
 
+import org.apache.tajo.catalog.CatalogUtil;
 import org.apache.tajo.common.TajoDataTypes.DataType;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.exception.TajoRuntimeException;
 import org.apache.tajo.exception.UnsupportedDataTypeException;
 import org.apache.tajo.plan.expr.*;
+import org.apache.tajo.util.Pair;
 
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
@@ -34,8 +36,12 @@ import java.util.Stack;
 public class SQLExpressionGenerator extends SimpleEvalNodeVisitor<SQLExpressionGenerator.Context> {
   final private DatabaseMetaData dbMetaData;
 
-  final private String DEFAULT_QUOTE_STR = "'";
-  private String QUOTE_STR;
+  private final String LITERAL_QUOTE = "'";
+  @SuppressWarnings("unused")
+  private final String DEFAULT_LITERAL_QUOTE = "'";
+  @SuppressWarnings("unused")
+  private String IDENTIFIER_QUOTE = "\"";
+  private final String DEFAULT_IDENTIFIER_QUOTE = "\"";
 
   public SQLExpressionGenerator(DatabaseMetaData dbMetaData) {
     this.dbMetaData = dbMetaData;
@@ -48,11 +54,11 @@ public class SQLExpressionGenerator extends SimpleEvalNodeVisitor<SQLExpressionG
       quoteStr = dbMetaData.getIdentifierQuoteString();
     } catch (SQLException e) {
     }
-    this.QUOTE_STR = quoteStr != null ? quoteStr : DEFAULT_QUOTE_STR;
+    this.IDENTIFIER_QUOTE = quoteStr != null ? quoteStr : DEFAULT_IDENTIFIER_QUOTE;
   }
 
   public String quote(String text) {
-    return QUOTE_STR + text + QUOTE_STR;
+    return LITERAL_QUOTE + text + LITERAL_QUOTE;
   }
 
   public String generate(EvalNode node) {
@@ -131,13 +137,21 @@ public class SQLExpressionGenerator extends SimpleEvalNodeVisitor<SQLExpressionG
 
   @Override
   protected EvalNode visitField(Context context, FieldEval field, Stack<EvalNode> stack) {
-    context.put(field.getName());
+    // strip the database name
+    String tableName;
+    if (CatalogUtil.isSimpleIdentifier(field.getQualifier())) {
+      tableName = field.getQualifier();
+    } else {
+      tableName = CatalogUtil.extractSimpleName(field.getQualifier());
+    }
+
+    context.put(CatalogUtil.buildFQName(tableName, field.getColumnName()));
     return field;
   }
 
   @Override
   protected EvalNode visitConst(Context context, ConstEval constant, Stack<EvalNode> stack) {
-    context.sb.append(convertLiteralToSQLRepr(constant.getValue()));
+    context.sb.append(convertLiteralToSQLRepr(constant.getValue())).append(" ");
     return constant;
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-mysql/src/test/resources/dataset/TestMysqlJdbcTableSpace/.marker
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-mysql/src/test/resources/dataset/TestMysqlJdbcTableSpace/.marker b/tajo-storage/tajo-storage-mysql/src/test/resources/dataset/TestMysqlJdbcTableSpace/.marker
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-mysql/src/test/resources/results/TestMysqlJdbcTableSpace/.marker
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-mysql/src/test/resources/results/TestMysqlJdbcTableSpace/.marker b/tajo-storage/tajo-storage-mysql/src/test/resources/results/TestMysqlJdbcTableSpace/.marker
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/pom.xml
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/pom.xml b/tajo-storage/tajo-storage-pgsql/pom.xml
index 074950c..7333706 100644
--- a/tajo-storage/tajo-storage-pgsql/pom.xml
+++ b/tajo-storage/tajo-storage-pgsql/pom.xml
@@ -55,7 +55,7 @@
             <exclude>src/test/resources/dataset/**</exclude>
             <exclude>src/test/resources/queries/**</exclude>
             <exclude>src/test/resources/results/**</exclude>
-            <exclude>src/test/resources/tpch/**</exclude>
+            <exclude>src/test/resources/pgsql/**</exclude>
           </excludes>
         </configuration>
         <executions>

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/main/java/org/apache/tajo/storage/pgsql/PgSQLTablespace.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/main/java/org/apache/tajo/storage/pgsql/PgSQLTablespace.java b/tajo-storage/tajo-storage-pgsql/src/main/java/org/apache/tajo/storage/pgsql/PgSQLTablespace.java
index af314a1..4abb37b 100644
--- a/tajo-storage/tajo-storage-pgsql/src/main/java/org/apache/tajo/storage/pgsql/PgSQLTablespace.java
+++ b/tajo-storage/tajo-storage-pgsql/src/main/java/org/apache/tajo/storage/pgsql/PgSQLTablespace.java
@@ -66,13 +66,13 @@ public class PgSQLTablespace extends JdbcTablespace {
       target = schema;
     }
 
+    Scanner scanner;
     if (fragment.isEmpty()) {
-      Scanner scanner = new NullScanner(conf, schema, meta, fragment);
-      scanner.setTarget(target.toArray());
-
-      return scanner;
+      scanner = new NullScanner(conf, schema, meta, fragment);
+    } else {
+      scanner = new PgSQLJdbcScanner(getDatabaseMetaData(), schema, meta, (JdbcFragment) fragment);
     }
-
-    return new PgSQLJdbcScanner(getDatabaseMetaData(), schema, meta, (JdbcFragment) fragment);
+    scanner.setTarget(target.toArray());
+    return scanner;
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/EmbedPgSQLServer.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/EmbedPgSQLServer.java b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/EmbedPgSQLServer.java
deleted file mode 100644
index f9425ad..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/EmbedPgSQLServer.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.tajo.storage.pgsql;
-
-import io.airlift.testing.postgresql.TestingPostgreSqlServer;
-import net.minidev.json.JSONObject;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.fs.Path;
-import org.apache.tajo.conf.TajoConf;
-import org.apache.tajo.storage.TablespaceManager;
-import org.apache.tajo.util.CommonTestingUtil;
-import org.apache.tajo.util.FileUtil;
-import org.apache.tajo.util.JavaResourceUtil;
-
-import java.io.IOException;
-import java.net.URI;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.HashMap;
-import java.util.Map;
-
-public class EmbedPgSQLServer {
-  private static final Log LOG = LogFactory.getLog(EmbedPgSQLServer.class);
-
-  private static EmbedPgSQLServer instance;
-
-  public static final String [] TPCH_TABLES = {
-      "customer", "lineitem", "nation", "orders", "part", "partsupp", "region", "supplier"
-  };
-
-  public static final String SPACENAME = "pgsql_cluster";
-  public static final String DATABASE_NAME = "tpch";
-
-  private final TestingPostgreSqlServer server;
-
-  static {
-    try {
-      instance = new EmbedPgSQLServer();
-    } catch (Exception e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  public static EmbedPgSQLServer getInstance() {
-    return instance;
-  }
-
-  private EmbedPgSQLServer() throws Exception {
-    server = new TestingPostgreSqlServer("testuser",
-        "tpch"
-    );
-
-    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
-      @Override
-      public void run() {
-        try {
-          server.close();
-        } catch (IOException e) {
-          e.printStackTrace();
-        }
-      }
-    }));
-
-    loadTPCHTables();
-    registerTablespace();
-  }
-
-  private void loadTPCHTables() throws SQLException, IOException {
-    Path testPath = CommonTestingUtil.getTestDir();
-
-    try (Connection connection = DriverManager.getConnection(getJdbcUrlForAdmin(), "postgres", null)) {
-      connection.setCatalog("tpch");
-
-      try (Statement statement = connection.createStatement()) {
-
-        for (String tableName : TPCH_TABLES) {
-          String sql = JavaResourceUtil.readTextFromResource("tpch/pgsql/" + tableName + ".sql");
-          statement.addBatch(sql);
-        }
-
-        statement.executeBatch();
-
-        for (String tableName : TPCH_TABLES) {
-          String csvTable = JavaResourceUtil.readTextFromResource("tpch/" + tableName + ".tbl");
-          String fixedCsvTable = fixExtraColumn(csvTable);
-          Path filePath = new Path(testPath, tableName + ".tbl");
-          FileUtil.writeTextToFile(fixedCsvTable, filePath);
-
-          String copyCommand =
-              "COPY " + tableName + " FROM '" + filePath.toUri().getPath() + "' WITH (FORMAT csv, DELIMITER '|');";
-          statement.executeUpdate(copyCommand);
-        }
-
-      } catch (Throwable t) {
-        t.printStackTrace();
-        throw t;
-      }
-    }
-  }
-
-  private String fixExtraColumn(String csvTable) {
-    final String [] lines = csvTable.split("\n");
-    final StringBuilder rewritten = new StringBuilder();
-
-    for (String l : lines) {
-      if (l.charAt(l.length() - 1) == '|') {
-        rewritten.append(l.substring(0, l.length() - 1));
-      } else {
-        rewritten.append(l.substring(0, l.length()));
-      }
-      rewritten.append("\n");
-    }
-
-    return rewritten.toString();
-  }
-
-  private void registerTablespace() throws IOException {
-    JSONObject configElements = new JSONObject();
-    configElements.put("database", DATABASE_NAME);
-
-    Map<String, JSONObject> configMap = new HashMap<>();
-    configMap.put(TablespaceManager.TABLESPACE_SPEC_CONFIGS_KEY, configElements);
-    JSONObject config = new JSONObject(configMap);
-
-    PgSQLTablespace tablespace = new PgSQLTablespace(SPACENAME, URI.create(getJdbcUrlForAdmin()), config);
-    tablespace.init(new TajoConf());
-
-    TablespaceManager.addTableSpaceForTest(tablespace);
-  }
-
-  /**
-   * get JDBC URL for a created user
-   *
-   * @return JDBC URL for the created user
-   */
-  public String getJdbcUrl() {
-    return server.getJdbcUrl() + "&connectTimeout=5&socketTimeout=5";
-  }
-
-  /**
-   * get JDBC URL for the Admin user
-   *
-   * @return JDBC URL for the Admin user
-   */
-  public String getJdbcUrlForAdmin() {
-    // replace 'user' by postgres (admin)
-    String url = server.getJdbcUrl().split("\\?")[0];
-    url += "?user=postgres&connectTimeout=5&socketTimeout=5";
-    return url;
-  }
-
-  public TestingPostgreSqlServer getServer() {
-    return server;
-  }
-}

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/PgSQLTestServer.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/PgSQLTestServer.java b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/PgSQLTestServer.java
new file mode 100644
index 0000000..e5260f1
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/PgSQLTestServer.java
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tajo.storage.pgsql;
+
+import io.airlift.testing.postgresql.TestingPostgreSqlServer;
+import net.minidev.json.JSONObject;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.Path;
+import org.apache.tajo.conf.TajoConf;
+import org.apache.tajo.storage.TablespaceManager;
+import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.FileUtil;
+import org.apache.tajo.util.JavaResourceUtil;
+
+import java.io.IOException;
+import java.net.URI;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.HashMap;
+import java.util.Map;
+
+public class PgSQLTestServer {
+  private static final Log LOG = LogFactory.getLog(PgSQLTestServer.class);
+
+  private static PgSQLTestServer instance;
+
+  public static final String [] TPCH_TABLES = {
+      "customer", "lineitem", "nation", "orders", "part", "partsupp", "region", "supplier"
+  };
+
+  public static final String SPACENAME = "pgsql_cluster";
+  public static final String DATABASE_NAME = "tpch";
+
+  private final TestingPostgreSqlServer server;
+
+  static {
+    try {
+      instance = new PgSQLTestServer();
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  public static PgSQLTestServer getInstance() {
+    return instance;
+  }
+
+  private PgSQLTestServer() throws Exception {
+    server = new TestingPostgreSqlServer("testuser",
+        "tpch"
+    );
+
+    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
+      @Override
+      public void run() {
+        try {
+          server.close();
+        } catch (IOException e) {
+          e.printStackTrace();
+        }
+      }
+    }));
+
+    loadTPCHTables();
+    registerTablespace();
+  }
+
+  Path testPath = CommonTestingUtil.getTestDir();
+
+  private void loadTPCHTables() throws SQLException, IOException {
+
+
+    try (Connection connection = DriverManager.getConnection(getJdbcUrlForAdmin(), "postgres", null)) {
+      connection.setCatalog("tpch");
+
+      try (Statement statement = connection.createStatement()) {
+
+        for (String tableName : TPCH_TABLES) {
+          String sql = JavaResourceUtil.readTextFromResource("pgsql/" + tableName + ".sql");
+          statement.executeUpdate(sql);
+
+          // restore the table contents into a file stored in a local file system for PgSQL COPY command
+          String path = restoreTableContents(tableName);
+          String copyCommand = genLoadStatement(tableName, path);
+          statement.executeUpdate(copyCommand);
+        }
+
+        // load DATETIME_TYPES table
+        String sql = JavaResourceUtil.readTextFromResource("pgsql/datetime_types.sql");
+        statement.executeUpdate(sql);
+        Path filePath = new Path(testPath, "datetime_types.txt");
+        storeTableContents("pgsql/datetime_types.txt", filePath);
+        String copyCommand = genLoadStatement("datetime_types", filePath.toUri().getPath());
+        LOG.info(copyCommand);
+        statement.executeUpdate(copyCommand);
+
+      } catch (Throwable t) {
+        t.printStackTrace();
+        throw t;
+      }
+    }
+  }
+
+  private String genLoadStatement(String tableName, String path) {
+    return  "COPY " + tableName + " FROM '" + path + "' WITH (FORMAT csv, DELIMITER '|');";
+  }
+
+  private void storeTableContents(String resource, Path path) throws IOException {
+    String csvTable = JavaResourceUtil.readTextFromResource(resource);
+    String fixedCsvTable = fixExtraColumn(csvTable);
+    FileUtil.writeTextToFile(fixedCsvTable, path);
+  }
+
+  private String restoreTableContents(String tableName) throws IOException {
+    Path filePath = new Path(testPath, tableName + ".tbl");
+    storeTableContents("tpch/" + tableName + ".tbl", filePath);
+    return filePath.toUri().getPath();
+  }
+
+  private String fixExtraColumn(String csvTable) {
+    final String [] lines = csvTable.split("\n");
+    final StringBuilder rewritten = new StringBuilder();
+
+    for (String l : lines) {
+      if (l.charAt(l.length() - 1) == '|') {
+        rewritten.append(l.substring(0, l.length() - 1));
+      } else {
+        rewritten.append(l.substring(0, l.length()));
+      }
+      rewritten.append("\n");
+    }
+
+    return rewritten.toString();
+  }
+
+  private void registerTablespace() throws IOException {
+    JSONObject configElements = new JSONObject();
+    configElements.put("database", DATABASE_NAME);
+
+    Map<String, JSONObject> configMap = new HashMap<>();
+    configMap.put(TablespaceManager.TABLESPACE_SPEC_CONFIGS_KEY, configElements);
+    JSONObject config = new JSONObject(configMap);
+
+    PgSQLTablespace tablespace = new PgSQLTablespace(SPACENAME, URI.create(getJdbcUrlForAdmin()), config);
+    tablespace.init(new TajoConf());
+
+    TablespaceManager.addTableSpaceForTest(tablespace);
+  }
+
+  /**
+   * get JDBC URL for a created user
+   *
+   * @return JDBC URL for the created user
+   */
+  public String getJdbcUrl() {
+    return server.getJdbcUrl() + "&connectTimeout=5&socketTimeout=5";
+  }
+
+  /**
+   * get JDBC URL for the Admin user
+   *
+   * @return JDBC URL for the Admin user
+   */
+  public String getJdbcUrlForAdmin() {
+    // replace 'user' by postgres (admin)
+    String url = server.getJdbcUrl().split("\\?")[0];
+    url += "?user=postgres&connectTimeout=5&socketTimeout=5";
+    return url;
+  }
+
+  public TestingPostgreSqlServer getServer() {
+    return server;
+  }
+}

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLEndPointTests.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLEndPointTests.java b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLEndPointTests.java
index 2b54a62..638a8e9 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLEndPointTests.java
+++ b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLEndPointTests.java
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 public class TestPgSQLEndPointTests extends QueryTestCaseBase {
-  private static final String jdbcUrl = EmbedPgSQLServer.getInstance().getJdbcUrlForAdmin();
+  private static final String jdbcUrl = PgSQLTestServer.getInstance().getJdbcUrlForAdmin();
   private static TajoClient client;
 
 
@@ -48,23 +48,23 @@ public class TestPgSQLEndPointTests extends QueryTestCaseBase {
     client.close();
   }
 
-  @Test(timeout = 5000)
+  @Test(timeout = 1000)
   public void testGetAllDatabaseNames() {
     Set<String> retrieved = Sets.newHashSet(client.getAllDatabaseNames());
-    assertTrue(retrieved.contains(EmbedPgSQLServer.DATABASE_NAME));
+    assertTrue(retrieved.contains(PgSQLTestServer.DATABASE_NAME));
   }
 
-  @Test(timeout = 5000)
+  @Test(timeout = 1000)
   public void testGetTableList() {
     Set<String> retrieved = Sets.newHashSet(client.getTableList("tpch"));
-    assertEquals(Sets.newHashSet(EmbedPgSQLServer.TPCH_TABLES), retrieved);
+    assertEquals(Sets.newHashSet(PgSQLTestServer.TPCH_TABLES), retrieved);
   }
 
-  @Test(timeout = 5000)
+  @Test(timeout = 1000)
   public void testGetTable() throws UndefinedTableException {
-    for (String tableName: EmbedPgSQLServer.TPCH_TABLES) {
-      TableDesc retrieved = client.getTableDesc(EmbedPgSQLServer.DATABASE_NAME + "." + tableName);
-      assertEquals(EmbedPgSQLServer.DATABASE_NAME + "." + tableName, retrieved.getName());
+    for (String tableName: PgSQLTestServer.TPCH_TABLES) {
+      TableDesc retrieved = client.getTableDesc(PgSQLTestServer.DATABASE_NAME + "." + tableName);
+      assertEquals(PgSQLTestServer.DATABASE_NAME + "." + tableName, retrieved.getName());
       assertEquals(jdbcUrl + "&table=" + tableName, retrieved.getUri().toASCIIString());
     }
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLJdbcTableSpace.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLJdbcTableSpace.java b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLJdbcTableSpace.java
index f3b2d26..2ccf09a 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLJdbcTableSpace.java
+++ b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLJdbcTableSpace.java
@@ -20,10 +20,8 @@ package org.apache.tajo.storage.pgsql;
 
 import org.apache.tajo.catalog.MetadataProvider;
 import org.apache.tajo.catalog.TableDesc;
-import org.apache.tajo.exception.NotImplementedException;
 import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.exception.TajoRuntimeException;
-import org.apache.tajo.exception.UnsupportedException;
 import org.apache.tajo.storage.Tablespace;
 import org.apache.tajo.storage.TablespaceManager;
 import org.apache.tajo.storage.fragment.Fragment;
@@ -37,9 +35,9 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 public class TestPgSQLJdbcTableSpace {
-  static String jdbcUrl = EmbedPgSQLServer.getInstance().getJdbcUrlForAdmin();
+  static String jdbcUrl = PgSQLTestServer.getInstance().getJdbcUrlForAdmin();
 
-  @Test(timeout = 5000)
+  @Test(timeout = 1000)
   public void testTablespaceHandler() throws Exception {
     assertTrue((TablespaceManager.getByName("pgsql_cluster").get()) instanceof PgSQLTablespace);
     assertEquals("pgsql_cluster", (TablespaceManager.getByName("pgsql_cluster").get().getName()));
@@ -51,19 +49,19 @@ public class TestPgSQLJdbcTableSpace {
     assertTrue(TablespaceManager.get(jdbcUrl).get().getMetadataProvider() instanceof PgSQLMetadataProvider);
   }
 
-  @Test(timeout = 5000, expected = TajoRuntimeException.class)
+  @Test(timeout = 1000, expected = TajoRuntimeException.class)
   public void testCreateTable() throws IOException, TajoException {
     Tablespace space = TablespaceManager.getByName("pgsql_cluster").get();
     space.createTable(null, false);
   }
 
-  @Test(timeout = 5000, expected = TajoRuntimeException.class)
+  @Test(timeout = 1000, expected = TajoRuntimeException.class)
   public void testDropTable() throws IOException, TajoException {
     Tablespace space = TablespaceManager.getByName("pgsql_cluster").get();
     space.purgeTable(null);
   }
 
-  @Test(timeout = 5000)
+  @Test(timeout = 1000)
   public void testGetSplits() throws IOException, TajoException {
     Tablespace space = TablespaceManager.getByName("pgsql_cluster").get();
     MetadataProvider provider = space.getMetadataProvider();

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLMetadataProvider.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLMetadataProvider.java b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLMetadataProvider.java
index 7650f86..b7ebe1b 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLMetadataProvider.java
+++ b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLMetadataProvider.java
@@ -31,7 +31,7 @@ import java.util.Set;
 import static org.junit.Assert.*;
 
 public class TestPgSQLMetadataProvider {
-  static final String jdbcUrl = EmbedPgSQLServer.getInstance().getJdbcUrlForAdmin();
+  static final String jdbcUrl = PgSQLTestServer.getInstance().getJdbcUrlForAdmin();
 
   @BeforeClass
   public static void setUp() throws Exception {
@@ -64,7 +64,7 @@ public class TestPgSQLMetadataProvider {
     MetadataProvider provider = tablespace.getMetadataProvider();
 
     Set<String> found = Sets.newHashSet(provider.getTables(null, null));
-    assertEquals(Sets.newHashSet(EmbedPgSQLServer.TPCH_TABLES), found);
+    assertEquals(Sets.newHashSet(PgSQLTestServer.TPCH_TABLES), found);
   }
 
   @Test
@@ -72,7 +72,7 @@ public class TestPgSQLMetadataProvider {
     Tablespace tablespace = TablespaceManager.get(jdbcUrl).get();
     MetadataProvider provider = tablespace.getMetadataProvider();
 
-    for (String tableName : EmbedPgSQLServer.TPCH_TABLES) {
+    for (String tableName : PgSQLTestServer.TPCH_TABLES) {
       TableDesc table = provider.getTableDescriptor(null, tableName);
       assertEquals("tpch." + tableName, table.getName());
       assertEquals(jdbcUrl + "&table=" + tableName, table.getUri().toASCIIString());

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLQueryTests.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLQueryTests.java b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLQueryTests.java
index 7bfb80e..4d22450 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLQueryTests.java
+++ b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLQueryTests.java
@@ -23,10 +23,10 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class TestPgSQLQueryTests extends QueryTestCaseBase {
-  private static final String jdbcUrl = EmbedPgSQLServer.getInstance().getJdbcUrl();
+  private static final String jdbcUrl = PgSQLTestServer.getInstance().getJdbcUrl();
 
   public TestPgSQLQueryTests() {
-    super(EmbedPgSQLServer.DATABASE_NAME);
+    super(PgSQLTestServer.DATABASE_NAME);
   }
 
   @BeforeClass
@@ -39,4 +39,40 @@ public class TestPgSQLQueryTests extends QueryTestCaseBase {
   public void testSimpleFilter() throws Exception {
     runSimpleTests();
   }
+
+  @SimpleTest
+  @Test
+  public void testProjectedColumns() throws Exception {
+    runSimpleTests();
+  }
+
+  @SimpleTest
+  @Test
+  public void testFixedLengthFields() throws Exception {
+    runSimpleTests();
+  }
+
+  @SimpleTest
+  @Test
+  public void testVariableLengthFields() throws Exception {
+    runSimpleTests();
+  }
+
+  @SimpleTest
+  @Test
+  public void testDateTimeTypes() throws Exception {
+    runSimpleTests();
+  }
+
+  @SimpleTest
+  @Test
+  public void testTPCH_Q1() throws Exception {
+    runSimpleTests();
+  }
+
+  @SimpleTest
+  @Test
+  public void testTPCH_Q2_Part() throws Exception {
+    runSimpleTests();
+  }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLSimpleQueryTests.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLSimpleQueryTests.java b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLSimpleQueryTests.java
index 2968831..91aba63 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLSimpleQueryTests.java
+++ b/tajo-storage/tajo-storage-pgsql/src/test/java/org/apache/tajo/storage/pgsql/TestPgSQLSimpleQueryTests.java
@@ -23,10 +23,10 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class TestPgSQLSimpleQueryTests extends QueryTestCaseBase {
-  private static final String jdbcUrl = EmbedPgSQLServer.getInstance().getJdbcUrl();
+  private static final String jdbcUrl = PgSQLTestServer.getInstance().getJdbcUrl();
 
   public TestPgSQLSimpleQueryTests() {
-    super(EmbedPgSQLServer.DATABASE_NAME);
+    super(PgSQLTestServer.DATABASE_NAME);
   }
 
   @BeforeClass

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/customer.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/customer.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/customer.sql
new file mode 100644
index 0000000..35b1861
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/customer.sql
@@ -0,0 +1,10 @@
+CREATE TABLE CUSTOMER (
+  C_CUSTKEY     INTEGER NOT NULL,
+  C_NAME        VARCHAR(25) NOT NULL,
+  C_ADDRESS     VARCHAR(40) NOT NULL,
+  C_NATIONKEY   INTEGER NOT NULL,
+  C_PHONE       CHAR(15) NOT NULL,
+  C_ACCTBAL     DECIMAL(15,2)   NOT NULL,
+  C_MKTSEGMENT  CHAR(10) NOT NULL,
+  C_COMMENT     VARCHAR(117) NOT NULL
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.sql
new file mode 100644
index 0000000..9cbbc2f
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.sql
@@ -0,0 +1,5 @@
+CREATE TABLE DATETIME_TYPES (
+  date_field DATE,
+  time_field TIME,
+  ts_field TIMESTAMP
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.txt
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.txt b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.txt
new file mode 100644
index 0000000..6c7d8ff
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/datetime_types.txt
@@ -0,0 +1,4 @@
+1980-04-01|01:50:27|1980-04-01 01:50:27
+1984-01-05|02:45:31|1984-01-05 02:45:31
+1984-01-15|14:12:58|1984-01-15 14:12:58
+2015-03-21|08:11:01|2015-03-21 08:11:01
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/lineitem.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/lineitem.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/lineitem.sql
new file mode 100644
index 0000000..a7f61bb
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/lineitem.sql
@@ -0,0 +1,18 @@
+CREATE TABLE LINEITEM (
+  L_ORDERKEY    INTEGER NOT NULL,
+  L_PARTKEY     INTEGER NOT NULL,
+  L_SUPPKEY     INTEGER NOT NULL,
+  L_LINENUMBER  INTEGER NOT NULL,
+  L_QUANTITY    DECIMAL(15,2) NOT NULL,
+  L_EXTENDEDPRICE  DECIMAL(15,2) NOT NULL,
+  L_DISCOUNT    DECIMAL(15,2) NOT NULL,
+  L_TAX         DECIMAL(15,2) NOT NULL,
+  L_RETURNFLAG  CHAR(1) NOT NULL,
+  L_LINESTATUS  CHAR(1) NOT NULL,
+  L_SHIPDATE    DATE NOT NULL,
+  L_COMMITDATE  DATE NOT NULL,
+  L_RECEIPTDATE DATE NOT NULL,
+  L_SHIPINSTRUCT CHAR(25) NOT NULL,
+  L_SHIPMODE     CHAR(10) NOT NULL,
+  L_COMMENT      VARCHAR(44) NOT NULL
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/nation.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/nation.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/nation.sql
new file mode 100644
index 0000000..f7ecda8
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/nation.sql
@@ -0,0 +1,6 @@
+CREATE TABLE NATION  (
+  N_NATIONKEY  INTEGER NOT NULL,
+  N_NAME       CHAR(25) NOT NULL,
+  N_REGIONKEY  INTEGER NOT NULL,
+  N_COMMENT    VARCHAR(152)
+);

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/orders.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/orders.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/orders.sql
new file mode 100644
index 0000000..220d576
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/orders.sql
@@ -0,0 +1,11 @@
+CREATE TABLE ORDERS  (
+  O_ORDERKEY       INTEGER NOT NULL,
+  O_CUSTKEY        INTEGER NOT NULL,
+  O_ORDERSTATUS    CHAR(1) NOT NULL,
+  O_TOTALPRICE     DECIMAL(15,2) NOT NULL,
+  O_ORDERDATE      DATE NOT NULL,
+  O_ORDERPRIORITY  CHAR(15) NOT NULL,
+  O_CLERK          CHAR(15) NOT NULL,
+  O_SHIPPRIORITY   INTEGER NOT NULL,
+  O_COMMENT        VARCHAR(79) NOT NULL
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/part.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/part.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/part.sql
new file mode 100644
index 0000000..e66f73c
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/part.sql
@@ -0,0 +1,11 @@
+CREATE TABLE PART (
+  P_PARTKEY     INTEGER NOT NULL,
+  P_NAME        VARCHAR(55) NOT NULL,
+  P_MFGR        CHAR(25) NOT NULL,
+  P_BRAND       CHAR(10) NOT NULL,
+  P_TYPE        VARCHAR(25) NOT NULL,
+  P_SIZE        INTEGER NOT NULL,
+  P_CONTAINER   CHAR(10) NOT NULL,
+  P_RETAILPRICE DECIMAL(15,2) NOT NULL,
+  P_COMMENT     VARCHAR(23) NOT NULL
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/partsupp.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/partsupp.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/partsupp.sql
new file mode 100644
index 0000000..1f61331
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/partsupp.sql
@@ -0,0 +1,7 @@
+CREATE TABLE PARTSUPP (
+  PS_PARTKEY     INTEGER NOT NULL,
+  PS_SUPPKEY     INTEGER NOT NULL,
+  PS_AVAILQTY    INTEGER NOT NULL,
+  PS_SUPPLYCOST  DECIMAL(15,2)  NOT NULL,
+  PS_COMMENT     VARCHAR(199) NOT NULL
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/region.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/region.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/region.sql
new file mode 100644
index 0000000..c47e26e
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/region.sql
@@ -0,0 +1,5 @@
+CREATE TABLE REGION  (
+  R_REGIONKEY  INTEGER NOT NULL,
+  R_NAME       CHAR(25) NOT NULL,
+  R_COMMENT    VARCHAR(152)
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/supplier.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/supplier.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/supplier.sql
new file mode 100644
index 0000000..a4d35d3
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/pgsql/supplier.sql
@@ -0,0 +1,9 @@
+CREATE TABLE SUPPLIER (
+  S_SUPPKEY     INTEGER NOT NULL,
+  S_NAME        CHAR(25) NOT NULL,
+  S_ADDRESS     VARCHAR(40) NOT NULL,
+  S_NATIONKEY   INTEGER NOT NULL,
+  S_PHONE       CHAR(15) NOT NULL,
+  S_ACCTBAL     DECIMAL(15,2) NOT NULL,
+  S_COMMENT     VARCHAR(101) NOT NULL
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testDateTimeTypes.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testDateTimeTypes.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testDateTimeTypes.sql
new file mode 100644
index 0000000..37c5377
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testDateTimeTypes.sql
@@ -0,0 +1 @@
+SELECT * FROM DATETIME_TYPES WHERE date_field > DATE '1980-01-01';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testFixedLengthFields.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testFixedLengthFields.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testFixedLengthFields.sql
new file mode 100644
index 0000000..fff0905
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testFixedLengthFields.sql
@@ -0,0 +1 @@
+SELECT L_SHIPINSTRUCT, L_SHIPMODE FROM LINEITEM WHERE L_ORDERKEY > 1 AND L_LINENUMBER > 0;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testProjectedColumns.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testProjectedColumns.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testProjectedColumns.sql
new file mode 100644
index 0000000..1c7512b
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testProjectedColumns.sql
@@ -0,0 +1 @@
+SELECT L_ORDERKEY, L_SHIPDATE FROM LINEITEM WHERE L_ORDERKEY > 1 AND L_LINENUMBER > 0;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q1.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q1.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q1.sql
new file mode 100644
index 0000000..9e02d80
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q1.sql
@@ -0,0 +1,21 @@
+select
+	l_returnflag,
+	l_linestatus,
+	sum(l_quantity) as sum_qty,
+	sum(l_extendedprice) as sum_base_price,
+	sum(l_extendedprice*(1-l_discount)) as sum_disc_price,
+	sum(l_extendedprice*(1-l_discount)*(1+l_tax)) as sum_charge,
+	avg(l_quantity) as avg_qty,
+	avg(l_extendedprice) as avg_price,
+	avg(l_discount) as avg_disc,
+	count(*) as count_order
+from
+	lineitem
+where
+	l_shipdate <= DATE '1998-09-01'
+group by
+	l_returnflag,
+	l_linestatus
+order by
+	l_returnflag,
+	l_linestatus;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q2_Part.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q2_Part.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q2_Part.sql
new file mode 100644
index 0000000..ffaaf87
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testTPCH_Q2_Part.sql
@@ -0,0 +1,18 @@
+select
+  s_acctbal,
+  s_name,
+  n_name,
+  p_partkey,
+  p_mfgr,
+  s_address,
+  s_phone,
+  s_comment,
+  ps_supplycost,
+  r_name,
+  p_type,
+  p_size
+from
+  region join nation on n_regionkey = r_regionkey and r_name = 'AMERICA'
+  join supplier on s_nationkey = n_nationkey
+  join partsupp on s_suppkey = ps_suppkey
+  join part on p_partkey = ps_partkey and p_type like '%BRASS' and p_size = 15;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testVariableLengthFields.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testVariableLengthFields.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testVariableLengthFields.sql
new file mode 100644
index 0000000..d72da1c
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/queries/TestPgSQLQueryTests/testVariableLengthFields.sql
@@ -0,0 +1 @@
+SELECT L_COMMENT FROM LINEITEM WHERE L_ORDERKEY > 1 AND L_LINENUMBER > 0;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testDateTimeTypes.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testDateTimeTypes.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testDateTimeTypes.result
new file mode 100644
index 0000000..cd68a38
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testDateTimeTypes.result
@@ -0,0 +1,6 @@
+date_field,time_field,ts_field
+-------------------------------
+1980-04-01,01:50:27,1980-04-01 01:50:27
+1984-01-05,02:45:31,1984-01-05 02:45:31
+1984-01-15,14:12:58,1984-01-15 14:12:58
+2015-03-21,08:11:01,2015-03-21 08:11:01

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testFixedLengthFields.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testFixedLengthFields.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testFixedLengthFields.result
new file mode 100644
index 0000000..ae8384d
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testFixedLengthFields.result
@@ -0,0 +1,5 @@
+l_shipinstruct,l_shipmode
+-------------------------------
+TAKE BACK RETURN,RAIL
+NONE,AIR
+TAKE BACK RETURN,RAIL

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testProjectedColumns.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testProjectedColumns.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testProjectedColumns.result
new file mode 100644
index 0000000..bb3f58d
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testProjectedColumns.result
@@ -0,0 +1,5 @@
+l_orderkey,l_shipdate
+-------------------------------
+2,1997-01-28
+3,1994-02-02
+3,1993-11-09

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testSimpleFilter.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testSimpleFilter.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testSimpleFilter.result
index a484704..2eb253e 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testSimpleFilter.result
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testSimpleFilter.result
@@ -1,5 +1,5 @@
 l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discount,l_tax,l_returnflag,l_linestatus,l_shipdate,l_commitdate,l_receiptdate,l_shipinstruct,l_shipmode,l_comment
 -------------------------------
-2,2,1191,1,38.0,44694.46,0.0,0.05,N,O,0096-12-02,0096-12-02,0096-12-31,TAKE BACK RETURN         ,RAIL      ,ven requests. deposits breach a
-3,2,1798,1,45.0,54058.05,0.06,0.0,R,F,0094-01-03,0093-12-02,0094-01-03,NONE                     ,AIR       ,ongside of the furiously brave acco
-3,3,6540,2,49.0,46796.47,0.1,0.0,R,F,0093-10-02,0093-11-01,0093-10-03,TAKE BACK RETURN         ,RAIL      , unusual accounts. eve
+2,2,1191,1,38.0,44694.46,0.0,0.05,N,O,1997-01-28,1997-01-14,1997-02-02,TAKE BACK RETURN,RAIL,ven requests. deposits breach a
+3,2,1798,1,45.0,54058.05,0.06,0.0,R,F,1994-02-02,1994-01-04,1994-02-23,NONE,AIR,ongside of the furiously brave acco
+3,3,6540,2,49.0,46796.47,0.1,0.0,R,F,1993-11-09,1993-12-20,1993-11-24,TAKE BACK RETURN,RAIL,unusual accounts. eve

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q1.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q1.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q1.result
new file mode 100644
index 0000000..de3e82e
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q1.result
@@ -0,0 +1,4 @@
+l_returnflag,l_linestatus,sum_qty,sum_base_price,sum_disc_price,sum_charge,avg_qty,avg_price,avg_disc,count_order
+-------------------------------
+N,O,91.0,111845.85,106860.6364,112012.469952,30.333333333333332,37281.95,0.04333333333333333,3
+R,F,94.0,100854.52,92931.39,92931.39,47.0,50427.26,0.08,2

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q2_Part.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q2_Part.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q2_Part.result
new file mode 100644
index 0000000..64d8e12
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testTPCH_Q2_Part.result
@@ -0,0 +1,3 @@
+s_acctbal,s_name,n_name,p_partkey,p_mfgr,s_address,s_phone,s_comment,ps_supplycost,r_name,p_type,p_size
+-------------------------------
+4192.4,Supplier#000000003,ARGENTINA,2,Manufacturer#1,q1,G3Pj6OjIuUYfUoH18BFTKP5aU9bEV3,11-383-516-1199,blithely silent requests after the express dependencies are sl,1.01,AMERICA,LARGE BRUSHED BRASS,15

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testVariableLengthFields.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testVariableLengthFields.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testVariableLengthFields.result
new file mode 100644
index 0000000..531402c
--- /dev/null
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLQueryTests/testVariableLengthFields.result
@@ -0,0 +1,5 @@
+l_comment
+-------------------------------
+ven requests. deposits breach a
+ongside of the furiously brave acco
+unusual accounts. eve

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectAll.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectAll.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectAll.result
index 6649940..dd34c54 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectAll.result
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectAll.result
@@ -1,7 +1,7 @@
 l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discount,l_tax,l_returnflag,l_linestatus,l_shipdate,l_commitdate,l_receiptdate,l_shipinstruct,l_shipmode,l_comment
 -------------------------------
-1,1,7706,1,17.0,21168.23,0.04,0.02,N,O,0096-02-03,0096-01-01,0096-02-05,DELIVER IN PERSON        ,TRUCK     ,egular courts above the
-1,1,7311,2,36.0,45983.16,0.09,0.06,N,O,0096-03-05,0096-01-03,0096-03-06,TAKE BACK RETURN         ,MAIL      ,ly final dependencies: slyly bold 
-2,2,1191,1,38.0,44694.46,0.0,0.05,N,O,0096-12-02,0096-12-02,0096-12-31,TAKE BACK RETURN         ,RAIL      ,ven requests. deposits breach a
-3,2,1798,1,45.0,54058.05,0.06,0.0,R,F,0094-01-03,0093-12-02,0094-01-03,NONE                     ,AIR       ,ongside of the furiously brave acco
-3,3,6540,2,49.0,46796.47,0.1,0.0,R,F,0093-10-02,0093-11-01,0093-10-03,TAKE BACK RETURN         ,RAIL      , unusual accounts. eve
+1,1,7706,1,17.0,21168.23,0.04,0.02,N,O,1996-03-13,1996-02-12,1996-03-22,DELIVER IN PERSON,TRUCK,egular courts above the
+1,1,7311,2,36.0,45983.16,0.09,0.06,N,O,1996-04-12,1996-02-28,1996-04-20,TAKE BACK RETURN,MAIL,ly final dependencies: slyly bold
+2,2,1191,1,38.0,44694.46,0.0,0.05,N,O,1997-01-28,1997-01-14,1997-02-02,TAKE BACK RETURN,RAIL,ven requests. deposits breach a
+3,2,1798,1,45.0,54058.05,0.06,0.0,R,F,1994-02-02,1994-01-04,1994-02-23,NONE,AIR,ongside of the furiously brave acco
+3,3,6540,2,49.0,46796.47,0.1,0.0,R,F,1993-11-09,1993-12-20,1993-11-24,TAKE BACK RETURN,RAIL,unusual accounts. eve

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectLimit.result
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectLimit.result b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectLimit.result
index 88116c8..a7f7d20 100644
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectLimit.result
+++ b/tajo-storage/tajo-storage-pgsql/src/test/resources/results/TestPgSQLSimpleQueryTests/testSelectLimit.result
@@ -1,5 +1,5 @@
 l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discount,l_tax,l_returnflag,l_linestatus,l_shipdate,l_commitdate,l_receiptdate,l_shipinstruct,l_shipmode,l_comment
 -------------------------------
-1,1,7706,1,17.0,21168.23,0.04,0.02,N,O,0096-02-03,0096-01-01,0096-02-05,DELIVER IN PERSON        ,TRUCK     ,egular courts above the
-1,1,7311,2,36.0,45983.16,0.09,0.06,N,O,0096-03-05,0096-01-03,0096-03-06,TAKE BACK RETURN         ,MAIL      ,ly final dependencies: slyly bold 
-2,2,1191,1,38.0,44694.46,0.0,0.05,N,O,0096-12-02,0096-12-02,0096-12-31,TAKE BACK RETURN         ,RAIL      ,ven requests. deposits breach a
+1,1,7706,1,17.0,21168.23,0.04,0.02,N,O,1996-03-13,1996-02-12,1996-03-22,DELIVER IN PERSON,TRUCK,egular courts above the
+1,1,7311,2,36.0,45983.16,0.09,0.06,N,O,1996-04-12,1996-02-28,1996-04-20,TAKE BACK RETURN,MAIL,ly final dependencies: slyly bold
+2,2,1191,1,38.0,44694.46,0.0,0.05,N,O,1997-01-28,1997-01-14,1997-02-02,TAKE BACK RETURN,RAIL,ven requests. deposits breach a

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/customer.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/customer.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/customer.sql
deleted file mode 100644
index 35b1861..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/customer.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-CREATE TABLE CUSTOMER (
-  C_CUSTKEY     INTEGER NOT NULL,
-  C_NAME        VARCHAR(25) NOT NULL,
-  C_ADDRESS     VARCHAR(40) NOT NULL,
-  C_NATIONKEY   INTEGER NOT NULL,
-  C_PHONE       CHAR(15) NOT NULL,
-  C_ACCTBAL     DECIMAL(15,2)   NOT NULL,
-  C_MKTSEGMENT  CHAR(10) NOT NULL,
-  C_COMMENT     VARCHAR(117) NOT NULL
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/lineitem.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/lineitem.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/lineitem.sql
deleted file mode 100644
index a7f61bb..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/lineitem.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-CREATE TABLE LINEITEM (
-  L_ORDERKEY    INTEGER NOT NULL,
-  L_PARTKEY     INTEGER NOT NULL,
-  L_SUPPKEY     INTEGER NOT NULL,
-  L_LINENUMBER  INTEGER NOT NULL,
-  L_QUANTITY    DECIMAL(15,2) NOT NULL,
-  L_EXTENDEDPRICE  DECIMAL(15,2) NOT NULL,
-  L_DISCOUNT    DECIMAL(15,2) NOT NULL,
-  L_TAX         DECIMAL(15,2) NOT NULL,
-  L_RETURNFLAG  CHAR(1) NOT NULL,
-  L_LINESTATUS  CHAR(1) NOT NULL,
-  L_SHIPDATE    DATE NOT NULL,
-  L_COMMITDATE  DATE NOT NULL,
-  L_RECEIPTDATE DATE NOT NULL,
-  L_SHIPINSTRUCT CHAR(25) NOT NULL,
-  L_SHIPMODE     CHAR(10) NOT NULL,
-  L_COMMENT      VARCHAR(44) NOT NULL
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/nation.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/nation.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/nation.sql
deleted file mode 100644
index f7ecda8..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/nation.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-CREATE TABLE NATION  (
-  N_NATIONKEY  INTEGER NOT NULL,
-  N_NAME       CHAR(25) NOT NULL,
-  N_REGIONKEY  INTEGER NOT NULL,
-  N_COMMENT    VARCHAR(152)
-);

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/orders.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/orders.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/orders.sql
deleted file mode 100644
index 220d576..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/orders.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-CREATE TABLE ORDERS  (
-  O_ORDERKEY       INTEGER NOT NULL,
-  O_CUSTKEY        INTEGER NOT NULL,
-  O_ORDERSTATUS    CHAR(1) NOT NULL,
-  O_TOTALPRICE     DECIMAL(15,2) NOT NULL,
-  O_ORDERDATE      DATE NOT NULL,
-  O_ORDERPRIORITY  CHAR(15) NOT NULL,
-  O_CLERK          CHAR(15) NOT NULL,
-  O_SHIPPRIORITY   INTEGER NOT NULL,
-  O_COMMENT        VARCHAR(79) NOT NULL
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/part.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/part.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/part.sql
deleted file mode 100644
index e66f73c..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/part.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-CREATE TABLE PART (
-  P_PARTKEY     INTEGER NOT NULL,
-  P_NAME        VARCHAR(55) NOT NULL,
-  P_MFGR        CHAR(25) NOT NULL,
-  P_BRAND       CHAR(10) NOT NULL,
-  P_TYPE        VARCHAR(25) NOT NULL,
-  P_SIZE        INTEGER NOT NULL,
-  P_CONTAINER   CHAR(10) NOT NULL,
-  P_RETAILPRICE DECIMAL(15,2) NOT NULL,
-  P_COMMENT     VARCHAR(23) NOT NULL
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/partsupp.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/partsupp.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/partsupp.sql
deleted file mode 100644
index 1f61331..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/partsupp.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-CREATE TABLE PARTSUPP (
-  PS_PARTKEY     INTEGER NOT NULL,
-  PS_SUPPKEY     INTEGER NOT NULL,
-  PS_AVAILQTY    INTEGER NOT NULL,
-  PS_SUPPLYCOST  DECIMAL(15,2)  NOT NULL,
-  PS_COMMENT     VARCHAR(199) NOT NULL
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/region.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/region.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/region.sql
deleted file mode 100644
index c47e26e..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/region.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-CREATE TABLE REGION  (
-  R_REGIONKEY  INTEGER NOT NULL,
-  R_NAME       CHAR(25) NOT NULL,
-  R_COMMENT    VARCHAR(152)
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/a6380ccc/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/supplier.sql
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/supplier.sql b/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/supplier.sql
deleted file mode 100644
index a4d35d3..0000000
--- a/tajo-storage/tajo-storage-pgsql/src/test/resources/tpch/pgsql/supplier.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-CREATE TABLE SUPPLIER (
-  S_SUPPKEY     INTEGER NOT NULL,
-  S_NAME        CHAR(25) NOT NULL,
-  S_ADDRESS     VARCHAR(40) NOT NULL,
-  S_NATIONKEY   INTEGER NOT NULL,
-  S_PHONE       CHAR(15) NOT NULL,
-  S_ACCTBAL     DECIMAL(15,2) NOT NULL,
-  S_COMMENT     VARCHAR(101) NOT NULL
-);
\ No newline at end of file


Mime
View raw message