You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by bl...@apache.org on 2014/10/06 04:52:17 UTC

[01/19] git commit: TAJO-995: HiveMetaStoreClient wrapper should retry the connection

Repository: tajo
Updated Branches:
  refs/heads/master ecc2b05af -> ca187bcf6


TAJO-995: HiveMetaStoreClient wrapper should retry the connection


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

Branch: refs/heads/master
Commit: 7c98709f0fcb06dfb675acae3d6489a6126f55b5
Parents: 242d6ad
Author: jinossy <ji...@gmail.com>
Authored: Wed Aug 6 17:43:35 2014 +0900
Committer: jinossy <ji...@gmail.com>
Committed: Wed Aug 6 17:43:35 2014 +0900

----------------------------------------------------------------------
 .../tajo/catalog/store/HCatalogStore.java       | 11 ++++++-----
 .../catalog/store/HCatalogStoreClientPool.java  | 20 ++++++++++++++++----
 .../apache/tajo/catalog/store/HCatalogUtil.java |  6 ++++++
 3 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/7c98709f/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
index 6f48348..d27f19c 100644
--- a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
+++ b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
@@ -48,6 +48,7 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.exception.InternalException;
 import org.apache.tajo.storage.StorageConstants;
 import org.apache.tajo.util.KeyValueSet;
+import org.apache.thrift.TException;
 
 import java.io.IOException;
 import java.util.*;
@@ -77,13 +78,13 @@ public class HCatalogStore extends CatalogConstants implements CatalogStore {
   @Override
   public boolean existTable(final String databaseName, final String tableName) throws CatalogException {
     boolean exist = false;
-    org.apache.hadoop.hive.ql.metadata.Table table = null;
+    org.apache.hadoop.hive.ql.metadata.Table table;
     HCatalogStoreClientPool.HCatalogStoreClient client = null;
 
     // get table
     try {
       client = clientPool.getClient();
-      table = HCatUtil.getTable(client.getHiveClient(), databaseName, tableName);
+      table = HCatalogUtil.getTable(client.getHiveClient(), databaseName, tableName);
       if (table != null) {
         exist = true;
       }
@@ -118,7 +119,7 @@ public class HCatalogStore extends CatalogConstants implements CatalogStore {
       // get hive table schema
       try {
         client = clientPool.getClient();
-        table = HCatUtil.getTable(client.getHiveClient(), databaseName, tableName);
+        table = HCatalogUtil.getTable(client.getHiveClient(), databaseName, tableName);
         path = table.getPath();
       } catch (NoSuchObjectException nsoe) {
         throw new CatalogException("Table not found. - tableName:" + tableName, nsoe);
@@ -291,7 +292,7 @@ public class HCatalogStore extends CatalogConstants implements CatalogStore {
     try {
       client = clientPool.getClient();
       return client.getHiveClient().getAllTables(databaseName);
-    } catch (MetaException e) {
+    } catch (TException e) {
       throw new CatalogException(e);
     } finally {
       if(client != null) client.release();
@@ -401,7 +402,7 @@ public class HCatalogStore extends CatalogConstants implements CatalogStore {
     try {
       client = clientPool.getClient();
       return client.getHiveClient().getAllDatabases();
-    } catch (MetaException e) {
+    } catch (TException e) {
       throw new CatalogException(e);
     } finally {
       if (client != null) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/7c98709f/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStoreClientPool.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStoreClientPool.java b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStoreClientPool.java
index 2fff67c..8ccb100 100644
--- a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStoreClientPool.java
+++ b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStoreClientPool.java
@@ -16,7 +16,9 @@ package org.apache.tajo.catalog.store;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
+import org.apache.hadoop.hive.metastore.*;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.api.Table;
 import org.apache.log4j.Logger;
 
 import java.util.Iterator;
@@ -41,12 +43,22 @@ public class HCatalogStoreClientPool {
    * connection pool.
    */
   public class HCatalogStoreClient {
-    private final HiveMetaStoreClient hiveClient;
+    private final IMetaStoreClient hiveClient;
     public AtomicBoolean isInUse = new AtomicBoolean(false);
 
     private HCatalogStoreClient(HiveConf hiveConf) {
       try {
-        this.hiveClient = new HiveMetaStoreClient(hiveConf);
+        HiveMetaHookLoader hookLoader = new HiveMetaHookLoader() {
+          @Override
+          public HiveMetaHook getHook(Table table) throws MetaException {
+            /* metadata hook implementation, or null if this
+             * storage handler does not need any metadata notifications
+             */
+            return null;
+          }
+        };
+
+        this.hiveClient = RetryingMetaStoreClient.getProxy(hiveConf, hookLoader, HiveMetaStoreClient.class.getName());
         clientPool.add(this);
         LOG.info("MetaStoreClient created (size = " + clientPool.size() + ")");
       } catch (Exception e) {
@@ -58,7 +70,7 @@ public class HCatalogStoreClientPool {
     /**
      * Returns the internal HiveMetaStoreClient object.
      */
-    public HiveMetaStoreClient getHiveClient() {
+    public IMetaStoreClient getHiveClient() {
       return hiveClient;
     }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/7c98709f/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogUtil.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogUtil.java b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogUtil.java
index 9e60768..54fdb9d 100644
--- a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogUtil.java
+++ b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogUtil.java
@@ -20,9 +20,11 @@ package org.apache.tajo.catalog.store;
 import com.google.common.base.Preconditions;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hive.metastore.IMetaStoreClient;
 import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat;
 import org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat;
 import org.apache.hadoop.hive.ql.io.RCFileOutputFormat;
+import org.apache.hadoop.hive.ql.metadata.Table;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hcatalog.common.HCatException;
 import org.apache.hcatalog.data.schema.HCatFieldSchema;
@@ -30,6 +32,7 @@ import org.apache.hcatalog.data.schema.HCatSchema;
 import org.apache.tajo.catalog.exception.CatalogException;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.common.TajoDataTypes;
+import org.apache.thrift.TException;
 import parquet.hadoop.mapred.DeprecatedParquetOutputFormat;
 
 public class HCatalogUtil {
@@ -137,4 +140,7 @@ public class HCatalogUtil {
     }
   }
 
+  public static Table getTable(IMetaStoreClient client, String dbName, String tableName) throws TException {
+    return new Table(client.getTable(dbName, tableName));
+  }
 }


[11/19] git commit: Update tsql documentation.

Posted by bl...@apache.org.
Update tsql documentation.


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

Branch: refs/heads/master
Commit: e59fe460cc888bfebe968619405edd9b9e57e410
Parents: 0e63abc
Author: Jaehwa Jung <bl...@apache.org>
Authored: Sat Sep 27 16:50:08 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Sat Sep 27 16:50:08 2014 +0900

----------------------------------------------------------------------
 tajo-docs/src/main/sphinx/cli.rst               |  2 +-
 .../src/main/sphinx/tsql/admin_command.rst      | 10 ++++----
 tajo-docs/src/main/sphinx/tsql/back_command.rst |  2 +-
 tajo-docs/src/main/sphinx/tsql/dfs_command.rst  |  2 +-
 tajo-docs/src/main/sphinx/tsql/execute_file.rst |  2 +-
 tajo-docs/src/main/sphinx/tsql/intro.rst        |  2 +-
 tajo-docs/src/main/sphinx/tsql/meta_command.rst | 27 +++++++++++++-------
 7 files changed, 28 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/e59fe460/tajo-docs/src/main/sphinx/cli.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/cli.rst b/tajo-docs/src/main/sphinx/cli.rst
index 6684508..5fd2461 100644
--- a/tajo-docs/src/main/sphinx/cli.rst
+++ b/tajo-docs/src/main/sphinx/cli.rst
@@ -2,7 +2,7 @@
 Command-line Interface
 *****************************
 
-Tajo provides a shell utility for users. It is the command-line interface (CLI). Using the CLI, users can create or drop tables, inspect schema and query tables, etc. For reference, we named its name to tsql.
+Tajo provides a shell utility named Tsql. It is a command-line interface (CLI) where users can create or drop tables, inspect schema and query tables, etc.
 
 .. toctree::
   :maxdepth: 1

http://git-wip-us.apache.org/repos/asf/tajo/blob/e59fe460/tajo-docs/src/main/sphinx/tsql/admin_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/admin_command.rst b/tajo-docs/src/main/sphinx/tsql/admin_command.rst
index cffa9e6..1a3e90e 100644
--- a/tajo-docs/src/main/sphinx/tsql/admin_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/admin_command.rst
@@ -7,7 +7,7 @@ Administration Commands
 Synopsis
 ==========
 
-Tsql provides commands for administrator as follows as follows:
+Tsql provides commands for administrator as follows:
 
 .. code-block:: sql
 
@@ -26,7 +26,7 @@ Tsql provides commands for administrator as follows as follows:
 Basic usages
 -----------------------------------------------
 
-``-list`` options shows a list of all running queries as follows: ::
+``-list`` option shows a list of all running queries as follows: ::
 
   default> \admin -list
   QueryId              State               StartTime           Query
@@ -34,7 +34,7 @@ Basic usages
   q_1411357607375_0006 QUERY_RUNNING       2014-09-23 07:19:40 select count(*) from lineitem
 
 
-``-desc`` options shows a detailed description of a specified running query s as follows: ::
+``-desc`` option shows a detailed description of a specified running query as follows: ::
 
   default> \admin -desc q_1411357607375_0006
   Id: 1
@@ -47,14 +47,14 @@ Basic usages
   select count(*) from lineitem
 
 
-``-kill`` options kills a specified running queries as follows: ::
+``-kill`` option kills a specified running query as follows: ::
 
   default> \admin -kill q_1411357607375_0007
   q_1411357607375_0007 is killed successfully.
 
 
 
-``-showmasters`` options shows a list of all tajo masters as follows: ::
+``-showmasters`` option shows a list of all tajo masters as follows: ::
 
   default> \admin -showmasters
   grtajo01
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/e59fe460/tajo-docs/src/main/sphinx/tsql/back_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/back_command.rst b/tajo-docs/src/main/sphinx/tsql/back_command.rst
index 56bdd71..ad46f26 100644
--- a/tajo-docs/src/main/sphinx/tsql/back_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/back_command.rst
@@ -3,7 +3,7 @@ Executing as background process
 *********************************
 
 
-If you execute tsql as background process, tsql will exit before execute a query because of jconsole architecture as
+If you execute tsql as a background process, tsql will exit before executing a query because of jconsole architecture as
 follows:
 
  .. code-block:: sql

http://git-wip-us.apache.org/repos/asf/tajo/blob/e59fe460/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/dfs_command.rst b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
index b6cb463..e261159 100644
--- a/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
@@ -2,7 +2,7 @@
 Executing HDFS commands
 *********************************
 
-You can run the hadoop dfs commands(FsShell) within tsql. ``\dfs`` command allows the hadoop dfs commands. If you want to use this command, you just specify FsShell arguments and add the semicolon at the end as follows:
+You can run the hadoop dfs command(FsShell) within tsql. ``\dfs`` command provides a shortcut to the hadoop dfs commands. If you want to use this command, just specify FsShell arguments and add the semicolon at the end as follows:
 
 .. code-block:: sql
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/e59fe460/tajo-docs/src/main/sphinx/tsql/execute_file.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/execute_file.rst b/tajo-docs/src/main/sphinx/tsql/execute_file.rst
index 014f513..a513973 100644
--- a/tajo-docs/src/main/sphinx/tsql/execute_file.rst
+++ b/tajo-docs/src/main/sphinx/tsql/execute_file.rst
@@ -39,7 +39,7 @@ Tajo can execute more queries that were saved to a file using the -f file argume
 Setting parameter value in SQL file
 -----------------------------------------------
 
-If you wish to set a parameter value in the SQL file, you can set with the -param key=value option.When you use this feature, you have to use the parameter in the file as follows:
+If you wish to set a parameter value in the SQL file, you can set with the -param key=value option. When you use this feature, you have to use the parameter in the file as follows:
 
 .. code-block:: sql
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/e59fe460/tajo-docs/src/main/sphinx/tsql/intro.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/intro.rst b/tajo-docs/src/main/sphinx/tsql/intro.rst
index badaead..4ca6d87 100644
--- a/tajo-docs/src/main/sphinx/tsql/intro.rst
+++ b/tajo-docs/src/main/sphinx/tsql/intro.rst
@@ -17,7 +17,7 @@ Options
 * ``-c "quoted sql"`` : Execute quoted sql statements, and then the shell will exist.
 * ``-f filename (--file filename)`` : Use the file named filename as the source of commands instead of interactive shell.
 * ``-h hostname (--host hostname)`` : Specifies the host name of the machine on which the Tajo master is running.
-* ``-p port (--port port)`` : Specifies the TCP port. If it is not set, the port will be 26002 in default.
+* ``-p port (--port port)`` : Specifies the TCP port. If it is not set, the port will be 26002 by default.
 * ``-conf configuration (--conf configuration)`` : Setting tajo configuration value.
 * ``-param parameter (--param parameter)`` : Use a parameter value in SQL file.
 * ``-B (--background)`` : Execute as background process.

http://git-wip-us.apache.org/repos/asf/tajo/blob/e59fe460/tajo-docs/src/main/sphinx/tsql/meta_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/meta_command.rst b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
index b183cf5..a147f2c 100644
--- a/tajo-docs/src/main/sphinx/tsql/meta_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
@@ -105,7 +105,7 @@ The prompt ``default>`` indicates the current database. Basically, all SQL state
   work1>
 
 
-``\df`` command shows a list of all buit-in function as follows: ::
+``\df`` command shows a list of all built-in functions as follows: ::
 
   default> \df
    Name            | Result type     | Argument types        | Description                                   | Type
@@ -297,17 +297,26 @@ The prompt ``default>`` indicates the current database. Basically, all SQL state
 
 ``\df [function name]`` command also shows a function description as follows: ::
 
-  default> \df trim
+  default> \df round;
    Name            | Result type     | Argument types        | Description                                   | Type
   -----------------+-----------------+-----------------------+-----------------------------------------------+-----------
-   trim            | TEXT            | TEXT                  |  Remove the longest string consisting only of | GENERAL
-   trim            | TEXT            | TEXT,TEXT             |  Remove the longest string consisting only of | GENERAL
+   round           | INT8            | FLOAT4                | Round to nearest integer.                     | GENERAL
+   round           | INT8            | FLOAT8                | Round to nearest integer.                     | GENERAL
+   round           | INT8            | INT4                  | Round to nearest integer.                     | GENERAL
+   round           | INT8            | INT8                  | Round to nearest integer.                     | GENERAL
+   round           | FLOAT8          | FLOAT8,INT4           | Round to s decimalN places.                   | GENERAL
+   round           | FLOAT8          | INT8,INT4             | Round to s decimalN places.                   | GENERAL
 
-  (2) rows
+  (6) rows
 
-  Function:    TEXT trim(text)
-  Description:  Remove the longest string consisting only of  characters in characters (a space by default) from the start and end of string.
+  Function:    INT8 round(float4)
+  Description: Round to nearest integer.
   Example:
-  > SELECT trim('xyxtrimyyx', 'xy');
-  trim
+  > SELECT round(42.4)
+  42
 
+  Function:    FLOAT8 round(float8,int4)
+  Description: Round to s decimalN places.
+  Example:
+  > SELECT round(42.4382, 2)
+  42.44
\ No newline at end of file


[12/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1062

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1062


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

Branch: refs/heads/master
Commit: a5402249a2f7df85aa01280ed359f1d1d3489281
Parents: e59fe46 52e5543
Author: Jaehwa Jung <bl...@apache.org>
Authored: Sat Sep 27 16:52:05 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Sat Sep 27 16:52:05 2014 +0900

----------------------------------------------------------------------
 BUILDING                                        |   8 +-
 CHANGES                                         |  13 ++
 README                                          |   2 +-
 .../engine/planner/UniformRangePartition.java   |   3 +-
 .../planner/physical/BSTIndexScanExec.java      |   4 +-
 .../planner/physical/ExternalSortExec.java      |  92 +++++++---
 .../tajo/worker/ExecutionBlockContext.java      |   4 +-
 .../java/org/apache/tajo/worker/Fetcher.java    |  37 ++--
 .../main/java/org/apache/tajo/worker/Task.java  | 182 ++++++++++++++++++-
 .../java/org/apache/tajo/worker/TaskRunner.java |  26 ++-
 .../org/apache/tajo/worker/TestFetcher.java     |  25 ++-
 .../main/sphinx/getting_started/building.rst    |  10 +-
 tajo-project/pom.xml                            |   2 +-
 .../apache/tajo/rpc/RemoteCallException.java    |   3 +
 .../java/org/apache/tajo/storage/RawFile.java   |  71 +++++---
 .../tajo/pullserver/PullServerAuxService.java   |   6 +-
 .../tajo/pullserver/TajoPullServerService.java  |   8 +-
 .../tajo/pullserver/retriever/FileChunk.java    |  38 +++-
 18 files changed, 431 insertions(+), 103 deletions(-)
----------------------------------------------------------------------



[13/19] git commit: Update some typos

Posted by bl...@apache.org.
Update some typos


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

Branch: refs/heads/master
Commit: 706be644389f1223f5ea19d1418c6b6aa8b9bc96
Parents: a540224
Author: Jaehwa Jung <bl...@apache.org>
Authored: Wed Oct 1 12:31:51 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Wed Oct 1 12:31:51 2014 +0900

----------------------------------------------------------------------
 tajo-docs/src/main/sphinx/tsql/meta_command.rst   | 2 +-
 tajo-docs/src/main/sphinx/tsql/single_command.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/706be644/tajo-docs/src/main/sphinx/tsql/meta_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/meta_command.rst b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
index a147f2c..648041c 100644
--- a/tajo-docs/src/main/sphinx/tsql/meta_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
@@ -3,7 +3,7 @@ Meta Commands
 *********************************
 
 
-In tsql, anything command that begins with an unquoted backslash ('\') is a tsql meta-command that is processed by tsql itself.
+In tsql, any command that begins with an unquoted backslash ('\') is a tsql meta-command that is processed by tsql itself.
 
 In the current implementation, there are meta commands as follows: ::
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/706be644/tajo-docs/src/main/sphinx/tsql/single_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/single_command.rst b/tajo-docs/src/main/sphinx/tsql/single_command.rst
index 93b00c5..ae0a6ae 100644
--- a/tajo-docs/src/main/sphinx/tsql/single_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/single_command.rst
@@ -4,7 +4,7 @@ Executing a single command
 
 
 You may want to run more queries without entering tsql prompt. Tsql provides the -c argument for above
-requirement. And tajo assumes that queries separated by semicolon as follows:
+requirement. And tajo assumes that queries are separated by semicolon as follows:
 
 .. code-block:: sql
 


[08/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: 42a6c4ebeebe36aad6f7dc5f92c83baee398c85e
Parents: 05c8924 4efb45b
Author: Jaehwa Jung <bl...@apache.org>
Authored: Thu Sep 11 12:25:05 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Thu Sep 11 12:25:05 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |   2 +
 tajo-catalog/tajo-catalog-drivers/pom.xml       |  18 +
 .../tajo-catalog-drivers/tajo-hcatalog/pom.xml  | 345 +++++++++++++++++++
 tajo-dist/src/main/bin/tajo                     |   2 +-
 .../configuration/catalog_configuration.rst     |   2 +-
 5 files changed, 367 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[18/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1062

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1062


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

Branch: refs/heads/master
Commit: 03847cf497779d18d323bf94a9e2f0d79dadcb96
Parents: 28b4cbc ecc2b05
Author: Jaehwa Jung <bl...@apache.org>
Authored: Sun Oct 5 22:16:12 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Sun Oct 5 22:16:12 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |  26 ++
 .../apache/tajo/catalog/CatalogConstants.java   |   2 +
 .../tajo/cli/DefaultTajoCliOutputFormatter.java |  34 +-
 .../org/apache/tajo/cli/DescTableCommand.java   |   6 +-
 .../java/org/apache/tajo/cli/HelpCommand.java   |  30 +-
 .../main/java/org/apache/tajo/cli/TajoCli.java  | 109 +++--
 .../java/org/apache/tajo/client/TajoAdmin.java  |  40 +-
 .../java/org/apache/tajo/client/TajoClient.java |   4 +-
 .../apache/tajo/jdbc/TajoResultSetMetaData.java |   8 +-
 .../apache/tajo/common/type/TajoTypeUtil.java   | 183 +++++++++
 .../apache/tajo/engine/planner/PlannerUtil.java |   3 +-
 .../engine/planner/PreLogicalPlanVerifier.java  |  14 +
 .../org/apache/tajo/master/GlobalEngine.java    |  27 ++
 .../apache/tajo/master/querymaster/Query.java   |  12 +-
 .../main/java/org/apache/tajo/util/JSPUtil.java |   2 +-
 .../planner/TestPreLogicalPlanVerifier.java     |  74 ++++
 .../tajo/jdbc/TestTajoDatabaseMetaData.java     | 111 ++++-
 .../master/querymaster/TestQueryProgress.java   |  73 ++++
 .../configuration/catalog_configuration.rst     |  33 ++
 .../functions/datetime_func_and_operators.rst   | 409 ++++++++++++++++++-
 .../main/sphinx/getting_started/local_setup.rst |   6 +
 .../src/main/sphinx/sql_language/data_model.rst |   8 +-
 .../src/main/sphinx/sql_language/queries.rst    | 232 ++++++++++-
 .../apache/tajo/jdbc/TajoDatabaseMetaData.java  | 101 ++++-
 tajo-project/pom.xml                            |   7 +-
 .../tajo/storage/AbstractStorageManager.java    |   2 +-
 26 files changed, 1406 insertions(+), 150 deletions(-)
----------------------------------------------------------------------



[04/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: 45f5ed3adba931f4706f26dda1d3c03240ee11d3
Parents: 7a7b4fd 87e7ba2
Author: Jaehwa Jung <bl...@apache.org>
Authored: Mon Aug 11 14:40:25 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Mon Aug 11 14:40:25 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |   8 +
 .../java/org/apache/tajo/catalog/TableMeta.java |  14 +-
 .../apache/tajo/catalog/TestKeyValueSet.java    |  83 ++++++-
 .../tajo/catalog/store/HCatalogStore.java       |  28 +--
 .../tajo/catalog/store/TestHCatalogStore.java   |  12 +-
 .../org/apache/tajo/catalog/TestCatalog.java    |  10 +-
 .../tajo/cli/DefaultTajoCliOutputFormatter.java |  16 +-
 .../java/org/apache/tajo/cli/HelpCommand.java   | 100 ++++----
 .../java/org/apache/tajo/cli/SetCommand.java    |  78 +++++-
 .../main/java/org/apache/tajo/cli/TajoCli.java  | 149 ++++++++----
 .../apache/tajo/cli/TajoCliOutputFormatter.java |   5 +-
 .../org/apache/tajo/cli/TajoShellCommand.java   |  10 +-
 .../main/java/org/apache/tajo/ConfigKey.java    |  52 ++++
 .../java/org/apache/tajo/OverridableConf.java   | 235 +++++++++++++++++++
 .../main/java/org/apache/tajo/SessionVars.java  | 211 +++++++++++++++++
 .../java/org/apache/tajo/conf/TajoConf.java     | 199 ++++++++--------
 .../main/java/org/apache/tajo/datum/Datum.java  |   2 +-
 .../java/org/apache/tajo/datum/NullDatum.java   |   1 +
 .../java/org/apache/tajo/util/KeyValueSet.java  | 149 ++++++++++--
 .../java/org/apache/tajo/util/StringUtils.java  |  96 ++++++++
 .../tajo/datum/TestArithmeticOperator.java      |   4 +-
 .../tajo/engine/planner/LogicalOptimizer.java   |   9 +-
 .../apache/tajo/engine/planner/LogicalPlan.java |   4 +-
 .../engine/planner/LogicalPlanPreprocessor.java |  18 +-
 .../engine/planner/LogicalPlanVerifier.java     |  12 +-
 .../tajo/engine/planner/LogicalPlanner.java     |  35 ++-
 .../engine/planner/PhysicalPlannerImpl.java     |  44 +++-
 .../engine/planner/PreLogicalPlanVerifier.java  |  21 +-
 .../engine/planner/global/GlobalPlanner.java    |  18 +-
 .../planner/physical/ExternalSortExec.java      |   4 +-
 .../HashBasedColPartitionStoreExec.java         |   3 +-
 .../SortBasedColPartitionStoreExec.java         |   7 +-
 .../engine/planner/physical/StoreTableExec.java |   6 +-
 .../apache/tajo/engine/query/QueryContext.java  | 144 ++++++------
 .../tajo/engine/query/QueryUnitRequestImpl.java |   3 +-
 .../org/apache/tajo/engine/utils/TupleUtil.java |   3 +-
 .../org/apache/tajo/master/GlobalEngine.java    |  94 ++++----
 .../tajo/master/TajoMasterClientService.java    |  31 ++-
 .../apache/tajo/master/querymaster/Query.java   |   4 +-
 .../tajo/master/querymaster/QueryMaster.java    |  11 +-
 .../querymaster/QueryMasterManagerService.java  |   4 +-
 .../master/querymaster/QueryMasterTask.java     |   4 +-
 .../tajo/master/querymaster/Repartitioner.java  |  16 +-
 .../tajo/master/querymaster/SubQuery.java       |  15 +-
 .../org/apache/tajo/master/session/Session.java |  50 ++--
 .../session/SessionLivelinessMonitor.java       |   2 +-
 .../main/java/org/apache/tajo/worker/Task.java  |   4 +-
 .../apache/tajo/worker/TaskAttemptContext.java  |  12 +-
 .../resources/webapps/worker/querydetail.jsp    |  10 +
 .../apache/tajo/LocalTajoTestingUtility.java    |   5 +
 .../java/org/apache/tajo/QueryTestCaseBase.java |   2 +-
 .../test/java/org/apache/tajo/TpchTestBase.java |   2 +-
 .../tajo/cli/TestDefaultCliOutputFormatter.java |  47 +++-
 .../java/org/apache/tajo/cli/TestTajoCli.java   | 172 ++++++++------
 .../org/apache/tajo/client/TestTajoClient.java  |   8 +-
 .../apache/tajo/engine/eval/ExprTestBase.java   |   9 +-
 .../tajo/engine/eval/TestEvalTreeUtil.java      |  16 +-
 .../engine/planner/TestLogicalOptimizer.java    |  20 +-
 .../tajo/engine/planner/TestLogicalPlan.java    |   3 +-
 .../tajo/engine/planner/TestLogicalPlanner.java | 135 ++++++++---
 .../tajo/engine/planner/TestPlannerUtil.java    |   5 +-
 .../planner/global/TestBroadcastJoinPlan.java   |  62 ++---
 .../planner/physical/TestBNLJoinExec.java       |   9 +-
 .../planner/physical/TestBSTIndexExec.java      |   4 +-
 .../planner/physical/TestExternalSortExec.java  |   4 +-
 .../physical/TestFullOuterHashJoinExec.java     |  24 +-
 .../physical/TestFullOuterMergeJoinExec.java    |  29 +--
 .../planner/physical/TestHashAntiJoinExec.java  |   4 +-
 .../planner/physical/TestHashJoinExec.java      |  19 +-
 .../planner/physical/TestHashSemiJoinExec.java  |   4 +-
 .../physical/TestLeftOuterHashJoinExec.java     |  28 +--
 .../physical/TestLeftOuterNLJoinExec.java       |  25 +-
 .../planner/physical/TestMergeJoinExec.java     |   4 +-
 .../engine/planner/physical/TestNLJoinExec.java |  17 +-
 .../planner/physical/TestPhysicalPlanner.java   | 100 ++++----
 .../physical/TestProgressExternalSortExec.java  |   4 +-
 .../physical/TestRightOuterHashJoinExec.java    |  16 +-
 .../physical/TestRightOuterMergeJoinExec.java   |  32 +--
 .../engine/planner/physical/TestSortExec.java   |   4 +-
 .../tajo/engine/query/TestGroupByQuery.java     |  22 +-
 .../tajo/engine/query/TestJoinBroadcast.java    |   8 +-
 .../apache/tajo/engine/query/TestJoinQuery.java |  90 +++----
 .../tajo/engine/query/TestNullValues.java       |  14 +-
 .../tajo/engine/query/TestSelectQuery.java      |  10 +-
 .../apache/tajo/engine/query/TestSortQuery.java |   8 +-
 .../tajo/engine/query/TestTablePartitions.java  |  43 ++++
 .../org/apache/tajo/jdbc/TestResultSet.java     |   2 +-
 .../tajo/master/TestExecutionBlockCursor.java   |   6 +-
 .../apache/tajo/master/TestGlobalPlanner.java   |   4 +-
 .../querymaster/TestQueryUnitStatusUpdate.java  |   2 +-
 .../tajo/worker/TestRangeRetrieverHandler.java  |   8 +-
 .../TestTablePartitions/lineitemspecial.tbl     |   5 +
 .../TestTablePartitions/lineitemspecial_ddl.sql |   3 +
 .../TestSpecialCharPartitionKeys1.result        |   4 +
 .../TestSpecialCharPartitionKeys2.result        |   3 +
 .../TestTajoCli/testHelpSessionVars.result      |  36 +++
 ...estSelectResultWithNullTrueDeprecated.result |   9 +
 .../testStopWhenErrorDeprecated.result          |   6 +
 .../java/org/apache/tajo/storage/Appender.java  |   2 +-
 .../java/org/apache/tajo/storage/CSVFile.java   |  11 +-
 .../org/apache/tajo/storage/StorageUtil.java    |  18 +-
 .../org/apache/tajo/storage/avro/AvroUtil.java  |  17 +-
 .../org/apache/tajo/storage/rcfile/RCFile.java  |  10 +-
 .../sequencefile/SequenceFileAppender.java      |  30 ++-
 .../sequencefile/SequenceFileScanner.java       |  21 +-
 .../apache/tajo/storage/v2/RCFileScanner.java   |   2 +-
 .../tajo/storage/TestCompressionStorages.java   |  12 +
 .../org/apache/tajo/storage/TestStorages.java   |  13 +
 108 files changed, 2272 insertions(+), 1010 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/45f5ed3a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
----------------------------------------------------------------------


[10/19] git commit: TAJO-1062: Update TSQL documentation

Posted by bl...@apache.org.
TAJO-1062: Update TSQL documentation


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

Branch: refs/heads/master
Commit: 0e63abc71723c4c22f2c591ae60d892a9707973f
Parents: 52a9421
Author: Jaehwa Jung <bl...@apache.org>
Authored: Wed Sep 24 10:48:09 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Wed Sep 24 10:48:09 2014 +0900

----------------------------------------------------------------------
 tajo-docs/src/main/sphinx/cli.rst               | 165 +---------
 .../src/main/sphinx/tsql/admin_command.rst      |  60 ++++
 tajo-docs/src/main/sphinx/tsql/back_command.rst |  28 ++
 tajo-docs/src/main/sphinx/tsql/dfs_command.rst  |  26 ++
 tajo-docs/src/main/sphinx/tsql/execute_file.rst |  63 ++++
 tajo-docs/src/main/sphinx/tsql/intro.rst        |  41 +++
 tajo-docs/src/main/sphinx/tsql/meta_command.rst | 313 +++++++++++++++++++
 .../src/main/sphinx/tsql/single_command.rst     |  25 ++
 tajo-docs/src/main/sphinx/tsql/variables.rst    |  66 ++++
 9 files changed, 634 insertions(+), 153 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/cli.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/cli.rst b/tajo-docs/src/main/sphinx/cli.rst
index 95f8d5c..6684508 100644
--- a/tajo-docs/src/main/sphinx/cli.rst
+++ b/tajo-docs/src/main/sphinx/cli.rst
@@ -1,159 +1,18 @@
 *****************************
-Tajo Shell (TSQL)
+Command-line Interface
 *****************************
 
-==========
-Synopsis
-==========
+Tajo provides a shell utility for users. It is the command-line interface (CLI). Using the CLI, users can create or drop tables, inspect schema and query tables, etc. For reference, we named its name to tsql.
 
-.. code-block:: bash
+.. toctree::
+  :maxdepth: 1
 
-  bin/tsql [options] [database name]
+  tsql/intro
+  tsql/single_command
+  tsql/execute_file
+  tsql/back_command
+  tsql/meta_command
+  tsql/dfs_command
+  tsql/variables
+  tsql/admin_command
 
-If a *database_name* is given, tsql connects to the database at startup time. Otherwise, tsql connects to ``default`` database.
-
-Options
-
-* ``-c "quoted sql"`` : Execute quoted sql statements, and then the shell will exist.
-* ``-f filename (--file filename)`` : Use the file named filename as the source of commands instead of interactive shell.
-* ``-h hostname (--host hostname)`` : Specifies the host name of the machine on which the Tajo master is running.
-* ``-p port (--port port)`` : Specifies the TCP port. If it is not set, the port will be 26002 in default. 
-
-===================
-Entering tsql shell
-===================
-
-If the hostname and the port num are not given, tsql will try to connect the Tajo master specified in ${TAJO_HOME}/conf/tajo-site.xml. ::
-
-  bin/tsql
-
-  default>
-
-If you want to connect a specified TajoMaster, you should use '-h' and (or) 'p' options as follows: ::
-
-  bin/tsql -h localhost -p 9004
-
-  default> 
-
-The prompt indicates the current database.
-
-===================
- Meta Commands
-===================
-
-In tsql, anything command that begins with an unquoted backslash ('\') is a tsql meta-command that is processed by tsql itself.
-
-In the current implementation, there are meta commands as follows: ::
-
-  default> \?
-
-  General
-    \copyright  show Apache License 2.0
-    \version    show Tajo version
-    \?          show help
-    \q          quit tsql
-
-
-  Informational
-    \l           list databases
-    \c           show current database
-    \c [DBNAME]  connect to new database
-    \d           list tables
-    \d [TBNAME]  describe table
-    \df          list functions
-    \df NAME     describe function
-
-
-  Variables
-    \set [[NAME] [VALUE]  set session variable or list session variables
-    \unset NAME           unset session variable
-
-
-  Documentations
-    tsql guide        http://tajo.apache.org/docs/0.8.0/cli.html
-    Query language    http://tajo.apache.org/docs/0.8.0/sql_language.html
-    Functions         http://tajo.apache.org/docs/0.8.0/functions.html
-    Backup & restore  http://tajo.apache.org/docs/0.8.0/backup_and_restore.html
-    Configuration     http://tajo.apache.org/docs/0.8.0/configuration.html
-
------------------------------------------------
-Basic usages
------------------------------------------------
-
-``\l`` command shows a list of all databases.
-
-.. code-block:: sql
-
-  default> \l
-  default
-  tpch
-  work1
-  default> 
-
-``\d`` command shows a list of tables in the current database as follows: ..
-
-  default> \d
-  customer
-  lineitem
-  nation
-  orders
-  part
-  partsupp
-  region
-  supplier
-
-``\d [table name]`` command also shows a table description.
-
-  default> \d orders
-
-  table name: orders
-  table path: hdfs:/xxx/xxx/tpch/orders
-  store type: CSV
-  number of rows: 0
-  volume (bytes): 172.0 MB
-  schema: 
-  o_orderkey      INT8
-  o_custkey       INT8
-  o_orderstatus   TEXT
-  o_totalprice    FLOAT8
-  o_orderdate     TEXT
-  o_orderpriority TEXT
-  o_clerk TEXT
-  o_shippriority  INT4
-  o_comment       TEXT
-
-The prompt ``default>`` indicates the current database. Basically, all SQL statements and meta commands work in the current database. Also, you can change the current database with ``\c`` command.
-
-.. code-block:: sql
-
-  default> \c work1
-  You are now connected to database "test" as user "hyunsik".
-  work1>
-
------------------------------------------------
-Session Variables
------------------------------------------------
-
-Each client connection to TajoMaster creates a unique session, and the client and TajoMaster uses the session until disconnect. A session provides session variables which are used for various configs per session.
-
-``tsql`` provides the meta command ``\set`` to manipulate session variables. Just ``\set`` command shows all session variables. ::
-
-  default> \set
-  'name1'='val1'
-  'name2'='val2'
-  'name3'='val3'
-       ...
-
-``\set key val`` will set the session variable named *key* with the value *val*. ::
-
-  default> \set
-  'CURRENT_DATABASE'='default'
-  
-  default> \set key1 val1
-
-  default> \set
-  'CURRENT_DATABASE'='default'
-  'key1'='val1'
-
-
-Also, ``\unset key`` will unset the session variable named *key*.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/admin_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/admin_command.rst b/tajo-docs/src/main/sphinx/tsql/admin_command.rst
new file mode 100644
index 0000000..cffa9e6
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/admin_command.rst
@@ -0,0 +1,60 @@
+*********************************
+Administration Commands
+*********************************
+
+
+==========
+Synopsis
+==========
+
+Tsql provides commands for administrator as follows as follows:
+
+.. code-block:: sql
+
+  default> \admin;
+  usage: admin [options]
+   -cluster          Show Cluster Info
+   -desc             Show Query Description
+   -h,--host <arg>   Tajo server host
+   -kill <arg>       Kill a running query
+   -list             Show Tajo query list
+   -p,--port <arg>   Tajo server port
+   -showmasters      gets list of tajomasters in the cluster
+
+
+-----------------------------------------------
+Basic usages
+-----------------------------------------------
+
+``-list`` options shows a list of all running queries as follows: ::
+
+  default> \admin -list
+  QueryId              State               StartTime           Query
+  -------------------- ------------------- ------------------- -----------------------------
+  q_1411357607375_0006 QUERY_RUNNING       2014-09-23 07:19:40 select count(*) from lineitem
+
+
+``-desc`` options shows a detailed description of a specified running query s as follows: ::
+
+  default> \admin -desc q_1411357607375_0006
+  Id: 1
+  Query Id: q_1411357607375_0006
+  Started Time: 2014-09-23 07:19:40
+  Query State: QUERY_RUNNING
+  Execution Time: 20.0 sec
+  Query Progress: 0.249
+  Query Statement:
+  select count(*) from lineitem
+
+
+``-kill`` options kills a specified running queries as follows: ::
+
+  default> \admin -kill q_1411357607375_0007
+  q_1411357607375_0007 is killed successfully.
+
+
+
+``-showmasters`` options shows a list of all tajo masters as follows: ::
+
+  default> \admin -showmasters
+  grtajo01
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/back_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/back_command.rst b/tajo-docs/src/main/sphinx/tsql/back_command.rst
new file mode 100644
index 0000000..56bdd71
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/back_command.rst
@@ -0,0 +1,28 @@
+*********************************
+Executing as background process
+*********************************
+
+
+If you execute tsql as background process, tsql will exit before execute a query because of jconsole architecture as
+follows:
+
+ .. code-block:: sql
+
+  $ bin/tsql  -f aggregation.sql &
+  [1] 19303
+  $
+  [1]+  Stopped                 ./bin/tsql -f aggregation.sql
+
+
+To avoid above problem, tajo provides the -B command as follows:
+
+.. code-block:: sql
+
+  $ bin/tsql  -B -f aggregation.sql &
+    [2] 19419
+    Progress: 0%, response time: 0.218 sec
+    Progress: 0%, response time: 0.22 sec
+    Progress: 0%, response time: 0.421 sec
+    Progress: 0%, response time: 0.823 sec
+    Progress: 0%, response time: 1.425 sec
+    Progress: 1%, response time: 2.227 sec
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/dfs_command.rst b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
new file mode 100644
index 0000000..b6cb463
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
@@ -0,0 +1,26 @@
+*********************************
+Executing HDFS commands
+*********************************
+
+You can run the hadoop dfs commands(FsShell) within tsql. ``\dfs`` command allows the hadoop dfs commands. If you want to use this command, you just specify FsShell arguments and add the semicolon at the end as follows:
+
+.. code-block:: sql
+
+  default> \dfs -ls /;
+  Found 3 items
+  drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:04 /tajo
+  drwxr-xr-x   - tajo supergroup          0 2014-09-04 02:20 /tmp
+  drwxr-xr-x   - tajo supergroup          0 2014-09-16 13:41 /user
+
+  default> \dfs -ls /tajo;
+  Found 2 items
+  drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:04 /tajo/system
+  drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:15 /tajo/warehouse
+
+  default> \dfs -mkdir /tajo/temp;
+
+  default> \dfs -ls /tajo;
+  Found 3 items
+  drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:04 /tajo/system
+  drwxr-xr-x   - tajo supergroup          0 2014-09-23 06:48 /tajo/temp
+  drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:15 /tajo/warehouse
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/execute_file.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/execute_file.rst b/tajo-docs/src/main/sphinx/tsql/execute_file.rst
new file mode 100644
index 0000000..014f513
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/execute_file.rst
@@ -0,0 +1,63 @@
+*********************************
+Executing Queries from Files
+*********************************
+
+
+-----------------------------------------------
+Basic usages
+-----------------------------------------------
+
+
+Tajo can execute more queries that were saved to a file using the -f file argument as follows:
+
+.. code-block:: sql
+
+  $ cat aggregation.sql
+  select count(*) from table1;
+  select sum(score) from table1;
+
+  $ bin/tsql -f aggregation.sql
+  Progress: 0%, response time: 0.216 sec
+  Progress: 0%, response time: 0.217 sec
+  Progress: 100%, response time: 0.331 sec
+  ?count
+  -------------------------------
+  5
+  (1 rows, 0.331 sec, 2 B selected)
+  Progress: 0%, response time: 0.203 sec
+  Progress: 0%, response time: 0.204 sec
+  Progress: 50%, response time: 0.406 sec
+  Progress: 100%, response time: 0.769 sec
+  ?sum
+  -------------------------------
+  15.0
+  (1 rows, 0.769 sec, 5 B selected)
+
+
+
+-----------------------------------------------
+Setting parameter value in SQL file
+-----------------------------------------------
+
+If you wish to set a parameter value in the SQL file, you can set with the -param key=value option.When you use this feature, you have to use the parameter in the file as follows:
+
+.. code-block:: sql
+
+  ${paramter name}
+
+
+You have to put the parameter name in braces and you must use the $ symbol for the prefix as follows:
+
+.. code-block:: sql
+
+  $ cat aggregation.sql
+  select count(*) from table1 where id = ${p_id};
+
+  $ bin/tsql -param p_id=1 -f aggregation.sql
+  Progress: 0%, response time: 0.216 sec
+  Progress: 0%, response time: 0.217 sec
+  Progress: 100%, response time: 0.331 sec
+  ?count
+  -------------------------------
+  1
+  (1 rows, 0.331 sec, 2 B selected)

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/intro.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/intro.rst b/tajo-docs/src/main/sphinx/tsql/intro.rst
new file mode 100644
index 0000000..badaead
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/intro.rst
@@ -0,0 +1,41 @@
+*****************************
+Introducing to TSQL
+*****************************
+
+==========
+Synopsis
+==========
+
+.. code-block:: bash
+
+  bin/tsql [options] [database name]
+
+If a *database_name* is given, tsql connects to the database at startup time. Otherwise, tsql connects to ``default`` database.
+
+Options
+
+* ``-c "quoted sql"`` : Execute quoted sql statements, and then the shell will exist.
+* ``-f filename (--file filename)`` : Use the file named filename as the source of commands instead of interactive shell.
+* ``-h hostname (--host hostname)`` : Specifies the host name of the machine on which the Tajo master is running.
+* ``-p port (--port port)`` : Specifies the TCP port. If it is not set, the port will be 26002 in default.
+* ``-conf configuration (--conf configuration)`` : Setting tajo configuration value.
+* ``-param parameter (--param parameter)`` : Use a parameter value in SQL file.
+* ``-B (--background)`` : Execute as background process.
+
+===================
+Entering tsql shell
+===================
+
+If the hostname and the port num are not given, tsql will try to connect the Tajo master specified in ${TAJO_HOME}/conf/tajo-site.xml. ::
+
+  bin/tsql
+
+  default>
+
+If you want to connect a specified TajoMaster, you should use '-h' and (or) 'p' options as follows: ::
+
+  bin/tsql -h localhost -p 9004
+
+  default>
+
+The prompt indicates the current database.

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/meta_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/meta_command.rst b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
new file mode 100644
index 0000000..b183cf5
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
@@ -0,0 +1,313 @@
+*********************************
+Meta Commands
+*********************************
+
+
+In tsql, anything command that begins with an unquoted backslash ('\') is a tsql meta-command that is processed by tsql itself.
+
+In the current implementation, there are meta commands as follows: ::
+
+  default> \?
+
+
+  General
+    \copyright    show Apache License 2.0
+    \version      show Tajo version
+    \?            show help
+    \? [COMMAND]  show help of a given command
+    \help         alias of \?
+    \q            quit tsql
+
+
+  Informational
+    \l           list databases
+    \c           show current database
+    \c [DBNAME]  connect to new database
+    \d           list tables
+    \d [TBNAME]  describe table
+    \df          list functions
+    \df NAME     describe function
+
+
+  Tool
+    \!           execute a linux shell command
+    \dfs         execute a dfs command
+    \admin       execute tajo admin command
+
+
+  Variables
+    \set [[NAME] [VALUE]  set session variable or list session variables
+    \unset NAME           unset session variable
+
+
+  Documentations
+    tsql guide        http://tajo.apache.org/docs/current/cli.html
+    Query language    http://tajo.apache.org/docs/current/sql_language.html
+    Functions         http://tajo.apache.org/docs/current/functions.html
+    Backup & restore  http://tajo.apache.org/docs/current/backup_and_restore.html
+    Configuration     http://tajo.apache.org/docs/current/configuration.html
+
+-----------------------------------------------
+Basic usages
+-----------------------------------------------
+
+``\l`` command shows a list of all databases as follows: ::
+
+  default> \l
+  default
+  tpch
+  work1
+  default>
+
+
+
+``\d`` command shows a list of tables in the current database as follows: ::
+
+  default> \d
+  customer
+  lineitem
+  nation
+  orders
+  part
+  partsupp
+  region
+  supplier
+
+
+``\d [table name]`` command also shows a table description as follows: ::
+
+  default> \d orders
+
+  table name: orders
+  table path: hdfs:/xxx/xxx/tpch/orders
+  store type: CSV
+  number of rows: 0
+  volume (bytes): 172.0 MB
+  schema:
+  o_orderkey      INT8
+  o_custkey       INT8
+  o_orderstatus   TEXT
+  o_totalprice    FLOAT8
+  o_orderdate     TEXT
+  o_orderpriority TEXT
+  o_clerk TEXT
+  o_shippriority  INT4
+  o_comment       TEXT
+
+
+
+The prompt ``default>`` indicates the current database. Basically, all SQL statements and meta commands work in the current database. Also, you can change the current database with ``\c`` command.
+
+.. code-block:: sql
+
+  default> \c work1
+  You are now connected to database "test" as user "hyunsik".
+  work1>
+
+
+``\df`` command shows a list of all buit-in function as follows: ::
+
+  default> \df
+   Name            | Result type     | Argument types        | Description                                   | Type
+  -----------------+-----------------+-----------------------+-----------------------------------------------+-----------
+   abs             | INT4            | INT4                  | Absolute value                                | GENERAL
+   abs             | INT8            | INT8                  | Absolute value                                | GENERAL
+   abs             | FLOAT4          | FLOAT4                | Absolute value                                | GENERAL
+   abs             | FLOAT8          | FLOAT8                | Absolute value                                | GENERAL
+   acos            | FLOAT8          | FLOAT4                | Inverse cosine.                               | GENERAL
+   acos            | FLOAT8          | FLOAT8                | Inverse cosine.                               | GENERAL
+   add_days        | TIMESTAMP       | DATE,INT2             | Return date value which is added with given pa| GENERAL
+   add_days        | TIMESTAMP       | DATE,INT4             | Return date value which is added with given pa| GENERAL
+   add_days        | TIMESTAMP       | DATE,INT8             | Return date value which is added with given pa| GENERAL
+   add_days        | TIMESTAMP       | TIMESTAMP,INT2        | Return date value which is added with given pa| GENERAL
+   add_days        | TIMESTAMP       | TIMESTAMP,INT4        | Return date value which is added with given pa| GENERAL
+   add_days        | TIMESTAMP       | TIMESTAMP,INT8        | Return date value which is added with given pa| GENERAL
+   add_months      | TIMESTAMP       | DATE,INT2             | Return date value which is added with given pa| GENERAL
+   add_months      | TIMESTAMP       | DATE,INT4             | Return date value which is added with given pa| GENERAL
+   add_months      | TIMESTAMP       | DATE,INT8             | Return date value which is added with given pa| GENERAL
+   add_months      | TIMESTAMP       | TIMESTAMP,INT2        | Return date value which is added with given pa| GENERAL
+   add_months      | TIMESTAMP       | TIMESTAMP,INT4        | Return date value which is added with given pa| GENERAL
+   add_months      | TIMESTAMP       | TIMESTAMP,INT8        | Return date value which is added with given pa| GENERAL
+   ascii           | INT4            | TEXT                  | ASCII code of the first character of the argum| GENERAL
+   asin            | FLOAT8          | FLOAT4                | Inverse sine.                                 | GENERAL
+   asin            | FLOAT8          | FLOAT8                | Inverse sine.                                 | GENERAL
+   atan            | FLOAT8          | FLOAT4                | Inverse tangent.                              | GENERAL
+   atan            | FLOAT8          | FLOAT8                | Inverse tangent.                              | GENERAL
+   atan2           | FLOAT8          | FLOAT4,FLOAT4         | Inverse tangent of y/x.                       | GENERAL
+   atan2           | FLOAT8          | FLOAT8,FLOAT8         | Inverse tangent of y/x.                       | GENERAL
+   avg             | FLOAT8          | INT8                  | the mean of a set of numbers                  | AGGREGATIO
+   avg             | FLOAT8          | FLOAT4                | The mean of a set of numbers.                 | AGGREGATIO
+   avg             | FLOAT8          | INT4                  | the mean of a set of numbers.                 | AGGREGATIO
+   avg             | FLOAT8          | FLOAT8                | The mean of a set of numbers.                 | AGGREGATIO
+   bit_length      | INT4            | TEXT                  | Number of bits in string                      | GENERAL
+   btrim           | TEXT            | TEXT                  |  Remove the longest string consisting only of | GENERAL
+   btrim           | TEXT            | TEXT,TEXT             |  Remove the longest string consisting only of | GENERAL
+   cbrt            | FLOAT8          | FLOAT4                | Cube root                                     | GENERAL
+   cbrt            | FLOAT8          | FLOAT8                | Cube root                                     | GENERAL
+   ceil            | INT8            | FLOAT4                | Smallest integer not less than argument.      | GENERAL
+   ceil            | INT8            | FLOAT8                | Smallest integer not less than argument.      | GENERAL
+   ceiling         | INT8            | FLOAT4                | Smallest integer not less than argument.      | GENERAL
+   ceiling         | INT8            | FLOAT8                | Smallest integer not less than argument.      | GENERAL
+   char_length     | INT4            | TEXT                  | Number of characters in string                | GENERAL
+   character_length| INT4            | TEXT                  | Number of characters in string                | GENERAL
+   chr             | CHAR            | INT4                  | Character with the given code.                | GENERAL
+   coalesce        | BOOLEAN         | BOOLEAN,BOOLEAN_ARRAY | Returns the first of its arguments that is not| GENERAL
+   coalesce        | INT8            | INT8_ARRAY            | Returns the first of its arguments that is not| GENERAL
+   coalesce        | FLOAT8          | FLOAT8_ARRAY          | Returns the first of its arguments that is not| GENERAL
+   coalesce        | TEXT            | TEXT_ARRAY            | Returns the first of its arguments that is not| GENERAL
+   coalesce        | DATE            | DATE_ARRAY            | Returns the first of its arguments that is not| GENERAL
+   coalesce        | TIME            | TIME_ARRAY            | Returns the first of its arguments that is not| GENERAL
+   coalesce        | TIMESTAMP       | TIMESTAMP_ARRAY       | Returns the first of its arguments that is not| GENERAL
+   concat          | TEXT            | TEXT,TEXT_ARRAY       | Concatenate all arguments.                    | GENERAL
+   concat_ws       | TEXT            | TEXT,TEXT,TEXT_ARRAY  | Concatenate all but first arguments with separ| GENERAL
+   cos             | FLOAT8          | FLOAT4                | Cosine.                                       | GENERAL
+   cos             | FLOAT8          | FLOAT8                | Cosine.                                       | GENERAL
+   count           | INT8            | ANY                   |  The number of rows for which the supplied exp| DISTINCT_A
+   count           | INT8            |                       | the total number of retrieved rows            | AGGREGATIO
+   count           | INT8            | ANY                   | The number of retrieved rows for which the sup| AGGREGATIO
+   current_date    | DATE            |                       | Get current date. Result is DATE type.        | GENERAL
+   current_time    | TIME            |                       | Get current time. Result is TIME type.        | GENERAL
+   date            | INT8            | INT4                  | Extracts the date part of the date or datetime| GENERAL
+   date_part       | FLOAT8          | TEXT,TIME             | Extract field from time                       | GENERAL
+   date_part       | FLOAT8          | TEXT,TIMESTAMP        | Extract field from timestamp                  | GENERAL
+   date_part       | FLOAT8          | TEXT,DATE             | Extract field from date                       | GENERAL
+   decode          | TEXT            | TEXT,TEXT             | Decode binary data from textual representation| GENERAL
+   degrees         | FLOAT8          | FLOAT4                | Radians to degrees                            | GENERAL
+   degrees         | FLOAT8          | FLOAT8                | Radians to degrees                            | GENERAL
+   digest          | TEXT            | TEXT,TEXT             | Calculates the Digest hash of string          | GENERAL
+   div             | INT8            | INT8,INT8             | Division(integer division truncates results)  | GENERAL
+   div             | INT8            | INT8,INT4             | Division(integer division truncates results)  | GENERAL
+   div             | INT8            | INT4,INT8             | Division(integer division truncates results)  | GENERAL
+   div             | INT8            | INT4,INT4             | Division(integer division truncates results)  | GENERAL
+   encode          | TEXT            | TEXT,TEXT             | Encode binary data into a textual representati| GENERAL
+   exp             | FLOAT8          | FLOAT4                | Exponential                                   | GENERAL
+   exp             | FLOAT8          | FLOAT8                | Exponential                                   | GENERAL
+   find_in_set     | INT4            | TEXT,TEXT             | Returns the first occurrence of str in str_arr| GENERAL
+   floor           | INT8            | FLOAT4                |  Largest integer not greater than argument.   | GENERAL
+   floor           | INT8            | FLOAT8                |  Largest integer not greater than argument.   | GENERAL
+   geoip_country_co| TEXT            | TEXT                  | Convert an ipv4 address string to a geoip coun| GENERAL
+   geoip_country_co| TEXT            | INET4                 | Convert an ipv4 address to a geoip country cod| GENERAL
+   geoip_in_country| BOOLEAN         | TEXT,TEXT             | If the given country code is same with the cou| GENERAL
+   geoip_in_country| BOOLEAN         | INET4,TEXT            | If the given country code is same with the cou| GENERAL
+   initcap         | TEXT            | TEXT                  | Convert the first letter of each word to upper| GENERAL
+   left            | TEXT            | TEXT,INT4             | First n characters in the string.             | GENERAL
+   length          | INT4            | TEXT                  | Number of characters in string.               | GENERAL
+   locate          | INT4            | TEXT,TEXT             | Location of specified substring               | GENERAL
+   locate          | INT4            | TEXT,TEXT,INT4        | Location of specified substring               | GENERAL
+   lower           | TEXT            | TEXT                  | Convert string to lower case                  | GENERAL
+   lpad            | TEXT            | TEXT,INT4             | Fill up the string to length length by prepend| GENERAL
+   lpad            | TEXT            | TEXT,INT4,TEXT        | Fill up the string to length length by prepend| GENERAL
+   ltrim           | TEXT            | TEXT                  | Remove the longest string containing only char| GENERAL
+   ltrim           | TEXT            | TEXT,TEXT             | Remove the longest string containing only char| GENERAL
+   max             | INT4            | INT4                  | the maximum value of expr                     | AGGREGATIO
+   max             | INT8            | INT8                  | the maximum value of expr                     | AGGREGATIO
+   max             | FLOAT4          | FLOAT4                | the maximum value of expr                     | AGGREGATIO
+   max             | FLOAT8          | FLOAT8                | the maximum value of expr                     | AGGREGATIO
+   max             | TEXT            | TEXT                  | the maximum value of expr                     | AGGREGATIO
+   md5             | TEXT            | TEXT                  | Calculates the MD5 hash of string             | GENERAL
+   min             | INT4            | INT4                  | the minimum value of expr                     | AGGREGATIO
+   min             | INT8            | INT8                  | the minimum value of expr                     | AGGREGATIO
+   min             | FLOAT4          | FLOAT4                | the minimum value of expr                     | AGGREGATIO
+   min             | FLOAT8          | FLOAT8                | the minimum value of expr                     | AGGREGATIO
+   min             | TEXT            | TEXT                  | the minimum value of expr                     | AGGREGATIO
+   mod             | INT8            | INT8,INT8             | Remainder of y/x                              | GENERAL
+   mod             | INT8            | INT8,INT4             | Remainder of y/x                              | GENERAL
+   mod             | INT8            | INT4,INT8             | Remainder of y/x                              | GENERAL
+   mod             | INT8            | INT4,INT4             | Remainder of y/x                              | GENERAL
+   now             | TIMESTAMP       |                       | Get current time. Result is TIMESTAMP type.   | GENERAL
+   octet_length    | INT4            | TEXT                  | Number of bytes in string.                    | GENERAL
+   pi              | FLOAT8          |                       | "??" constant                                  | GENERAL
+   pow             | FLOAT8          | FLOAT4,FLOAT4         | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | FLOAT4,FLOAT8         | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | FLOAT8,FLOAT4         | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | FLOAT8,FLOAT8         | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT4,INT4             | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT4,INT8             | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT8,INT4             | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT8,INT8             | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT4,FLOAT4           | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT4,FLOAT8           | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT8,FLOAT4           | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | INT8,FLOAT8           | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | FLOAT4,INT4           | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | FLOAT4,INT8           | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | FLOAT8,INT4           | x raised to the power of y                    | GENERAL
+   pow             | FLOAT8          | FLOAT8,INT8           | x raised to the power of y                    | GENERAL
+   quote_ident     | TEXT            | TEXT                  | Return the given string suitably quoted to be | GENERAL
+   radians         | FLOAT8          | FLOAT8                | Degrees to radians                            | GENERAL
+   radians         | FLOAT8          | FLOAT4                | Degrees to radians                            | GENERAL
+   random          | INT4            | INT4                  | A pseudorandom number                         | GENERAL
+   rank            | INT8            |                       |  The number of rows for which the supplied exp| WINDOW
+   regexp_replace  | TEXT            | TEXT,TEXT,TEXT        |  Replace substring(s) matching a POSIX regular| GENERAL
+   repeat          | TEXT            | TEXT,INT4             | Repeat string the specified number of times.  | GENERAL
+   reverse         | TEXT            | TEXT                  | Reverse str                                   | GENERAL
+   right           | TEXT            | TEXT,INT4             | Last n characters in the string               | GENERAL
+   round           | INT8            | FLOAT4                | Round to nearest integer.                     | GENERAL
+   round           | INT8            | FLOAT8                | Round to nearest integer.                     | GENERAL
+   round           | INT8            | INT4                  | Round to nearest integer.                     | GENERAL
+   round           | INT8            | INT8                  | Round to nearest integer.                     | GENERAL
+   round           | FLOAT8          | FLOAT8,INT4           | Round to s decimalN places.                   | GENERAL
+   round           | FLOAT8          | INT8,INT4             | Round to s decimalN places.                   | GENERAL
+   row_number      | INT8            |                       | the total number of retrieved rows            | WINDOW
+   rpad            | TEXT            | TEXT,INT4             | Fill up the string to length length by appendi| GENERAL
+   rpad            | TEXT            | TEXT,INT4,TEXT        | Fill up the string to length length by appendi| GENERAL
+   rtrim           | TEXT            | TEXT                  | Remove the longest string containing only  cha| GENERAL
+   rtrim           | TEXT            | TEXT,TEXT             | Remove the longest string containing only  cha| GENERAL
+   sign            | FLOAT8          | FLOAT8                | sign of the argument (-1, 0, +1)              | GENERAL
+   sign            | FLOAT8          | FLOAT4                | sign of the argument (-1, 0, +1)              | GENERAL
+   sign            | FLOAT8          | INT8                  | sign of the argument (-1, 0, +1)              | GENERAL
+   sign            | FLOAT8          | INT4                  | sign of the argument (-1, 0, +1)              | GENERAL
+   sin             | FLOAT8          | FLOAT4                | Sine.                                         | GENERAL
+   sin             | FLOAT8          | FLOAT8                | Sine.                                         | GENERAL
+   sleep           | INT4            | INT4                  | sleep for seconds                             | GENERAL
+   split_part      | TEXT            | TEXT,TEXT,INT4        | Split string on delimiter and return the given| GENERAL
+   sqrt            | FLOAT8          | FLOAT8                | Square root                                   | GENERAL
+   sqrt            | FLOAT8          | FLOAT4                | Square root                                   | GENERAL
+   strpos          | INT4            | TEXT,TEXT             | Location of specified substring.              | GENERAL
+   strposb         | INT4            | TEXT,TEXT             | Binary location of specified substring.       | GENERAL
+   substr          | TEXT            | TEXT,INT4             | Extract substring.                            | GENERAL
+   substr          | TEXT            | TEXT,INT4,INT4        | Extract substring.                            | GENERAL
+   sum             | INT8            | INT8                  | the sum of a distinct and non-null values     | DISTINCT_A
+   sum             | INT8            | INT8                  | the sum of a set of numbers                   | AGGREGATIO
+   sum             | INT8            | INT4                  | the sum of a set of numbers                   | AGGREGATIO
+   sum             | INT8            | INT4                  | the sum of a distinct and non-null values     | DISTINCT_A
+   sum             | FLOAT8          | FLOAT8                | the sum of a set of numbers                   | AGGREGATIO
+   sum             | FLOAT8          | FLOAT4                | the sum of a set of numbers                   | AGGREGATIO
+   sum             | FLOAT8          | FLOAT4                | the sum of a distinct and non-null values     | DISTINCT_A
+   sum             | FLOAT8          | FLOAT8                | the sum of a distinct and non-null values     | DISTINCT_A
+   tan             | FLOAT8          | FLOAT4                | Tangent.                                      | GENERAL
+   tan             | FLOAT8          | FLOAT8                | Tangent.                                      | GENERAL
+   to_bin          | TEXT            | INT8                  | Returns n in binary.                          | GENERAL
+   to_bin          | TEXT            | INT4                  | Returns n in binary.                          | GENERAL
+   to_char         | TEXT            | TIMESTAMP,TEXT        | Convert time stamp to string. Format should be| GENERAL
+   to_date         | DATE            | TEXT,TEXT             | Convert string to date. Format should be a SQL| GENERAL
+   to_hex          | TEXT            | INT4                  | Convert the argument to hexadecimal           | GENERAL
+   to_hex          | TEXT            | INT8                  | Convert the argument to hexadecimal           | GENERAL
+   to_timestamp    | TIMESTAMP       | TEXT,TEXT             | Convert string to time stamp                  | GENERAL
+   to_timestamp    | TIMESTAMP       | INT4                  | Convert UNIX epoch to time stamp              | GENERAL
+   to_timestamp    | TIMESTAMP       | INT8                  | Convert UNIX epoch to time stamp              | GENERAL
+   trim            | TEXT            | TEXT                  |  Remove the longest string consisting only of | GENERAL
+   trim            | TEXT            | TEXT,TEXT             |  Remove the longest string consisting only of | GENERAL
+   upper           | TEXT            | TEXT                  | Convert string to upper case.                 | GENERAL
+   utc_usec_to     | INT8            | TEXT,INT8             | Extract field from time                       | GENERAL
+   utc_usec_to     | INT8            | TEXT,INT8,INT4        | Extract field from time                       | GENERAL
+
+  (181) rows
+
+
+``\df [function name]`` command also shows a function description as follows: ::
+
+  default> \df trim
+   Name            | Result type     | Argument types        | Description                                   | Type
+  -----------------+-----------------+-----------------------+-----------------------------------------------+-----------
+   trim            | TEXT            | TEXT                  |  Remove the longest string consisting only of | GENERAL
+   trim            | TEXT            | TEXT,TEXT             |  Remove the longest string consisting only of | GENERAL
+
+  (2) rows
+
+  Function:    TEXT trim(text)
+  Description:  Remove the longest string consisting only of  characters in characters (a space by default) from the start and end of string.
+  Example:
+  > SELECT trim('xyxtrimyyx', 'xy');
+  trim
+

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/single_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/single_command.rst b/tajo-docs/src/main/sphinx/tsql/single_command.rst
new file mode 100644
index 0000000..93b00c5
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/single_command.rst
@@ -0,0 +1,25 @@
+*********************************
+Executing a single command
+*********************************
+
+
+You may want to run more queries without entering tsql prompt. Tsql provides the -c argument for above
+requirement. And tajo assumes that queries separated by semicolon as follows:
+
+.. code-block:: sql
+
+  $ bin/tsql  -c "select count(*) from table1; select sum(score) from table1;"
+  Progress: 0%, response time: 0.217 sec
+  Progress: 0%, response time: 0.218 sec
+  Progress: 100%, response time: 0.317 sec
+  ?count
+  -------------------------------
+  5
+  (1 rows, 0.317 sec, 2 B selected)
+  Progress: 0%, response time: 0.202 sec
+  Progress: 0%, response time: 0.204 sec
+  Progress: 100%, response time: 0.345 sec
+  ?sum
+  -------------------------------
+  15.0
+  (1 rows, 0.345 sec, 5 B selected)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/0e63abc7/tajo-docs/src/main/sphinx/tsql/variables.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/variables.rst b/tajo-docs/src/main/sphinx/tsql/variables.rst
new file mode 100644
index 0000000..e859451
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/variables.rst
@@ -0,0 +1,66 @@
+*********************************
+Session Variables
+*********************************
+
+
+Each client connection to TajoMaster creates a unique session, and the client and TajoMaster uses the session until disconnect. A session provides session variables which are used for various configs per session.
+
+``tsql`` provides the meta command ``\set`` to manipulate session variables. Just ``\set`` command shows all session variables. ::
+
+  default> \set
+  'name1'='val1'
+  'name2'='val2'
+  'name3'='val3'
+       ...
+
+``\set key val`` will set the session variable named *key* with the value *val*. ::
+
+  default> \set
+  'CURRENT_DATABASE'='default'
+
+  default> \set key1 val1
+
+  default> \set
+  'CURRENT_DATABASE'='default'
+  'key1'='val1'
+
+
+Also, ``\unset key`` will unset the session variable named *key*.
+
+
+Now, tajo provides the following session variables.
+
+* ``DIST_QUERY_BROADCAST_JOIN_THRESHOLD``
+* ``DIST_QUERY_JOIN_TASK_VOLUME``
+* ``DIST_QUERY_SORT_TASK_VOLUME``
+* ``DIST_QUERY_GROUPBY_TASK_VOLUME``
+* ``DIST_QUERY_JOIN_PARTITION_VOLUME``
+* ``DIST_QUERY_GROUPBY_PARTITION_VOLUME``
+* ``DIST_QUERY_TABLE_PARTITION_VOLUME``
+* ``EXECUTOR_EXTERNAL_SORT_BUFFER_SIZE``
+* ``EXECUTOR_HASH_JOIN_SIZE_THRESHOLD``
+* ``EXECUTOR_INNER_HASH_JOIN_SIZE_THRESHOLD``
+* ``EXECUTOR_OUTER_HASH_JOIN_SIZE_THRESHOLD``
+* ``EXECUTOR_GROUPBY_INMEMORY_HASH_THRESHOLD``
+* ``MAX_OUTPUT_FILE_SIZE``
+* ``CODEGEN``
+* ``CLIENT_SESSION_EXPIRY_TIME``
+* ``CLI_MAX_COLUMN``
+* ``CLI_NULL_CHAR``
+* ``CLI_PRINT_PAUSE_NUM_RECORDS``
+* ``CLI_PRINT_PAUSE``
+* ``CLI_PRINT_ERROR_TRACE``
+* ``CLI_OUTPUT_FORMATTER_CLASS``
+* ``CLI_ERROR_STOP``
+* ``TIMEZONE``
+* ``DATE_ORDER``
+* ``CSVFILE_NULL``
+* ``DEBUG_ENABLED``
+* ``TEST_BROADCAST_JOIN_ENABLED``
+* ``TEST_JOIN_OPT_ENABLED``
+* ``TEST_FILTER_PUSHDOWN_ENABLED``
+* ``TEST_MIN_TASK_NUM``
+* ``BEHAVIOR_ARITHMETIC_ABORT``
+* ``RESULT_SET_FETCH_ROWNUM``
+
+


[09/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: 52a942136c549f197d6d1c3d1a13717e6f14a83f
Parents: 42a6c4e 5a7e272
Author: Jaehwa Jung <bl...@apache.org>
Authored: Wed Sep 24 10:26:36 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Wed Sep 24 10:26:36 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |  49 +-
 .../java/org/apache/tajo/catalog/Schema.java    |   3 +-
 .../main/java/org/apache/tajo/cli/TajoCli.java  |  21 +-
 .../java/org/apache/tajo/client/TajoAdmin.java  |  36 +-
 .../java/org/apache/tajo/client/TajoClient.java | 137 +++++-
 .../org/apache/tajo/jdbc/FetchResultSet.java    |  91 ++++
 .../org/apache/tajo/jdbc/TajoResultSetBase.java |   2 +-
 tajo-client/src/main/proto/ClientProtos.proto   |  66 +--
 .../main/proto/TajoMasterClientProtocol.proto   |   4 +-
 .../main/java/org/apache/tajo/SessionVars.java  |   3 +
 .../java/org/apache/tajo/conf/TajoConf.java     |   8 +-
 .../java/org/apache/tajo/util/BytesUtils.java   |   2 +-
 tajo-common/src/main/proto/tajo_protos.proto    |  10 +
 .../java/org/apache/tajo/benchmark/TPCH.java    |  32 +-
 .../apache/tajo/engine/planner/PlannerUtil.java | 138 +++++-
 .../engine/planner/PreLogicalPlanVerifier.java  |   4 +
 .../tajo/master/DefaultTaskScheduler.java       |  68 +--
 .../org/apache/tajo/master/GlobalEngine.java    |  31 +-
 .../apache/tajo/master/LazyTaskScheduler.java   |   4 +-
 .../master/NonForwardQueryResultScanner.java    | 165 +++++++
 .../apache/tajo/master/TajoContainerProxy.java  |   9 +-
 .../tajo/master/TajoMasterClientService.java    |  83 +++-
 .../apache/tajo/master/TajoMasterService.java   |   9 +-
 .../master/cluster/WorkerConnectionInfo.java    | 178 ++++++++
 .../master/event/TaskAttemptAssignedEvent.java  |  17 +-
 .../tajo/master/event/TaskRequestEvent.java     |  13 +-
 .../master/querymaster/QueryInProgress.java     |   6 +-
 .../master/querymaster/QueryJobManager.java     |  11 +-
 .../tajo/master/querymaster/QueryMaster.java    |  24 +-
 .../querymaster/QueryMasterManagerService.java  |   7 +-
 .../tajo/master/querymaster/QueryUnit.java      |  12 +-
 .../master/querymaster/QueryUnitAttempt.java    |  32 +-
 .../tajo/master/querymaster/SubQuery.java       |  53 +--
 .../apache/tajo/master/rm/TajoRMContext.java    |  14 +-
 .../tajo/master/rm/TajoResourceTracker.java     |  24 +-
 .../master/rm/TajoWorkerResourceManager.java    |  33 +-
 .../java/org/apache/tajo/master/rm/Worker.java  |  73 +--
 .../org/apache/tajo/master/rm/WorkerEvent.java  |   6 +-
 .../tajo/master/rm/WorkerLivelinessMonitor.java |   4 +-
 .../tajo/master/rm/WorkerReconnectEvent.java    |   2 +-
 .../tajo/master/rm/WorkerResourceManager.java   |   6 +-
 .../tajo/master/rm/WorkerStatusEvent.java       |   2 +-
 .../org/apache/tajo/master/session/Session.java |  54 +++
 .../tajo/master/session/SessionManager.java     |  13 +-
 .../tajo/worker/AbstractResourceAllocator.java  |  15 +
 .../tajo/worker/ExecutionBlockContext.java      | 446 +++++++++++++++++++
 .../worker/ExecutionBlockSharedResource.java    |  36 +-
 .../java/org/apache/tajo/worker/Fetcher.java    |   9 +-
 .../tajo/worker/TajoResourceAllocator.java      |  58 ++-
 .../java/org/apache/tajo/worker/TajoWorker.java | 244 +++++-----
 .../tajo/worker/TajoWorkerClientService.java    |   6 +-
 .../tajo/worker/TajoWorkerManagerService.java   |  65 +--
 .../main/java/org/apache/tajo/worker/Task.java  | 290 ++++--------
 .../apache/tajo/worker/TaskAttemptContext.java  |  49 +-
 .../java/org/apache/tajo/worker/TaskRunner.java | 279 ++----------
 .../apache/tajo/worker/TaskRunnerManager.java   | 261 ++++-------
 .../tajo/worker/WorkerHeartbeatService.java     |  78 ++--
 .../tajo/worker/event/TaskRunnerEvent.java      |  41 ++
 .../tajo/worker/event/TaskRunnerStartEvent.java |  59 +++
 .../tajo/worker/event/TaskRunnerStopEvent.java  |  28 ++
 .../src/main/proto/QueryMasterProtocol.proto    |   2 +-
 .../main/proto/ResourceTrackerProtocol.proto    |  12 +-
 .../src/main/proto/TajoMasterProtocol.proto     |  36 +-
 .../src/main/proto/TajoWorkerProtocol.proto     |  23 +-
 .../main/resources/webapps/admin/cluster.jsp    |  54 +--
 .../src/main/resources/webapps/admin/index.jsp  |   4 +-
 .../src/main/resources/webapps/admin/query.jsp  |   8 +-
 .../resources/webapps/worker/querytasks.jsp     |   9 +-
 .../resources/webapps/worker/taskdetail.jsp     |   2 +
 .../src/main/resources/webapps/worker/tasks.jsp |   4 +-
 .../org/apache/tajo/TajoTestingCluster.java     |  83 +++-
 .../tajo/cluster/TestWorkerConnectionInfo.java  |  36 ++
 .../tajo/engine/planner/TestPlannerUtil.java    |  62 +++
 .../tajo/engine/query/TestNullValues.java       |  32 +-
 .../tajo/engine/query/TestSelectQuery.java      |  15 +
 .../org/apache/tajo/jdbc/TestResultSet.java     |  10 +-
 .../apache/tajo/master/TestGlobalPlanner.java   |  68 ++-
 .../tajo/master/querymaster/TestKillQuery.java  | 108 +++++
 .../tajo/master/rm/TestTajoResourceManager.java |   8 +-
 .../org/apache/tajo/worker/TestFetcher.java     |  17 +-
 .../queries/TestSelectQuery/customer_ddl.sql    |   9 +
 .../TestSelectQuery/insert_into_customer.sql    |  11 +
 ...testSimpleQueryWithLimitPartitionedTable.sql |   1 +
 ...tSimpleQueryWithLimitPartitionedTable.result |  12 +
 .../TestTajoCli/testHelpSessionVars.result      |   1 +
 tajo-dist/src/main/bin/tajo                     |   1 +
 .../functions/math_func_and_operators.rst       | 276 +++++++++++-
 .../org/apache/tajo/rpc/AsyncRpcClient.java     |  11 +-
 .../org/apache/tajo/rpc/AsyncRpcServer.java     |   4 +-
 .../org/apache/tajo/rpc/BlockingRpcClient.java  |  13 +-
 .../org/apache/tajo/rpc/NettyClientBase.java    |  86 ++--
 .../org/apache/tajo/rpc/RpcConnectionPool.java  |  24 +-
 .../java/org/apache/tajo/rpc/TestAsyncRpc.java  |  91 +++-
 .../org/apache/tajo/rpc/TestBlockingRpc.java    |  73 ++-
 .../pullserver/FadvisedFileRegionWrapper.java   |  35 --
 .../pullserver/listener/FileCloseListener.java  |  53 ---
 .../pullserver/FadvisedFileRegionWrapper.java   |  34 --
 .../pullserver/listener/FileCloseListener.java  |  55 ---
 .../pullserver/FadvisedFileRegionWrapper.java   |  36 --
 .../pullserver/listener/FileCloseListener.java  |  55 ---
 .../tajo/pullserver/FadvisedChunkedFile.java    |  81 ++++
 .../tajo/pullserver/FadvisedFileRegion.java     | 170 +++++++
 .../tajo/pullserver/FileCloseListener.java      |  53 +++
 .../tajo/pullserver/PullServerAuxService.java   |   4 +-
 .../apache/tajo/pullserver/PullServerUtil.java  |  90 ++++
 .../tajo/pullserver/TajoPullServerService.java  |  24 +-
 106 files changed, 3682 insertions(+), 1737 deletions(-)
----------------------------------------------------------------------



[06/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: b33a94509c1a007b56785435c8e16640ffde91b7
Parents: aa01e83 7c5ef87
Author: Jaehwa Jung <bl...@apache.org>
Authored: Thu Sep 4 11:14:19 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Thu Sep 4 11:14:19 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |   35 +
 LICENSE                                         |   31 +
 pom.xml                                         |   52 +-
 tajo-algebra/pom.xml                            |   13 +-
 tajo-catalog/pom.xml                            |   12 +-
 tajo-catalog/tajo-catalog-client/pom.xml        |   13 +-
 .../tajo/catalog/AbstractCatalogClient.java     |   75 +-
 tajo-catalog/tajo-catalog-common/pom.xml        |   13 +-
 .../org/apache/tajo/catalog/CatalogUtil.java    |    2 +-
 .../org/apache/tajo/catalog/FunctionDesc.java   |    2 +-
 .../apache/tajo/catalog/TestKeyValueSet.java    |    1 -
 tajo-catalog/tajo-catalog-drivers/pom.xml       |   11 +-
 .../tajo-catalog-drivers/tajo-hcatalog/pom.xml  |   19 +-
 tajo-catalog/tajo-catalog-server/pom.xml        |   20 +-
 .../org/apache/tajo/catalog/CatalogServer.java  |    2 +-
 tajo-client/pom.xml                             |   14 +-
 .../main/java/org/apache/tajo/cli/TajoCli.java  |   24 +-
 .../org/apache/tajo/cli/TajoHAAdminCommand.java |   57 +
 .../java/org/apache/tajo/client/TajoAdmin.java  |   27 +-
 .../java/org/apache/tajo/client/TajoClient.java |   78 +-
 .../org/apache/tajo/client/TajoGetConf.java     |   16 +-
 .../org/apache/tajo/client/TajoHAAdmin.java     |  210 ++
 .../apache/tajo/client/TajoHAClientUtil.java    |   87 +
 tajo-common/pom.xml                             |   13 +-
 .../java/org/apache/tajo/OverridableConf.java   |   12 +
 .../main/java/org/apache/tajo/SessionVars.java  |    2 +-
 .../java/org/apache/tajo/TajoConstants.java     |    5 +
 .../java/org/apache/tajo/conf/TajoConf.java     |   16 +-
 .../java/org/apache/tajo/datum/CharDatum.java   |    5 +-
 .../main/java/org/apache/tajo/datum/Datum.java  |   11 +-
 .../org/apache/tajo/datum/DatumFactory.java     |   32 +-
 .../java/org/apache/tajo/datum/Inet4Datum.java  |    5 +
 .../java/org/apache/tajo/datum/NullDatum.java   |    5 +
 .../java/org/apache/tajo/datum/TextDatum.java   |    8 +
 .../java/org/apache/tajo/util/BitArray.java     |    2 +-
 .../org/apache/tajo/util/CommonTestingUtil.java |   24 +-
 .../org/apache/tajo/util/HAServiceUtil.java     |  293 ++
 .../java/org/apache/tajo/util/KeyValueSet.java  |   18 +-
 .../main/java/org/apache/tajo/util/Pair.java    |   44 +-
 .../java/org/apache/tajo/util/StringUtils.java  |   34 +
 .../apache/tajo/util/datetime/DateTimeUtil.java |   35 +
 tajo-core/pom.xml                               |   35 +-
 .../tajo/engine/codegen/CaseWhenEmitter.java    |  210 ++
 .../engine/codegen/CaseWhenSwitchGenerator.java |   92 +
 .../tajo/engine/codegen/CodeGenUtils.java       |   41 +
 .../tajo/engine/codegen/CompilationError.java   |   31 +
 .../tajo/engine/codegen/EvalCodeEmitter.java    |   27 +
 .../tajo/engine/codegen/EvalCodeGenContext.java |  223 ++
 .../tajo/engine/codegen/EvalCodeGenerator.java  |  840 ++++++
 .../engine/codegen/ExecutorPreCompiler.java     |  213 ++
 .../tajo/engine/codegen/TajoClassLoader.java    |   30 +
 .../engine/codegen/TajoGeneratorAdapter.java    |  953 +++++++
 .../engine/codegen/VariablesPreBuilder.java     |   83 +
 .../apache/tajo/engine/eval/AlgebraicUtil.java  |    6 +-
 .../tajo/engine/eval/BetweenPredicateEval.java  |   26 +
 .../org/apache/tajo/engine/eval/BinaryEval.java |    7 +
 .../apache/tajo/engine/eval/CaseWhenEval.java   |   38 +-
 .../org/apache/tajo/engine/eval/ConstEval.java  |   12 +-
 .../org/apache/tajo/engine/eval/EvalNode.java   |    6 +-
 .../apache/tajo/engine/eval/EvalTreeUtil.java   |   98 +-
 .../org/apache/tajo/engine/eval/EvalType.java   |   56 +-
 .../org/apache/tajo/engine/eval/FieldEval.java  |   12 +-
 .../apache/tajo/engine/eval/FunctionEval.java   |   25 +-
 .../tajo/engine/eval/LikePredicateEval.java     |    4 +
 .../engine/eval/PatternMatchPredicateEval.java  |    8 +
 .../tajo/engine/eval/RowConstantEval.java       |   10 +
 .../engine/eval/SimilarToPredicateEval.java     |    5 +
 .../tajo/engine/eval/SimpleEvalNodeVisitor.java |   27 +-
 .../org/apache/tajo/engine/eval/UnaryEval.java  |   11 +
 .../function/builtin/CoalesceBoolean.java       |    4 +-
 .../engine/function/builtin/CoalesceDate.java   |    3 +-
 .../engine/function/builtin/CoalesceDouble.java |    3 +-
 .../engine/function/builtin/CoalesceLong.java   |    3 +-
 .../engine/function/builtin/CoalesceString.java |    3 +-
 .../engine/function/builtin/CoalesceTime.java   |    3 +-
 .../function/builtin/CoalesceTimestamp.java     |    3 +-
 .../engine/plan/EvalTreeProtoDeserializer.java  |  218 ++
 .../engine/plan/EvalTreeProtoSerializer.java    |  308 ++
 .../tajo/engine/planner/ExprAnnotator.java      |   17 +-
 .../apache/tajo/engine/planner/ExprFinder.java  |    2 +-
 .../engine/planner/LogicalPlanPreprocessor.java |   22 +-
 .../engine/planner/PhysicalPlannerImpl.java     |   11 +
 .../apache/tajo/engine/planner/Projector.java   |   33 +-
 .../engine/planner/RangePartitionAlgorithm.java |   61 +-
 .../engine/planner/UniformRangePartition.java   |  309 +-
 .../tajo/engine/planner/logical/HavingNode.java |   15 +-
 .../planner/logical/PersistentStoreNode.java    |    2 +-
 .../tajo/engine/planner/logical/ScanNode.java   |   12 +-
 .../engine/planner/logical/SelectableNode.java  |   48 +
 .../engine/planner/logical/SelectionNode.java   |   15 +-
 .../engine/planner/logical/join/JoinGraph.java  |    2 +-
 .../engine/planner/physical/BNLJoinExec.java    |    9 +-
 .../planner/physical/BSTIndexScanExec.java      |    2 +-
 .../physical/BasicPhysicalExecutorVisitor.java  |    2 +
 .../planner/physical/BinaryPhysicalExec.java    |    2 +
 .../planner/physical/ColPartitionStoreExec.java |   55 +-
 .../planner/physical/ExternalSortExec.java      |    4 +
 .../HashBasedColPartitionStoreExec.java         |    6 +-
 .../planner/physical/HashFullOuterJoinExec.java |    8 +-
 .../engine/planner/physical/HashJoinExec.java   |    7 +-
 .../planner/physical/HashLeftOuterJoinExec.java |    7 +-
 .../planner/physical/HashLeftSemiJoinExec.java  |    4 +
 .../physical/HashShuffleFileWriteExec.java      |  125 +-
 .../physical/MergeFullOuterJoinExec.java        |    7 +-
 .../engine/planner/physical/MergeJoinExec.java  |    7 +-
 .../engine/planner/physical/NLJoinExec.java     |    2 +-
 .../planner/physical/NLLeftOuterJoinExec.java   |    2 +-
 .../physical/PartitionMergeScanExec.java        |    5 +-
 .../engine/planner/physical/PhysicalExec.java   |   11 +-
 .../physical/PhysicalExecutorVisitor.java       |    2 +
 .../planner/physical/PhysicalPlanUtil.java      |   64 +
 .../physical/PhysicalPlanningException.java     |   31 -
 .../engine/planner/physical/ProjectionExec.java |    2 +-
 .../physical/RightOuterMergeJoinExec.java       |    7 +-
 .../engine/planner/physical/SelectionExec.java  |    8 +-
 .../engine/planner/physical/SeqScanExec.java    |   34 +-
 .../SortBasedColPartitionStoreExec.java         |   40 +-
 .../engine/planner/physical/StoreTableExec.java |   64 +-
 .../planner/physical/UnaryPhysicalExec.java     |    5 +
 .../planner/rewrite/FilterPushDownRule.java     |   19 +-
 .../tajo/engine/query/QueryUnitRequestImpl.java |    2 +-
 .../org/apache/tajo/master/GlobalEngine.java    |   16 +-
 .../tajo/master/LaunchTaskRunnersEvent.java     |   45 +
 .../apache/tajo/master/TajoContainerProxy.java  |   34 +-
 .../java/org/apache/tajo/master/TajoMaster.java |   38 +-
 .../org/apache/tajo/master/ha/HAService.java    |   56 +
 .../tajo/master/ha/HAServiceHDFSImpl.java       |  278 ++
 .../apache/tajo/master/ha/TajoMasterInfo.java   |   89 +
 .../apache/tajo/master/querymaster/Query.java   |    3 +-
 .../tajo/master/querymaster/QueryMaster.java    |  115 +-
 .../querymaster/QueryMasterManagerService.java  |   13 +
 .../master/querymaster/QueryMasterTask.java     |   50 +-
 .../tajo/master/querymaster/QueryUnit.java      |   83 +
 .../tajo/master/querymaster/Repartitioner.java  |  346 ++-
 .../tajo/master/querymaster/SubQuery.java       |   88 +-
 .../org/apache/tajo/master/session/Session.java |    8 +-
 .../tajo/webapp/QueryExecutorServlet.java       |    5 +
 .../worker/ExecutionBlockSharedResource.java    |  139 +
 .../java/org/apache/tajo/worker/FetchImpl.java  |   32 +
 .../java/org/apache/tajo/worker/Fetcher.java    |    3 +-
 .../tajo/worker/TajoResourceAllocator.java      |   43 +-
 .../java/org/apache/tajo/worker/TajoWorker.java |  158 +-
 .../tajo/worker/TajoWorkerManagerService.java   |   24 +-
 .../main/java/org/apache/tajo/worker/Task.java  |   80 +-
 .../apache/tajo/worker/TaskAttemptContext.java  |   60 +-
 .../java/org/apache/tajo/worker/TaskRunner.java |   22 +-
 .../apache/tajo/worker/TaskRunnerManager.java   |  127 +-
 .../tajo/worker/WorkerHeartbeatService.java     |   42 +-
 tajo-core/src/main/proto/Plan.proto             |  209 ++
 .../src/main/proto/QueryMasterProtocol.proto    |    1 +
 .../src/main/proto/TajoWorkerProtocol.proto     |   33 +
 .../resources/webapps/admin/catalogview.jsp     |   13 +-
 .../main/resources/webapps/admin/cluster.jsp    |   87 +-
 .../src/main/resources/webapps/admin/index.jsp  |   47 +-
 .../src/main/resources/webapps/admin/query.jsp  |   13 +-
 .../resources/webapps/admin/query_executor.jsp  |   13 +-
 .../apache/tajo/LocalTajoTestingUtility.java    |    6 +-
 .../org/apache/tajo/TajoTestingCluster.java     |   47 +-
 .../engine/codegen/TestEvalCodeGenerator.java   |  311 ++
 .../engine/codegen/TestGeneratorAdapter.java    |   41 +
 .../apache/tajo/engine/eval/ExprTestBase.java   |  102 +-
 .../apache/tajo/engine/eval/TestEvalTree.java   |   21 +-
 .../tajo/engine/eval/TestEvalTreeUtil.java      |    7 +
 .../apache/tajo/engine/eval/TestPredicates.java |   17 +
 .../tajo/engine/eval/TestSQLExpression.java     |   24 +-
 .../function/TestConditionalExpressions.java    |  123 +-
 .../function/TestPatternMatchingPredicates.java |    2 +-
 .../planner/TestUniformRangePartition.java      |  635 ++++-
 .../planner/physical/TestPhysicalPlanner.java   |  238 +-
 .../tajo/engine/query/TestGroupByQuery.java     |    8 +-
 .../tajo/engine/query/TestSelectQuery.java      |   14 +
 .../apache/tajo/engine/query/TestSortQuery.java |   73 +-
 .../tajo/engine/query/TestTablePartitions.java  |   72 +
 .../apache/tajo/master/TestRepartitioner.java   |  309 +-
 .../tajo/master/ha/TestHAServiceHDFSImpl.java   |  133 +
 .../querymaster/TestIntermediateEntry.java      |   53 +
 .../querymaster/TestQueryUnitStatusUpdate.java  |    6 +-
 .../tajo/scheduler/TestFifoScheduler.java       |   47 +-
 .../org/apache/tajo/worker/TestFetcher.java     |   23 +-
 .../testColumnEqualityButNotJoinCondition1.sql  |    7 +
 .../testColumnEqualityButNotJoinCondition2.sql  |    7 +
 .../TestSortQuery/testSortOnNullColumn.sql      |   13 +
 .../TestSortQuery/testSortOnUnicodeTextAsc.sql  |    6 +
 .../TestSortQuery/testSortOnUnicodeTextDesc.sql |    6 +
 ...estColumnEqualityButNotJoinCondition1.result |    3 +
 ...estColumnEqualityButNotJoinCondition2.result |    6 +
 .../TestSortQuery/testSortOnNullColumn.result   |    6 +
 .../testSortOnUnicodeTextAsc.result             |    6 +
 .../testSortOnUnicodeTextDesc.result            |    6 +
 .../TestTajoCli/testHelpSessionVars.result      |    1 +
 tajo-dist/pom.xml                               |   22 +
 tajo-dist/src/main/bin/start-tajo.sh            |   18 +-
 tajo-dist/src/main/bin/stop-tajo.sh             |   19 +-
 tajo-dist/src/main/bin/tajo                     |   18 +-
 tajo-dist/src/main/bin/tajo-daemons.sh          |    1 +
 tajo-dist/src/main/conf/tajo-env.sh             |   13 +-
 tajo-docs/pom.xml                               |   18 +
 tajo-docs/src/main/sphinx/configuration.rst     |    3 +-
 .../sphinx/configuration/ha_configuration.rst   |  135 +
 tajo-jdbc/pom.xml                               |   13 +-
 .../org/apache/tajo/jdbc/MetaDataTuple.java     |   11 +
 tajo-maven-plugins/pom.xml                      |   12 +
 tajo-project/pom.xml                            |   23 +-
 tajo-rpc/pom.xml                                |   12 +
 tajo-storage/pom.xml                            |   18 +-
 .../tajo/storage/AbstractStorageManager.java    |    1 -
 .../java/org/apache/tajo/storage/Appender.java  |    2 +
 .../org/apache/tajo/storage/FileAppender.java   |    4 +
 .../org/apache/tajo/storage/FrameTuple.java     |   11 +
 .../tajo/storage/HashShuffleAppender.java       |  209 ++
 .../storage/HashShuffleAppenderManager.java     |  225 ++
 .../java/org/apache/tajo/storage/LazyTuple.java |   14 +-
 .../java/org/apache/tajo/storage/RawFile.java   |    1 +
 .../org/apache/tajo/storage/RowStoreUtil.java   |    8 +-
 .../java/org/apache/tajo/storage/Tuple.java     |    5 +
 .../org/apache/tajo/storage/TupleRange.java     |   29 +-
 .../java/org/apache/tajo/storage/VTuple.java    |   11 +
 .../tajo/storage/parquet/ParquetAppender.java   |   15 +-
 .../parquet/InternalParquetRecordWriter.java    |    4 +
 .../thirdparty/parquet/ParquetWriter.java       |    4 +
 .../tajo/storage/TestCompressionStorages.java   |    2 -
 .../tajo/storage/parquet/TestReadWrite.java     |    7 +-
 tajo-thirdparty/asm/pom.xml                     |  180 ++
 .../org/objectweb/asm/AnnotationVisitor.java    |  169 ++
 .../org/objectweb/asm/AnnotationWriter.java     |  318 +++
 .../tajo/org/objectweb/asm/Attribute.java       |  255 ++
 .../tajo/org/objectweb/asm/ByteVector.java      |  312 ++
 .../tajo/org/objectweb/asm/ClassReader.java     | 2202 ++++++++++++++
 .../tajo/org/objectweb/asm/ClassVisitor.java    |  286 ++
 .../tajo/org/objectweb/asm/ClassWriter.java     | 1706 +++++++++++
 .../apache/tajo/org/objectweb/asm/Context.java  |  110 +
 .../org/apache/tajo/org/objectweb/asm/Edge.java |   75 +
 .../tajo/org/objectweb/asm/FieldVisitor.java    |  121 +
 .../tajo/org/objectweb/asm/FieldWriter.java     |  273 ++
 .../apache/tajo/org/objectweb/asm/Frame.java    | 1453 ++++++++++
 .../apache/tajo/org/objectweb/asm/Handle.java   |  170 ++
 .../apache/tajo/org/objectweb/asm/Handler.java  |  121 +
 .../org/apache/tajo/org/objectweb/asm/Item.java |  311 ++
 .../apache/tajo/org/objectweb/asm/Label.java    |  560 ++++
 .../tajo/org/objectweb/asm/MethodVisitor.java   |  662 +++++
 .../tajo/org/objectweb/asm/MethodWriter.java    | 2685 ++++++++++++++++++
 .../apache/tajo/org/objectweb/asm/Opcodes.java  |  358 +++
 .../org/apache/tajo/org/objectweb/asm/Type.java |  895 ++++++
 .../tajo/org/objectweb/asm/attrs/package.html   |   66 +
 .../objectweb/asm/commons/AdviceAdapter.java    |  625 ++++
 .../objectweb/asm/commons/AnalyzerAdapter.java  |  920 ++++++
 .../asm/commons/CodeSizeEvaluator.java          |  217 ++
 .../objectweb/asm/commons/GeneratorAdapter.java | 1641 +++++++++++
 .../asm/commons/InstructionAdapter.java         | 1090 +++++++
 .../asm/commons/JSRInlinerAdapter.java          |  746 +++++
 .../asm/commons/LocalVariablesSorter.java       |  361 +++
 .../tajo/org/objectweb/asm/commons/Method.java  |  282 ++
 .../org/objectweb/asm/commons/Remapper.java     |  223 ++
 .../asm/commons/RemappingAnnotationAdapter.java |   79 +
 .../asm/commons/RemappingClassAdapter.java      |  126 +
 .../asm/commons/RemappingFieldAdapter.java      |   62 +
 .../asm/commons/RemappingMethodAdapter.java     |  161 ++
 .../asm/commons/RemappingSignatureAdapter.java  |  155 +
 .../asm/commons/SerialVersionUIDAdder.java      |  533 ++++
 .../objectweb/asm/commons/SimpleRemapper.java   |   69 +
 .../objectweb/asm/commons/StaticInitMerger.java |   96 +
 .../asm/commons/TableSwitchGenerator.java       |   57 +
 .../asm/commons/TryCatchBlockSorter.java        |   92 +
 .../tajo/org/objectweb/asm/commons/package.html |   66 +
 .../optimizer/AnnotationConstantsCollector.java |  147 +
 .../asm/optimizer/ClassConstantsCollector.java  |  184 ++
 .../objectweb/asm/optimizer/ClassOptimizer.java |  167 ++
 .../org/objectweb/asm/optimizer/Constant.java   |  323 +++
 .../objectweb/asm/optimizer/ConstantPool.java   |  249 ++
 .../asm/optimizer/FieldConstantsCollector.java  |   75 +
 .../objectweb/asm/optimizer/JarOptimizer.java   |  234 ++
 .../asm/optimizer/MethodConstantsCollector.java |  161 ++
 .../asm/optimizer/MethodOptimizer.java          |  167 ++
 .../objectweb/asm/optimizer/NameMapping.java    |  114 +
 .../org/objectweb/asm/optimizer/Shrinker.java   |  283 ++
 .../objectweb/asm/optimizer/jdk1.2.2_017.txt.gz |  Bin 0 -> 113814 bytes
 .../objectweb/asm/optimizer/jdk1.3.1_19.txt.gz  |  Bin 0 -> 128067 bytes
 .../asm/optimizer/shrink-annotations.properties |   71 +
 .../asm/optimizer/shrink-frames.properties      |   80 +
 .../asm/optimizer/shrink-resize.properties      |   55 +
 .../asm/optimizer/shrink-signatures.properties  |   61 +
 .../asm/optimizer/shrink-writer.properties      |   84 +
 .../objectweb/asm/optimizer/shrink.properties   |  372 +++
 .../apache/tajo/org/objectweb/asm/package.html  |  105 +
 .../asm/signature/SignatureReader.java          |  228 ++
 .../asm/signature/SignatureVisitor.java         |  235 ++
 .../asm/signature/SignatureWriter.java          |  227 ++
 .../org/objectweb/asm/signature/package.html    |   54 +
 .../objectweb/asm/tree/AbstractInsnNode.java    |  248 ++
 .../org/objectweb/asm/tree/AnnotationNode.java  |  225 ++
 .../tajo/org/objectweb/asm/tree/ClassNode.java  |  345 +++
 .../org/objectweb/asm/tree/FieldInsnNode.java   |  108 +
 .../tajo/org/objectweb/asm/tree/FieldNode.java  |  243 ++
 .../tajo/org/objectweb/asm/tree/FrameNode.java  |  210 ++
 .../org/objectweb/asm/tree/IincInsnNode.java    |   82 +
 .../org/objectweb/asm/tree/InnerClassNode.java  |  101 +
 .../tajo/org/objectweb/asm/tree/InsnList.java   |  600 ++++
 .../tajo/org/objectweb/asm/tree/InsnNode.java   |   87 +
 .../org/objectweb/asm/tree/IntInsnNode.java     |   87 +
 .../asm/tree/InvokeDynamicInsnNode.java         |  100 +
 .../org/objectweb/asm/tree/JumpInsnNode.java    |   95 +
 .../tajo/org/objectweb/asm/tree/LabelNode.java  |   78 +
 .../org/objectweb/asm/tree/LdcInsnNode.java     |   78 +
 .../org/objectweb/asm/tree/LineNumberNode.java  |   84 +
 .../objectweb/asm/tree/LocalVariableNode.java   |  112 +
 .../asm/tree/LookupSwitchInsnNode.java          |  117 +
 .../org/objectweb/asm/tree/MethodInsnNode.java  |  109 +
 .../tajo/org/objectweb/asm/tree/MethodNode.java |  597 ++++
 .../asm/tree/MultiANewArrayInsnNode.java        |   83 +
 .../objectweb/asm/tree/TableSwitchInsnNode.java |  113 +
 .../objectweb/asm/tree/TryCatchBlockNode.java   |   94 +
 .../org/objectweb/asm/tree/TypeInsnNode.java    |   90 +
 .../org/objectweb/asm/tree/VarInsnNode.java     |   93 +
 .../objectweb/asm/tree/analysis/Analyzer.java   |  549 ++++
 .../asm/tree/analysis/AnalyzerException.java    |   61 +
 .../asm/tree/analysis/BasicInterpreter.java     |  358 +++
 .../objectweb/asm/tree/analysis/BasicValue.java |  111 +
 .../asm/tree/analysis/BasicVerifier.java        |  433 +++
 .../org/objectweb/asm/tree/analysis/Frame.java  |  729 +++++
 .../asm/tree/analysis/Interpreter.java          |  226 ++
 .../asm/tree/analysis/SimpleVerifier.java       |  320 +++
 .../objectweb/asm/tree/analysis/SmallSet.java   |  134 +
 .../asm/tree/analysis/SourceInterpreter.java    |  198 ++
 .../asm/tree/analysis/SourceValue.java          |   97 +
 .../objectweb/asm/tree/analysis/Subroutine.java |   90 +
 .../org/objectweb/asm/tree/analysis/Value.java  |   45 +
 .../objectweb/asm/tree/analysis/package.html    |   85 +
 .../tajo/org/objectweb/asm/tree/package.html    |  210 ++
 .../tajo/org/objectweb/asm/util/ASMifiable.java |   56 +
 .../tajo/org/objectweb/asm/util/ASMifier.java   | 1151 ++++++++
 .../asm/util/CheckAnnotationAdapter.java        |  136 +
 .../objectweb/asm/util/CheckClassAdapter.java   |  914 ++++++
 .../objectweb/asm/util/CheckFieldAdapter.java   |  100 +
 .../objectweb/asm/util/CheckMethodAdapter.java  | 1397 +++++++++
 .../asm/util/CheckSignatureAdapter.java         |  330 +++
 .../tajo/org/objectweb/asm/util/Printer.java    |  500 ++++
 .../org/objectweb/asm/util/Textifiable.java     |   56 +
 .../tajo/org/objectweb/asm/util/Textifier.java  | 1200 ++++++++
 .../asm/util/TraceAnnotationVisitor.java        |   89 +
 .../objectweb/asm/util/TraceClassVisitor.java   |  209 ++
 .../objectweb/asm/util/TraceFieldVisitor.java   |   76 +
 .../objectweb/asm/util/TraceMethodVisitor.java  |  223 ++
 .../asm/util/TraceSignatureVisitor.java         |  317 +++
 .../tajo/org/objectweb/asm/util/package.html    |   58 +
 .../objectweb/asm/xml/ASMContentHandler.java    | 1317 +++++++++
 .../tajo/org/objectweb/asm/xml/Processor.java   | 1044 +++++++
 .../tajo/org/objectweb/asm/xml/SAXAdapter.java  |   89 +
 .../objectweb/asm/xml/SAXAnnotationAdapter.java |  185 ++
 .../org/objectweb/asm/xml/SAXClassAdapter.java  |  324 +++
 .../org/objectweb/asm/xml/SAXCodeAdapter.java   |  362 +++
 .../org/objectweb/asm/xml/SAXFieldAdapter.java  |   63 +
 .../tajo/org/objectweb/asm/xml/asm-xml.dtd      |  367 +++
 .../tajo/org/objectweb/asm/xml/package.html     |  114 +
 tajo-yarn-pullserver/pom.xml                    |   17 +
 .../pullserver/listener/FileCloseListener.java  |   15 +-
 .../pullserver/listener/FileCloseListener.java  |   15 +-
 .../pullserver/listener/FileCloseListener.java  |   15 +-
 .../tajo/pullserver/PullServerAuxService.java   |    2 +-
 .../apache/tajo/pullserver/TajoPullServer.java  |   73 +
 .../tajo/pullserver/TajoPullServerService.java  |  215 +-
 .../java/org/apache/tajo/storage/Tuple.java     |   27 +-
 361 files changed, 54189 insertions(+), 1084 deletions(-)
----------------------------------------------------------------------



[15/19] git commit: Use "Tajo" instead of "tajo"

Posted by bl...@apache.org.
Use "Tajo" instead of "tajo"


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

Branch: refs/heads/master
Commit: e1f2b6b437fdb842166f8cf7a8c8fbf4bce19041
Parents: 327a9c4
Author: Jaehwa Jung <bl...@apache.org>
Authored: Wed Oct 1 14:54:36 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Wed Oct 1 14:54:36 2014 +0900

----------------------------------------------------------------------
 tajo-docs/src/main/sphinx/tsql/intro.rst          | 2 +-
 tajo-docs/src/main/sphinx/tsql/meta_command.rst   | 4 ++--
 tajo-docs/src/main/sphinx/tsql/single_command.rst | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/e1f2b6b4/tajo-docs/src/main/sphinx/tsql/intro.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/intro.rst b/tajo-docs/src/main/sphinx/tsql/intro.rst
index 4ca6d87..e00c97a 100644
--- a/tajo-docs/src/main/sphinx/tsql/intro.rst
+++ b/tajo-docs/src/main/sphinx/tsql/intro.rst
@@ -18,7 +18,7 @@ Options
 * ``-f filename (--file filename)`` : Use the file named filename as the source of commands instead of interactive shell.
 * ``-h hostname (--host hostname)`` : Specifies the host name of the machine on which the Tajo master is running.
 * ``-p port (--port port)`` : Specifies the TCP port. If it is not set, the port will be 26002 by default.
-* ``-conf configuration (--conf configuration)`` : Setting tajo configuration value.
+* ``-conf configuration (--conf configuration)`` : Setting Tajo configuration value.
 * ``-param parameter (--param parameter)`` : Use a parameter value in SQL file.
 * ``-B (--background)`` : Execute as background process.
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/e1f2b6b4/tajo-docs/src/main/sphinx/tsql/meta_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/meta_command.rst b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
index 648041c..1b7eac2 100644
--- a/tajo-docs/src/main/sphinx/tsql/meta_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
@@ -32,7 +32,7 @@ In the current implementation, there are meta commands as follows: ::
   Tool
     \!           execute a linux shell command
     \dfs         execute a dfs command
-    \admin       execute tajo admin command
+    \admin       execute Tajo admin command
 
 
   Variables
@@ -319,4 +319,4 @@ The prompt ``default>`` indicates the current database. Basically, all SQL state
   Description: Round to s decimalN places.
   Example:
   > SELECT round(42.4382, 2)
-  42.44
\ No newline at end of file
+  42.44

http://git-wip-us.apache.org/repos/asf/tajo/blob/e1f2b6b4/tajo-docs/src/main/sphinx/tsql/single_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/single_command.rst b/tajo-docs/src/main/sphinx/tsql/single_command.rst
index ae0a6ae..fc28202 100644
--- a/tajo-docs/src/main/sphinx/tsql/single_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/single_command.rst
@@ -4,7 +4,7 @@ Executing a single command
 
 
 You may want to run more queries without entering tsql prompt. Tsql provides the -c argument for above
-requirement. And tajo assumes that queries are separated by semicolon as follows:
+requirement. And Tajo assumes that queries are separated by semicolon as follows:
 
 .. code-block:: sql
 
@@ -22,4 +22,4 @@ requirement. And tajo assumes that queries are separated by semicolon as follows
   ?sum
   -------------------------------
   15.0
-  (1 rows, 0.345 sec, 5 B selected)
\ No newline at end of file
+  (1 rows, 0.345 sec, 5 B selected)


[02/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: 415d0867ae4a4543f47360294bead1fc7f41e292
Parents: 7c98709 912df6f
Author: Jaehwa Jung <bl...@apache.org>
Authored: Sun Aug 10 15:07:24 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Sun Aug 10 15:07:24 2014 +0900

----------------------------------------------------------------------
 .../main/java/org/apache/tajo/cli/TajoCli.java  |   3 +-
 .../org/apache/tajo/cli/TajoGetConfCommand.java |  57 +++++++
 .../java/org/apache/tajo/client/TajoAdmin.java  |  16 ++
 .../org/apache/tajo/client/TajoGetConf.java     | 171 +++++++++++++++++++
 .../java/org/apache/tajo/cli/TestTajoCli.java   |  31 ++++
 tajo-dist/src/main/bin/tajo                     |   5 +
 6 files changed, 282 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[17/19] git commit: Rename cli.rst to tsql.rst

Posted by bl...@apache.org.
Rename cli.rst to tsql.rst


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

Branch: refs/heads/master
Commit: 28b4cbc036b05a109694e1dcbaeacd802d0c9f71
Parents: b6c0613
Author: Jaehwa Jung <bl...@apache.org>
Authored: Sun Oct 5 22:15:27 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Sun Oct 5 22:15:27 2014 +0900

----------------------------------------------------------------------
 tajo-docs/src/main/sphinx/cli.rst   | 18 ------------------
 tajo-docs/src/main/sphinx/index.rst |  2 +-
 tajo-docs/src/main/sphinx/tsql.rst  | 18 ++++++++++++++++++
 3 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/28b4cbc0/tajo-docs/src/main/sphinx/cli.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/cli.rst b/tajo-docs/src/main/sphinx/cli.rst
deleted file mode 100644
index 2bb500c..0000000
--- a/tajo-docs/src/main/sphinx/cli.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-*****************************
-Command-line Interface
-*****************************
-
-Tajo provides a shell utility named Tsql. It is a command-line interface (CLI) where users can create or drop tables, inspect schema and query tables, etc.
-
-.. toctree::
-  :maxdepth: 1
-
-  tsql/intro
-  tsql/single_command
-  tsql/execute_file
-  tsql/background_command
-  tsql/meta_command
-  tsql/dfs_command
-  tsql/variables
-  tsql/admin_command
-

http://git-wip-us.apache.org/repos/asf/tajo/blob/28b4cbc0/tajo-docs/src/main/sphinx/index.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/index.rst b/tajo-docs/src/main/sphinx/index.rst
index e6c26df..bca4053 100644
--- a/tajo-docs/src/main/sphinx/index.rst
+++ b/tajo-docs/src/main/sphinx/index.rst
@@ -31,7 +31,7 @@ Table of Contents:
    introduction
    getting_started
    configuration
-   cli
+   tsql
    sql_language
    functions
    table_management

http://git-wip-us.apache.org/repos/asf/tajo/blob/28b4cbc0/tajo-docs/src/main/sphinx/tsql.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql.rst b/tajo-docs/src/main/sphinx/tsql.rst
new file mode 100644
index 0000000..86ffef2
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql.rst
@@ -0,0 +1,18 @@
+*****************************
+Tajo Shell (TSQL)
+*****************************
+
+Tajo provides a shell utility named Tsql. It is a command-line interface (CLI) where users can create or drop tables, inspect schema and query tables, etc.
+
+.. toctree::
+  :maxdepth: 1
+
+  tsql/intro
+  tsql/single_command
+  tsql/execute_file
+  tsql/background_command
+  tsql/meta_command
+  tsql/dfs_command
+  tsql/variables
+  tsql/admin_command
+


[07/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: 05c892448113db40daef54d2e06dad463dbae9c8
Parents: b33a945 604eb32
Author: Jaehwa Jung <bl...@apache.org>
Authored: Thu Sep 11 11:33:54 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Thu Sep 11 11:33:54 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         | 13 +++
 .../main/java/org/apache/tajo/cli/TajoCli.java  | 23 +++--
 .../org/apache/tajo/cli/VersionCommand.java     |  4 +-
 .../org/apache/tajo/jdbc/TajoResultSet.java     |  2 +-
 .../java/org/apache/tajo/TajoConstants.java     |  1 -
 .../java/org/apache/tajo/conf/TajoConf.java     |  8 +-
 .../java/org/apache/tajo/master/TajoMaster.java |  4 +-
 .../java/org/apache/tajo/worker/TajoWorker.java |  2 +-
 .../org/apache/tajo/TajoTestingCluster.java     |  1 -
 .../java/org/apache/tajo/jdbc/TestTajoJdbc.java | 95 +++++++++++++++++++-
 tajo-dist/src/main/bin/tajo-daemon.sh           |  1 +
 tajo-dist/src/main/conf/tajo-env.sh             |  2 +-
 .../org/apache/tajo/jdbc/TajoConnection.java    |  8 +-
 .../apache/tajo/jdbc/TajoDatabaseMetaData.java  |  4 +-
 .../apache/tajo/jdbc/TajoPreparedStatement.java | 16 +++-
 .../org/apache/tajo/jdbc/TajoStatement.java     | 76 +++++++++++++++-
 .../apache/tajo/pullserver/TajoPullServer.java  |  2 +-
 .../tajo/pullserver/TajoPullServerService.java  | 51 ++++++-----
 18 files changed, 249 insertions(+), 64 deletions(-)
----------------------------------------------------------------------



[16/19] git commit: Update some comments.

Posted by bl...@apache.org.
Update some comments.


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

Branch: refs/heads/master
Commit: b6c06138e756823daebf188174e63bead43c0c05
Parents: e1f2b6b
Author: Jaehwa Jung <bl...@apache.org>
Authored: Wed Oct 1 15:25:43 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Wed Oct 1 15:25:43 2014 +0900

----------------------------------------------------------------------
 tajo-docs/src/main/sphinx/cli.rst               |   2 +-
 .../src/main/sphinx/tsql/background_command.rst |  29 ++++
 tajo-docs/src/main/sphinx/tsql/dfs_command.rst  |  12 +-
 tajo-docs/src/main/sphinx/tsql/execute_file.rst |   2 +-
 tajo-docs/src/main/sphinx/tsql/meta_command.rst | 174 +------------------
 .../src/main/sphinx/tsql/single_command.rst     |   3 +-
 6 files changed, 39 insertions(+), 183 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/cli.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/cli.rst b/tajo-docs/src/main/sphinx/cli.rst
index 5fd2461..2bb500c 100644
--- a/tajo-docs/src/main/sphinx/cli.rst
+++ b/tajo-docs/src/main/sphinx/cli.rst
@@ -10,7 +10,7 @@ Tajo provides a shell utility named Tsql. It is a command-line interface (CLI) w
   tsql/intro
   tsql/single_command
   tsql/execute_file
-  tsql/back_command
+  tsql/background_command
   tsql/meta_command
   tsql/dfs_command
   tsql/variables

http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/background_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/background_command.rst b/tajo-docs/src/main/sphinx/tsql/background_command.rst
new file mode 100644
index 0000000..755405b
--- /dev/null
+++ b/tajo-docs/src/main/sphinx/tsql/background_command.rst
@@ -0,0 +1,29 @@
+*********************************
+Executing as background process
+*********************************
+
+
+If you execute tsql as a background process, tsql will exit before executing a query because of some limitation of Jline2.
+
+Example: 
+
+ .. code-block:: sql
+
+  $ bin/tsql  -f aggregation.sql &
+  [1] 19303
+  $
+  [1]+  Stopped                 ./bin/tsql -f aggregation.sql
+
+
+To avoid above problem, Tajo provides the -B command as follows:
+
+.. code-block:: sql
+
+  $ bin/tsql  -B -f aggregation.sql &
+    [2] 19419
+    Progress: 0%, response time: 0.218 sec
+    Progress: 0%, response time: 0.22 sec
+    Progress: 0%, response time: 0.421 sec
+    Progress: 0%, response time: 0.823 sec
+    Progress: 0%, response time: 1.425 sec
+    Progress: 1%, response time: 2.227 sec

http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/dfs_command.rst b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
index e261159..d26c501 100644
--- a/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst
@@ -2,25 +2,25 @@
 Executing HDFS commands
 *********************************
 
-You can run the hadoop dfs command(FsShell) within tsql. ``\dfs`` command provides a shortcut to the hadoop dfs commands. If you want to use this command, just specify FsShell arguments and add the semicolon at the end as follows:
+You can run the hadoop dfs command (FsShell) within tsql. ``\dfs`` command provides a shortcut to the hadoop dfs commands. If you want to use this command, just specify FsShell arguments and add the semicolon at the end as follows:
 
 .. code-block:: sql
 
-  default> \dfs -ls /;
+  default> \dfs -ls /
   Found 3 items
   drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:04 /tajo
   drwxr-xr-x   - tajo supergroup          0 2014-09-04 02:20 /tmp
   drwxr-xr-x   - tajo supergroup          0 2014-09-16 13:41 /user
 
-  default> \dfs -ls /tajo;
+  default> \dfs -ls /tajo
   Found 2 items
   drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:04 /tajo/system
   drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:15 /tajo/warehouse
 
-  default> \dfs -mkdir /tajo/temp;
+  default> \dfs -mkdir /tajo/temp
 
-  default> \dfs -ls /tajo;
+  default> \dfs -ls /tajo
   Found 3 items
   drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:04 /tajo/system
   drwxr-xr-x   - tajo supergroup          0 2014-09-23 06:48 /tajo/temp
-  drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:15 /tajo/warehouse
\ No newline at end of file
+  drwxr-xr-x   - tajo supergroup          0 2014-08-14 04:15 /tajo/warehouse

http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/execute_file.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/execute_file.rst b/tajo-docs/src/main/sphinx/tsql/execute_file.rst
index a513973..c791ad8 100644
--- a/tajo-docs/src/main/sphinx/tsql/execute_file.rst
+++ b/tajo-docs/src/main/sphinx/tsql/execute_file.rst
@@ -8,7 +8,7 @@ Basic usages
 -----------------------------------------------
 
 
-Tajo can execute more queries that were saved to a file using the -f file argument as follows:
+``-f`` command allows tsql to execute more than one SQL statements stored in a text file as follows:
 
 .. code-block:: sql
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/meta_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/meta_command.rst b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
index 1b7eac2..1c92f4e 100644
--- a/tajo-docs/src/main/sphinx/tsql/meta_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/meta_command.rst
@@ -116,184 +116,12 @@ The prompt ``default>`` indicates the current database. Basically, all SQL state
    abs             | FLOAT8          | FLOAT8                | Absolute value                                | GENERAL
    acos            | FLOAT8          | FLOAT4                | Inverse cosine.                               | GENERAL
    acos            | FLOAT8          | FLOAT8                | Inverse cosine.                               | GENERAL
-   add_days        | TIMESTAMP       | DATE,INT2             | Return date value which is added with given pa| GENERAL
-   add_days        | TIMESTAMP       | DATE,INT4             | Return date value which is added with given pa| GENERAL
-   add_days        | TIMESTAMP       | DATE,INT8             | Return date value which is added with given pa| GENERAL
-   add_days        | TIMESTAMP       | TIMESTAMP,INT2        | Return date value which is added with given pa| GENERAL
-   add_days        | TIMESTAMP       | TIMESTAMP,INT4        | Return date value which is added with given pa| GENERAL
-   add_days        | TIMESTAMP       | TIMESTAMP,INT8        | Return date value which is added with given pa| GENERAL
-   add_months      | TIMESTAMP       | DATE,INT2             | Return date value which is added with given pa| GENERAL
-   add_months      | TIMESTAMP       | DATE,INT4             | Return date value which is added with given pa| GENERAL
-   add_months      | TIMESTAMP       | DATE,INT8             | Return date value which is added with given pa| GENERAL
-   add_months      | TIMESTAMP       | TIMESTAMP,INT2        | Return date value which is added with given pa| GENERAL
-   add_months      | TIMESTAMP       | TIMESTAMP,INT4        | Return date value which is added with given pa| GENERAL
-   add_months      | TIMESTAMP       | TIMESTAMP,INT8        | Return date value which is added with given pa| GENERAL
-   ascii           | INT4            | TEXT                  | ASCII code of the first character of the argum| GENERAL
-   asin            | FLOAT8          | FLOAT4                | Inverse sine.                                 | GENERAL
-   asin            | FLOAT8          | FLOAT8                | Inverse sine.                                 | GENERAL
-   atan            | FLOAT8          | FLOAT4                | Inverse tangent.                              | GENERAL
-   atan            | FLOAT8          | FLOAT8                | Inverse tangent.                              | GENERAL
-   atan2           | FLOAT8          | FLOAT4,FLOAT4         | Inverse tangent of y/x.                       | GENERAL
-   atan2           | FLOAT8          | FLOAT8,FLOAT8         | Inverse tangent of y/x.                       | GENERAL
-   avg             | FLOAT8          | INT8                  | the mean of a set of numbers                  | AGGREGATIO
-   avg             | FLOAT8          | FLOAT4                | The mean of a set of numbers.                 | AGGREGATIO
-   avg             | FLOAT8          | INT4                  | the mean of a set of numbers.                 | AGGREGATIO
-   avg             | FLOAT8          | FLOAT8                | The mean of a set of numbers.                 | AGGREGATIO
-   bit_length      | INT4            | TEXT                  | Number of bits in string                      | GENERAL
-   btrim           | TEXT            | TEXT                  |  Remove the longest string consisting only of | GENERAL
-   btrim           | TEXT            | TEXT,TEXT             |  Remove the longest string consisting only of | GENERAL
-   cbrt            | FLOAT8          | FLOAT4                | Cube root                                     | GENERAL
-   cbrt            | FLOAT8          | FLOAT8                | Cube root                                     | GENERAL
-   ceil            | INT8            | FLOAT4                | Smallest integer not less than argument.      | GENERAL
-   ceil            | INT8            | FLOAT8                | Smallest integer not less than argument.      | GENERAL
-   ceiling         | INT8            | FLOAT4                | Smallest integer not less than argument.      | GENERAL
-   ceiling         | INT8            | FLOAT8                | Smallest integer not less than argument.      | GENERAL
-   char_length     | INT4            | TEXT                  | Number of characters in string                | GENERAL
-   character_length| INT4            | TEXT                  | Number of characters in string                | GENERAL
-   chr             | CHAR            | INT4                  | Character with the given code.                | GENERAL
-   coalesce        | BOOLEAN         | BOOLEAN,BOOLEAN_ARRAY | Returns the first of its arguments that is not| GENERAL
-   coalesce        | INT8            | INT8_ARRAY            | Returns the first of its arguments that is not| GENERAL
-   coalesce        | FLOAT8          | FLOAT8_ARRAY          | Returns the first of its arguments that is not| GENERAL
-   coalesce        | TEXT            | TEXT_ARRAY            | Returns the first of its arguments that is not| GENERAL
-   coalesce        | DATE            | DATE_ARRAY            | Returns the first of its arguments that is not| GENERAL
-   coalesce        | TIME            | TIME_ARRAY            | Returns the first of its arguments that is not| GENERAL
-   coalesce        | TIMESTAMP       | TIMESTAMP_ARRAY       | Returns the first of its arguments that is not| GENERAL
-   concat          | TEXT            | TEXT,TEXT_ARRAY       | Concatenate all arguments.                    | GENERAL
-   concat_ws       | TEXT            | TEXT,TEXT,TEXT_ARRAY  | Concatenate all but first arguments with separ| GENERAL
-   cos             | FLOAT8          | FLOAT4                | Cosine.                                       | GENERAL
-   cos             | FLOAT8          | FLOAT8                | Cosine.                                       | GENERAL
-   count           | INT8            | ANY                   |  The number of rows for which the supplied exp| DISTINCT_A
-   count           | INT8            |                       | the total number of retrieved rows            | AGGREGATIO
-   count           | INT8            | ANY                   | The number of retrieved rows for which the sup| AGGREGATIO
-   current_date    | DATE            |                       | Get current date. Result is DATE type.        | GENERAL
-   current_time    | TIME            |                       | Get current time. Result is TIME type.        | GENERAL
-   date            | INT8            | INT4                  | Extracts the date part of the date or datetime| GENERAL
-   date_part       | FLOAT8          | TEXT,TIME             | Extract field from time                       | GENERAL
-   date_part       | FLOAT8          | TEXT,TIMESTAMP        | Extract field from timestamp                  | GENERAL
-   date_part       | FLOAT8          | TEXT,DATE             | Extract field from date                       | GENERAL
-   decode          | TEXT            | TEXT,TEXT             | Decode binary data from textual representation| GENERAL
-   degrees         | FLOAT8          | FLOAT4                | Radians to degrees                            | GENERAL
-   degrees         | FLOAT8          | FLOAT8                | Radians to degrees                            | GENERAL
-   digest          | TEXT            | TEXT,TEXT             | Calculates the Digest hash of string          | GENERAL
-   div             | INT8            | INT8,INT8             | Division(integer division truncates results)  | GENERAL
-   div             | INT8            | INT8,INT4             | Division(integer division truncates results)  | GENERAL
-   div             | INT8            | INT4,INT8             | Division(integer division truncates results)  | GENERAL
-   div             | INT8            | INT4,INT4             | Division(integer division truncates results)  | GENERAL
-   encode          | TEXT            | TEXT,TEXT             | Encode binary data into a textual representati| GENERAL
-   exp             | FLOAT8          | FLOAT4                | Exponential                                   | GENERAL
-   exp             | FLOAT8          | FLOAT8                | Exponential                                   | GENERAL
-   find_in_set     | INT4            | TEXT,TEXT             | Returns the first occurrence of str in str_arr| GENERAL
-   floor           | INT8            | FLOAT4                |  Largest integer not greater than argument.   | GENERAL
-   floor           | INT8            | FLOAT8                |  Largest integer not greater than argument.   | GENERAL
-   geoip_country_co| TEXT            | TEXT                  | Convert an ipv4 address string to a geoip coun| GENERAL
-   geoip_country_co| TEXT            | INET4                 | Convert an ipv4 address to a geoip country cod| GENERAL
-   geoip_in_country| BOOLEAN         | TEXT,TEXT             | If the given country code is same with the cou| GENERAL
-   geoip_in_country| BOOLEAN         | INET4,TEXT            | If the given country code is same with the cou| GENERAL
-   initcap         | TEXT            | TEXT                  | Convert the first letter of each word to upper| GENERAL
-   left            | TEXT            | TEXT,INT4             | First n characters in the string.             | GENERAL
-   length          | INT4            | TEXT                  | Number of characters in string.               | GENERAL
-   locate          | INT4            | TEXT,TEXT             | Location of specified substring               | GENERAL
-   locate          | INT4            | TEXT,TEXT,INT4        | Location of specified substring               | GENERAL
-   lower           | TEXT            | TEXT                  | Convert string to lower case                  | GENERAL
-   lpad            | TEXT            | TEXT,INT4             | Fill up the string to length length by prepend| GENERAL
-   lpad            | TEXT            | TEXT,INT4,TEXT        | Fill up the string to length length by prepend| GENERAL
-   ltrim           | TEXT            | TEXT                  | Remove the longest string containing only char| GENERAL
-   ltrim           | TEXT            | TEXT,TEXT             | Remove the longest string containing only char| GENERAL
-   max             | INT4            | INT4                  | the maximum value of expr                     | AGGREGATIO
-   max             | INT8            | INT8                  | the maximum value of expr                     | AGGREGATIO
-   max             | FLOAT4          | FLOAT4                | the maximum value of expr                     | AGGREGATIO
-   max             | FLOAT8          | FLOAT8                | the maximum value of expr                     | AGGREGATIO
-   max             | TEXT            | TEXT                  | the maximum value of expr                     | AGGREGATIO
-   md5             | TEXT            | TEXT                  | Calculates the MD5 hash of string             | GENERAL
-   min             | INT4            | INT4                  | the minimum value of expr                     | AGGREGATIO
-   min             | INT8            | INT8                  | the minimum value of expr                     | AGGREGATIO
-   min             | FLOAT4          | FLOAT4                | the minimum value of expr                     | AGGREGATIO
-   min             | FLOAT8          | FLOAT8                | the minimum value of expr                     | AGGREGATIO
-   min             | TEXT            | TEXT                  | the minimum value of expr                     | AGGREGATIO
-   mod             | INT8            | INT8,INT8             | Remainder of y/x                              | GENERAL
-   mod             | INT8            | INT8,INT4             | Remainder of y/x                              | GENERAL
-   mod             | INT8            | INT4,INT8             | Remainder of y/x                              | GENERAL
-   mod             | INT8            | INT4,INT4             | Remainder of y/x                              | GENERAL
-   now             | TIMESTAMP       |                       | Get current time. Result is TIMESTAMP type.   | GENERAL
-   octet_length    | INT4            | TEXT                  | Number of bytes in string.                    | GENERAL
-   pi              | FLOAT8          |                       | "??" constant                                  | GENERAL
-   pow             | FLOAT8          | FLOAT4,FLOAT4         | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | FLOAT4,FLOAT8         | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | FLOAT8,FLOAT4         | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | FLOAT8,FLOAT8         | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT4,INT4             | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT4,INT8             | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT8,INT4             | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT8,INT8             | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT4,FLOAT4           | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT4,FLOAT8           | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT8,FLOAT4           | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | INT8,FLOAT8           | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | FLOAT4,INT4           | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | FLOAT4,INT8           | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | FLOAT8,INT4           | x raised to the power of y                    | GENERAL
-   pow             | FLOAT8          | FLOAT8,INT8           | x raised to the power of y                    | GENERAL
-   quote_ident     | TEXT            | TEXT                  | Return the given string suitably quoted to be | GENERAL
-   radians         | FLOAT8          | FLOAT8                | Degrees to radians                            | GENERAL
-   radians         | FLOAT8          | FLOAT4                | Degrees to radians                            | GENERAL
-   random          | INT4            | INT4                  | A pseudorandom number                         | GENERAL
-   rank            | INT8            |                       |  The number of rows for which the supplied exp| WINDOW
-   regexp_replace  | TEXT            | TEXT,TEXT,TEXT        |  Replace substring(s) matching a POSIX regular| GENERAL
-   repeat          | TEXT            | TEXT,INT4             | Repeat string the specified number of times.  | GENERAL
-   reverse         | TEXT            | TEXT                  | Reverse str                                   | GENERAL
-   right           | TEXT            | TEXT,INT4             | Last n characters in the string               | GENERAL
-   round           | INT8            | FLOAT4                | Round to nearest integer.                     | GENERAL
-   round           | INT8            | FLOAT8                | Round to nearest integer.                     | GENERAL
-   round           | INT8            | INT4                  | Round to nearest integer.                     | GENERAL
-   round           | INT8            | INT8                  | Round to nearest integer.                     | GENERAL
-   round           | FLOAT8          | FLOAT8,INT4           | Round to s decimalN places.                   | GENERAL
-   round           | FLOAT8          | INT8,INT4             | Round to s decimalN places.                   | GENERAL
-   row_number      | INT8            |                       | the total number of retrieved rows            | WINDOW
-   rpad            | TEXT            | TEXT,INT4             | Fill up the string to length length by appendi| GENERAL
-   rpad            | TEXT            | TEXT,INT4,TEXT        | Fill up the string to length length by appendi| GENERAL
-   rtrim           | TEXT            | TEXT                  | Remove the longest string containing only  cha| GENERAL
-   rtrim           | TEXT            | TEXT,TEXT             | Remove the longest string containing only  cha| GENERAL
-   sign            | FLOAT8          | FLOAT8                | sign of the argument (-1, 0, +1)              | GENERAL
-   sign            | FLOAT8          | FLOAT4                | sign of the argument (-1, 0, +1)              | GENERAL
-   sign            | FLOAT8          | INT8                  | sign of the argument (-1, 0, +1)              | GENERAL
-   sign            | FLOAT8          | INT4                  | sign of the argument (-1, 0, +1)              | GENERAL
-   sin             | FLOAT8          | FLOAT4                | Sine.                                         | GENERAL
-   sin             | FLOAT8          | FLOAT8                | Sine.                                         | GENERAL
-   sleep           | INT4            | INT4                  | sleep for seconds                             | GENERAL
-   split_part      | TEXT            | TEXT,TEXT,INT4        | Split string on delimiter and return the given| GENERAL
-   sqrt            | FLOAT8          | FLOAT8                | Square root                                   | GENERAL
-   sqrt            | FLOAT8          | FLOAT4                | Square root                                   | GENERAL
-   strpos          | INT4            | TEXT,TEXT             | Location of specified substring.              | GENERAL
-   strposb         | INT4            | TEXT,TEXT             | Binary location of specified substring.       | GENERAL
-   substr          | TEXT            | TEXT,INT4             | Extract substring.                            | GENERAL
-   substr          | TEXT            | TEXT,INT4,INT4        | Extract substring.                            | GENERAL
-   sum             | INT8            | INT8                  | the sum of a distinct and non-null values     | DISTINCT_A
-   sum             | INT8            | INT8                  | the sum of a set of numbers                   | AGGREGATIO
-   sum             | INT8            | INT4                  | the sum of a set of numbers                   | AGGREGATIO
-   sum             | INT8            | INT4                  | the sum of a distinct and non-null values     | DISTINCT_A
-   sum             | FLOAT8          | FLOAT8                | the sum of a set of numbers                   | AGGREGATIO
-   sum             | FLOAT8          | FLOAT4                | the sum of a set of numbers                   | AGGREGATIO
-   sum             | FLOAT8          | FLOAT4                | the sum of a distinct and non-null values     | DISTINCT_A
-   sum             | FLOAT8          | FLOAT8                | the sum of a distinct and non-null values     | DISTINCT_A
-   tan             | FLOAT8          | FLOAT4                | Tangent.                                      | GENERAL
-   tan             | FLOAT8          | FLOAT8                | Tangent.                                      | GENERAL
-   to_bin          | TEXT            | INT8                  | Returns n in binary.                          | GENERAL
-   to_bin          | TEXT            | INT4                  | Returns n in binary.                          | GENERAL
-   to_char         | TEXT            | TIMESTAMP,TEXT        | Convert time stamp to string. Format should be| GENERAL
-   to_date         | DATE            | TEXT,TEXT             | Convert string to date. Format should be a SQL| GENERAL
-   to_hex          | TEXT            | INT4                  | Convert the argument to hexadecimal           | GENERAL
-   to_hex          | TEXT            | INT8                  | Convert the argument to hexadecimal           | GENERAL
-   to_timestamp    | TIMESTAMP       | TEXT,TEXT             | Convert string to time stamp                  | GENERAL
-   to_timestamp    | TIMESTAMP       | INT4                  | Convert UNIX epoch to time stamp              | GENERAL
-   to_timestamp    | TIMESTAMP       | INT8                  | Convert UNIX epoch to time stamp              | GENERAL
-   trim            | TEXT            | TEXT                  |  Remove the longest string consisting only of | GENERAL
-   trim            | TEXT            | TEXT,TEXT             |  Remove the longest string consisting only of | GENERAL
-   upper           | TEXT            | TEXT                  | Convert string to upper case.                 | GENERAL
    utc_usec_to     | INT8            | TEXT,INT8             | Extract field from time                       | GENERAL
    utc_usec_to     | INT8            | TEXT,INT8,INT4        | Extract field from time                       | GENERAL
 
   (181) rows
 
+  For Reference, many details have been omitted in order to present a clear picture of the process.
 
 ``\df [function name]`` command also shows a function description as follows: ::
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/single_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/single_command.rst b/tajo-docs/src/main/sphinx/tsql/single_command.rst
index fc28202..21eb10d 100644
--- a/tajo-docs/src/main/sphinx/tsql/single_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/single_command.rst
@@ -3,8 +3,7 @@ Executing a single command
 *********************************
 
 
-You may want to run more queries without entering tsql prompt. Tsql provides the -c argument for above
-requirement. And Tajo assumes that queries are separated by semicolon as follows:
+You may want to run more queries without entering tsql prompt. Tsql provides the ``-c`` argument for above requirement. And Tajo assumes that queries are separated by semicolon as follows:
 
 .. code-block:: sql
 


[14/19] git commit: Rename back_command.rst

Posted by bl...@apache.org.
Rename back_command.rst


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

Branch: refs/heads/master
Commit: 327a9c4edd5426521b86afac12dbab4640a7164a
Parents: 706be64
Author: Jaehwa Jung <bl...@apache.org>
Authored: Wed Oct 1 14:51:24 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Wed Oct 1 14:51:24 2014 +0900

----------------------------------------------------------------------
 .../src/main/sphinx/tsql/admin_command.rst      |  4 +--
 tajo-docs/src/main/sphinx/tsql/back_command.rst | 28 --------------------
 2 files changed, 2 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/327a9c4e/tajo-docs/src/main/sphinx/tsql/admin_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/admin_command.rst b/tajo-docs/src/main/sphinx/tsql/admin_command.rst
index 1a3e90e..5141dc6 100644
--- a/tajo-docs/src/main/sphinx/tsql/admin_command.rst
+++ b/tajo-docs/src/main/sphinx/tsql/admin_command.rst
@@ -7,7 +7,7 @@ Administration Commands
 Synopsis
 ==========
 
-Tsql provides commands for administrator as follows:
+Tsql provides administration commands as follows:
 
 .. code-block:: sql
 
@@ -57,4 +57,4 @@ Basic usages
 ``-showmasters`` option shows a list of all tajo masters as follows: ::
 
   default> \admin -showmasters
-  grtajo01
\ No newline at end of file
+  grtajo01

http://git-wip-us.apache.org/repos/asf/tajo/blob/327a9c4e/tajo-docs/src/main/sphinx/tsql/back_command.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql/back_command.rst b/tajo-docs/src/main/sphinx/tsql/back_command.rst
deleted file mode 100644
index ad46f26..0000000
--- a/tajo-docs/src/main/sphinx/tsql/back_command.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-*********************************
-Executing as background process
-*********************************
-
-
-If you execute tsql as a background process, tsql will exit before executing a query because of jconsole architecture as
-follows:
-
- .. code-block:: sql
-
-  $ bin/tsql  -f aggregation.sql &
-  [1] 19303
-  $
-  [1]+  Stopped                 ./bin/tsql -f aggregation.sql
-
-
-To avoid above problem, tajo provides the -B command as follows:
-
-.. code-block:: sql
-
-  $ bin/tsql  -B -f aggregation.sql &
-    [2] 19419
-    Progress: 0%, response time: 0.218 sec
-    Progress: 0%, response time: 0.22 sec
-    Progress: 0%, response time: 0.421 sec
-    Progress: 0%, response time: 0.823 sec
-    Progress: 0%, response time: 1.425 sec
-    Progress: 1%, response time: 2.227 sec
\ No newline at end of file


[03/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: 7a7b4fd26f61df89cacdb4fc41faf9c2abe456b2
Parents: 415d086 fcc5da0
Author: Jaehwa Jung <bl...@apache.org>
Authored: Mon Aug 11 11:28:48 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Mon Aug 11 11:28:48 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |  5 ++
 .../function/builtin/CountValueDistinct.java    |  4 +-
 .../tajo/master/querymaster/Repartitioner.java  |  1 +
 .../java/org/apache/tajo/worker/FetchImpl.java  | 23 +++++++++
 .../tajo/engine/query/TestGroupByQuery.java     | 46 +++++++++++------
 .../apache/tajo/master/TestRepartitioner.java   | 52 +++++++++++++++-----
 .../testDistinctAggregationCaseByCase3.sql      |  8 +++
 .../testDistinctAggregationCaseByCase4.sql      |  7 +++
 .../testDistinctAggregationCaseByCase3.result   |  3 ++
 .../testDistinctAggregationCaseByCase4.result   |  3 ++
 10 files changed, 125 insertions(+), 27 deletions(-)
----------------------------------------------------------------------



[05/19] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo

Posted by bl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo


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

Branch: refs/heads/master
Commit: aa01e83859ef553ac4eb90c1678e3bc6be20c6c9
Parents: 45f5ed3 96b6c2a
Author: Jaehwa Jung <bl...@apache.org>
Authored: Mon Aug 18 18:56:24 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Mon Aug 18 18:56:24 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |  21 +++
 LICENSE                                         |  25 +++
 NOTICE                                          |   6 +
 .../main/java/org/apache/tajo/cli/TajoCli.java  |  10 +-
 .../java/org/apache/tajo/client/TajoAdmin.java  |   2 +-
 .../java/org/apache/tajo/client/TajoClient.java |  26 +++-
 tajo-common/pom.xml                             |  15 ++
 .../java/org/apache/tajo/datum/TextDatum.java   |   8 +-
 .../java/org/apache/tajo/unit/StorageUnit.java  |   2 +-
 .../org/apache/tajo/datum/TestTextDatum.java    |  36 ++++-
 .../org/apache/tajo/engine/eval/BinaryEval.java |  14 +-
 .../apache/tajo/engine/eval/EvalTreeUtil.java   |  23 ++-
 .../apache/tajo/engine/eval/FunctionEval.java   |   6 +-
 .../eval/EvalTreeOptimizationRule.java          |  27 ++++
 .../optimizer/eval/EvalTreeOptimizer.java       |  76 +++++++++
 .../tajo/engine/optimizer/eval/Prioritized.java |  30 ++++
 .../optimizer/eval/rules/ConstantFolding.java   |  92 +++++++++++
 .../eval/rules/ConstantPropagation.java         | 112 ++++++++++++++
 .../tajo/engine/planner/ExprAnnotator.java      |  12 +-
 .../tajo/engine/planner/ExprNormalizer.java     |   2 +-
 .../apache/tajo/engine/planner/LogicalPlan.java |  56 ++++++-
 .../engine/planner/LogicalPlanPreprocessor.java | 120 +++++++--------
 .../tajo/engine/planner/LogicalPlanner.java     | 154 ++++++++++++-------
 .../tajo/engine/planner/NamedExprsManager.java  |  15 +-
 .../apache/tajo/engine/planner/PlannerUtil.java |   2 +-
 .../tajo/engine/planner/TypeDeterminant.java    |  41 ++---
 .../planner/rewrite/ProjectionPushDownRule.java |   2 +-
 .../apache/tajo/master/querymaster/Query.java   |  25 ++-
 .../tajo/master/querymaster/QueryMaster.java    |  14 ++
 .../master/querymaster/QueryMasterTask.java     |   4 +-
 .../tajo/master/querymaster/SubQuery.java       |  85 ++++++----
 .../tajo/worker/TajoResourceAllocator.java      |   2 +-
 .../tajo/worker/TajoWorkerClientService.java    |  12 +-
 .../org/apache/tajo/client/TestTajoClient.java  |   2 +-
 .../tajo/engine/eval/TestEvalTreeUtil.java      |  14 +-
 .../tajo/engine/planner/TestLogicalPlan.java    |  34 +---
 .../tajo/engine/query/TestGroupByQuery.java     |  54 +++++++
 .../apache/tajo/engine/query/TestJoinQuery.java |  28 ++++
 .../tajo/engine/query/TestSelectQuery.java      |  11 +-
 .../apache/tajo/engine/query/TestSortQuery.java |  17 ++
 .../tajo/engine/query/TestWindowQuery.java      |   7 +
 .../testGroupByWithConstantKeys3.sql            |   8 +
 .../testGroupByWithConstantKeys4.sql            |  12 ++
 .../testGroupByWithConstantKeys5.sql            |  13 ++
 .../testLeftOuterJoinWithConstantExpr4.sql      |   6 +
 .../testLeftOuterJoinWithConstantExpr5.sql      |   9 ++
 ...SelectSameConstantsWithDifferentAliases3.sql |  10 ++
 .../TestSortQuery/testSortWithConstKeys.sql     |  10 ++
 .../queries/TestWindowQuery/testWindow8.sql     |   7 +
 .../testGroupByWithConstantKeys3.result         |   3 +
 .../testGroupByWithConstantKeys4.result         |   5 +
 .../testGroupByWithConstantKeys5.result         |   5 +
 .../testLeftOuterJoinWithConstantExpr4.result   |   7 +
 .../testLeftOuterJoinWithConstantExpr5.result   |   6 +
 .../TestSelectQuery/testSelectAsterisk5.result  |   2 +-
 ...ectSameConstantsWithDifferentAliases3.result |   7 +
 .../TestSortQuery/testSortWithConstKeys.result  |   7 +
 .../testLocalQueryWithoutFrom.result            |   4 +-
 .../results/TestWindowQuery/testWindow8.result  |   7 +
 tajo-project/pom.xml                            |  37 ++++-
 tajo-project/src/site/apt/index.apt             |   2 +
 61 files changed, 1141 insertions(+), 270 deletions(-)
----------------------------------------------------------------------



[19/19] git commit: Updated Change Note.

Posted by bl...@apache.org.
Updated Change Note.


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

Branch: refs/heads/master
Commit: ca187bcf68ce81b984ccb7c2e2b5adc25ebff237
Parents: 03847cf
Author: Jaehwa Jung <bl...@apache.org>
Authored: Mon Oct 6 10:43:27 2014 +0900
Committer: Jaehwa Jung <bl...@apache.org>
Committed: Mon Oct 6 10:43:27 2014 +0900

----------------------------------------------------------------------
 CHANGES                            | 2 ++
 tajo-docs/src/main/sphinx/tsql.rst | 9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/ca187bcf/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 1a0e4be..bcb4a7d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -495,6 +495,8 @@ Release 0.9.0 - unreleased
 
   SUB TASKS
 
+    TAJO-1062: Update TSQL documentation. (jaehwa)
+
     TAJO-1061: TAJO-1061: Update build documentation. (jaehwa)
 
     TAJO-1060: Apply updated hadoop versions to README and BUILDING files.

http://git-wip-us.apache.org/repos/asf/tajo/blob/ca187bcf/tajo-docs/src/main/sphinx/tsql.rst
----------------------------------------------------------------------
diff --git a/tajo-docs/src/main/sphinx/tsql.rst b/tajo-docs/src/main/sphinx/tsql.rst
index 86ffef2..187ffe8 100644
--- a/tajo-docs/src/main/sphinx/tsql.rst
+++ b/tajo-docs/src/main/sphinx/tsql.rst
@@ -7,12 +7,13 @@ Tajo provides a shell utility named Tsql. It is a command-line interface (CLI) w
 .. toctree::
   :maxdepth: 1
 
-  tsql/intro
-  tsql/single_command
-  tsql/execute_file
-  tsql/background_command
   tsql/meta_command
   tsql/dfs_command
   tsql/variables
   tsql/admin_command
 
+
+  tsql/intro
+  tsql/single_command
+  tsql/execute_file
+  tsql/background_command
\ No newline at end of file