Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: Documentation
    • Labels:
      None

      Description

      TSQL is very useful tool for tajo users. But currently, we don't provide enough informations to users. Thus, we need to add more informations to following documentation.
      http://tajo.apache.org/docs/current/cli.html

        Issue Links

          Activity

          Hide
          blrunner Jaehwa Jung added a comment -

          I uploaded the patch. For reference, I couldn't write a article for the \admin -cluster argument. Because it doesn't run as expected. I'll create a another issue for above bug.

          Show
          blrunner Jaehwa Jung added a comment - I uploaded the patch. For reference, I couldn't write a article for the \admin -cluster argument. Because it doesn't run as expected. I'll create a another issue for above bug.
          Hide
          blrunner Jaehwa Jung added a comment -

          I added the information for executing a query as background process.

          Show
          blrunner Jaehwa Jung added a comment - I added the information for executing a query as background process.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user blrunner opened a pull request:

          https://github.com/apache/tajo/pull/156

          TAJO-1062: Update TSQL documentation

          TAJO-1062: Update TSQL documentation

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/blrunner/tajo TAJO-1062

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/tajo/pull/156.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #156


          commit 7c98709f0fcb06dfb675acae3d6489a6126f55b5
          Author: jinossy <jinossy@gmail.com>
          Date: 2014-08-06T08:43:35Z

          TAJO-995: HiveMetaStoreClient wrapper should retry the connection

          commit 415d0867ae4a4543f47360294bead1fc7f41e292
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-08-10T06:07:24Z

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

          commit 7a7b4fd26f61df89cacdb4fc41faf9c2abe456b2
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-08-11T02:28:48Z

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

          commit 45f5ed3adba931f4706f26dda1d3c03240ee11d3
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-08-11T05:40:25Z

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

          commit aa01e83859ef553ac4eb90c1678e3bc6be20c6c9
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-08-18T09:56:24Z

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

          commit b33a94509c1a007b56785435c8e16640ffde91b7
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-09-04T02:14:19Z

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

          commit 05c892448113db40daef54d2e06dad463dbae9c8
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-09-11T02:33:54Z

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

          commit 42a6c4ebeebe36aad6f7dc5f92c83baee398c85e
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-09-11T03:25:05Z

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

          commit 52a942136c549f197d6d1c3d1a13717e6f14a83f
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-09-24T01:26:36Z

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

          commit 0e63abc71723c4c22f2c591ae60d892a9707973f
          Author: Jaehwa Jung <blrunner@apache.org>
          Date: 2014-09-24T01:48:09Z

          TAJO-1062: Update TSQL documentation


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user blrunner opened a pull request: https://github.com/apache/tajo/pull/156 TAJO-1062 : Update TSQL documentation TAJO-1062 : Update TSQL documentation You can merge this pull request into a Git repository by running: $ git pull https://github.com/blrunner/tajo TAJO-1062 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/156.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #156 commit 7c98709f0fcb06dfb675acae3d6489a6126f55b5 Author: jinossy <jinossy@gmail.com> Date: 2014-08-06T08:43:35Z TAJO-995 : HiveMetaStoreClient wrapper should retry the connection commit 415d0867ae4a4543f47360294bead1fc7f41e292 Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-08-10T06:07:24Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit 7a7b4fd26f61df89cacdb4fc41faf9c2abe456b2 Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-08-11T02:28:48Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit 45f5ed3adba931f4706f26dda1d3c03240ee11d3 Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-08-11T05:40:25Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit aa01e83859ef553ac4eb90c1678e3bc6be20c6c9 Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-08-18T09:56:24Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit b33a94509c1a007b56785435c8e16640ffde91b7 Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-09-04T02:14:19Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit 05c892448113db40daef54d2e06dad463dbae9c8 Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-09-11T02:33:54Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit 42a6c4ebeebe36aad6f7dc5f92c83baee398c85e Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-09-11T03:25:05Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit 52a942136c549f197d6d1c3d1a13717e6f14a83f Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-09-24T01:26:36Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo commit 0e63abc71723c4c22f2c591ae60d892a9707973f Author: Jaehwa Jung <blrunner@apache.org> Date: 2014-09-24T01:48:09Z TAJO-1062 : Update TSQL documentation
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18072638

          — Diff: 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
          — End diff –

          Hi Jaehwa,
          When I try "bin/tsql -h localhost", it works. But when I try "bin/tsql -h 192.168.x.x", where 192.168.x.x is my PC's IP address, it failed with a message "org.jboss.netty.channel.ConnectTimeoutException: Connect error to /192.168.x.x:26002 caused by ConnectException: Connection refused: /192.168.x.x:26002". Can you tell me why ? What should I do ? Did I miss a necessary configuration ?

          Aso, when I try "bin/tsql -h localhost -p 26007" (just use another port rather than the default 26002), it also failed. Can you tell me what should I do ?

          Thanks!

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18072638 — Diff: 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 — End diff – Hi Jaehwa, When I try "bin/tsql -h localhost", it works. But when I try "bin/tsql -h 192.168.x.x", where 192.168.x.x is my PC's IP address, it failed with a message "org.jboss.netty.channel.ConnectTimeoutException: Connect error to /192.168.x.x:26002 caused by ConnectException: Connection refused: /192.168.x.x:26002". Can you tell me why ? What should I do ? Did I miss a necessary configuration ? Aso, when I try "bin/tsql -h localhost -p 26007" (just use another port rather than the default 26002), it also failed. Can you tell me what should I do ? Thanks!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18076897

          — Diff: 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.
          — End diff –

          "we named its name to tsql." -> this sentence makes me confused. How about the following paragraph ?

          "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."

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18076897 — Diff: 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. — End diff – "we named its name to tsql." -> this sentence makes me confused. How about the following paragraph ? "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."
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18076919

          — Diff: 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:
          — End diff –

          "as follows" is duplicated.

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18076919 — Diff: 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: — End diff – "as follows" is duplicated.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18076943

          — Diff: 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: ::
          — End diff –

          Typo: "options" -> "option"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18076943 — Diff: 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: :: — End diff – Typo: "options" -> "option"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18076983

          — Diff: 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: ::
          — End diff –

          Typos:
          "options" -> "option"
          "a specified running query s as follows" -> "a specified running query as follows" (remove a redundant "s")

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18076983 — Diff: 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: :: — End diff – Typos: "options" -> "option" "a specified running query s as follows" -> "a specified running query as follows" (remove a redundant "s")
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18076995

          — Diff: 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: ::
          — End diff –

          Typos:
          "options" -> "option"
          "a specified running queries" -> "a specified running query"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18076995 — Diff: 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: :: — End diff – Typos: "options" -> "option" "a specified running queries" -> "a specified running query"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077006

          — Diff: 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: ::
          — End diff –

          Typos: "options" -> "option"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077006 — Diff: 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: :: — End diff – Typos: "options" -> "option"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077083

          — Diff: 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
          — End diff –

          Typo:
          "as background process" -> "as a background process"
          "before execute a query" -> "before executing a query"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077083 — Diff: 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 — End diff – Typo: "as background process" -> "as a background process" "before execute a query" -> "before executing a query"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077266

          — Diff: 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:
          — End diff –

          Typos: "commands(FsShell)" -> "commands (FsShell)"

          My suggestions (just to make the sentences more natural):

          ``\dfs`` command allows the hadoop dfs commands -> ``\dfs`` command provides a shortcut to the hadoop dfs commands

          ...this command, you just specify... -> ...this command, just specify...

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077266 — Diff: 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: — End diff – Typos: "commands(FsShell)" -> "commands (FsShell)" My suggestions (just to make the sentences more natural): ``\dfs`` command allows the hadoop dfs commands -> ``\dfs`` command provides a shortcut to the hadoop dfs commands ...this command, you just specify... -> ...this command, just specify...
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077313

          — Diff: 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:
          — End diff –

          Typo: "option.When" -> "option. When"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077313 — Diff: 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: — End diff – Typo: "option.When" -> "option. When"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077400

          — Diff: 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.
          — End diff –

          Typo: "in default" -> "by default"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077400 — Diff: 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. — End diff – Typo: "in default" -> "by default"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077481

          — Diff: 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: ::
          — End diff –

          Typo: "buit-in" -> "built-in"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077481 — Diff: 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: :: — End diff – Typo: "buit-in" -> "built-in"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077494

          — Diff: 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: ::
          — End diff –

          Typo: "function" -> "functions"

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077494 — Diff: 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: :: — End diff – Typo: "function" -> "functions"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077565

          — Diff: 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.
          — End diff –

          "only of characters in characters" -> this makes me confused

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077565 — Diff: 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. — End diff – "only of characters in characters" -> this makes me confused
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18077714

          — Diff: 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.
          — End diff –

          I think that we should use "Tajo" consistently everywhere instead of a mix of "tajo" and "Tajo".

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18077714 — Diff: 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. — End diff – I think that we should use "Tajo" consistently everywhere instead of a mix of "tajo" and "Tajo".
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18078613

          — Diff: 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.
          — End diff –

          It's not my comments. I just pasted tsql print messages we need to update trim function source at another jira issue.

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18078613 — Diff: 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. — End diff – It's not my comments. I just pasted tsql print messages we need to update trim function source at another jira issue.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18078633

          — Diff: 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.
          — End diff –

          I'll choice another function for a example.

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18078633 — Diff: 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. — End diff – I'll choice another function for a example.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on the pull request:

          https://github.com/apache/tajo/pull/156#issuecomment-57045521

          Hi @mhthanh

          Thank you for your detailed review.
          I've just updated the patch by your opinions.
          If possible, could you check it again?

          Thanks
          Jaehwa

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/156#issuecomment-57045521 Hi @mhthanh Thank you for your detailed review. I've just updated the patch by your opinions. If possible, could you check it again? Thanks Jaehwa
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user mhthanh commented on the pull request:

          https://github.com/apache/tajo/pull/156#issuecomment-57106623

          Hi @blrunner,
          I have checked the patch again. It looks good except 2 minor typos:
          + In file "meta_command.rst", Line 6, "anything command" -> "any command"
          + In file "single_command.rst", Line 7, "queries separated" -> "queries are separated"

          After you fix these typos, you automatically get +1 from me
          Actually, I like your patch and I think that Tajo needs many more detailed documents like this one.

          Show
          githubbot ASF GitHub Bot added a comment - Github user mhthanh commented on the pull request: https://github.com/apache/tajo/pull/156#issuecomment-57106623 Hi @blrunner, I have checked the patch again. It looks good except 2 minor typos: + In file "meta_command.rst", Line 6, "anything command" -> "any command" + In file "single_command.rst", Line 7, "queries separated" -> "queries are separated" After you fix these typos, you automatically get +1 from me Actually, I like your patch and I think that Tajo needs many more detailed documents like this one.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on the pull request:

          https://github.com/apache/tajo/pull/156#issuecomment-57414990

          Hi @mhthanh

          Really thank you for your detailed review.
          I've just updated it.

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/156#issuecomment-57414990 Hi @mhthanh Really thank you for your detailed review. I've just updated it.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18262233

          — Diff: tajo-docs/src/main/sphinx/tsql/back_command.rst —
          @@ -0,0 +1,28 @@
          +*********************************
          — End diff –

          Regarding this filename, I'd like to suggest using full name (background) instead of abbreviations (back). Especially, 'back' has definitely different meaning from 'background'.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18262233 — Diff: tajo-docs/src/main/sphinx/tsql/back_command.rst — @@ -0,0 +1,28 @@ +********************************* — End diff – Regarding this filename, I'd like to suggest using full name (background) instead of abbreviations (back). Especially, 'back' has definitely different meaning from 'background'.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18262252

          — Diff: tajo-docs/src/main/sphinx/tsql/admin_command.rst —
          @@ -0,0 +1,60 @@
          +*********************************
          +Administration Commands
          +*********************************
          +
          +
          +==========
          +Synopsis
          +==========
          +
          +Tsql provides commands for administrator as follows:
          — End diff –

          'administration commands as follows:' would be better.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18262252 — Diff: tajo-docs/src/main/sphinx/tsql/admin_command.rst — @@ -0,0 +1,60 @@ +********************************* +Administration Commands +********************************* + + +========== +Synopsis +========== + +Tsql provides commands for administrator as follows: — End diff – 'administration commands as follows:' would be better.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18262323

          — Diff: tajo-docs/src/main/sphinx/tsql/back_command.rst —
          @@ -0,0 +1,28 @@
          +*********************************
          +Executing as background process
          +*********************************
          +
          +
          +If you execute tsql as a background process, tsql will exit before executing a query because of jconsole architecture as
          — End diff –

          It should be 'because of some limitation of Jline2.\n Example:'.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18262323 — Diff: tajo-docs/src/main/sphinx/tsql/back_command.rst — @@ -0,0 +1,28 @@ +********************************* +Executing as background process +********************************* + + +If you execute tsql as a background process, tsql will exit before executing a query because of jconsole architecture as — End diff – It should be 'because of some limitation of Jline2.\n Example:'.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18262415

          — Diff: tajo-docs/src/main/sphinx/tsql/dfs_command.rst —
          @@ -0,0 +1,26 @@
          +*********************************
          +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:
          — End diff –

          'command(FsShell)' should be
          'command (FsShell)'

          Semicolon at the end of ```\dfs``` command is ignored. In other words, it is optional. So, you don't need to mention 'semicolon'.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18262415 — Diff: tajo-docs/src/main/sphinx/tsql/dfs_command.rst — @@ -0,0 +1,26 @@ +********************************* +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: — End diff – 'command(FsShell)' should be 'command (FsShell)' Semicolon at the end of ```\dfs``` command is ignored. In other words, it is optional. So, you don't need to mention 'semicolon'.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18262505

          — Diff: 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:
          — End diff –

          It would be better if you revise this statement to ```'-f' command allows tsql to execute more than one SQL statements stored in a text file as follows:```.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18262505 — Diff: 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: — End diff – It would be better if you revise this statement to ```'-f' command allows tsql to execute more than one SQL statements stored in a text file as follows:```.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18262542

          — Diff: tajo-docs/src/main/sphinx/tsql/meta_command.rst —
          @@ -0,0 +1,322 @@
          +*********************************
          +Meta Commands
          +*********************************
          +
          +
          +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: ::
          +
          + 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 built-in functions as follows: ::
          +
          + default> \df
          + Name | Result type | Argument types | Description | Type
          + -----------------------------------------------------------------------------------------------------------
          + abs | INT4 | INT4 | Absolute value | GENERAL
          — End diff –

          I think that we don't need to show all functions. It would be great if you can cut some of function lists because function list is not related to this manual but too long.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18262542 — Diff: tajo-docs/src/main/sphinx/tsql/meta_command.rst — @@ -0,0 +1,322 @@ +********************************* +Meta Commands +********************************* + + +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: :: + + 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 built-in functions as follows: :: + + default> \df + Name | Result type | Argument types | Description | Type + ---------------- --------------- --------------------- --------------------------------------------- ---------- + abs | INT4 | INT4 | Absolute value | GENERAL — End diff – I think that we don't need to show all functions. It would be great if you can cut some of function lists because function list is not related to this manual but too long.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on the pull request:

          https://github.com/apache/tajo/pull/156#issuecomment-57422674

          The patch looks nice to me. I leaved some trivial comments.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/156#issuecomment-57422674 The patch looks nice to me. I leaved some trivial comments.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18262615

          — Diff: 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.
          — End diff –

          That is a good point!
          I'll update it.

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18262615 — Diff: 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. — End diff – That is a good point! I'll update it.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on the pull request:

          https://github.com/apache/tajo/pull/156#issuecomment-57424012

          Hi @hyunsik

          Thank you for your review.
          I've just updated the patch.
          If possible, could you check it again?

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/156#issuecomment-57424012 Hi @hyunsik Thank you for your review. I've just updated the patch. If possible, could you check it again?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on a diff in the pull request:

          https://github.com/apache/tajo/pull/156#discussion_r18432680

          — Diff: tajo-docs/src/main/sphinx/cli.rst —
          @@ -1,159 +1,18 @@
          *****************************
          -Tajo Shell (TSQL)
          +Command-line Interface
          — End diff –

          I think that the original title is better because command-line interface is too general to be title. ```bin/tajo``` and ```bin/tajo-dump``` are also command line tools.

          If you thought it due to the filename ```cli.rst```, how do you think about renaming ```cli.rst``` to ```tsql.rst```?

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/156#discussion_r18432680 — Diff: tajo-docs/src/main/sphinx/cli.rst — @@ -1,159 +1,18 @@ ***************************** -Tajo Shell (TSQL) +Command-line Interface — End diff – I think that the original title is better because command-line interface is too general to be title. ```bin/tajo``` and ```bin/tajo-dump``` are also command line tools. If you thought it due to the filename ```cli.rst```, how do you think about renaming ```cli.rst``` to ```tsql.rst```?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on the pull request:

          https://github.com/apache/tajo/pull/156#issuecomment-57935669

          Hi @hyunsik

          I agree with your opinion.
          I've just renamed the file.

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/156#issuecomment-57935669 Hi @hyunsik I agree with your opinion. I've just renamed the file.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on the pull request:

          https://github.com/apache/tajo/pull/156#issuecomment-57943243

          +1 ship it.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/156#issuecomment-57943243 +1 ship it.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/tajo/pull/156

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/156
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Tajo-master-build #390 (See https://builds.apache.org/job/Tajo-master-build/390/)
          TAJO-1062: Update TSQL documentation (blrunner: rev 0e63abc71723c4c22f2c591ae60d892a9707973f)

          • tajo-docs/src/main/sphinx/tsql/back_command.rst
          • tajo-docs/src/main/sphinx/tsql/single_command.rst
          • tajo-docs/src/main/sphinx/tsql/admin_command.rst
          • tajo-docs/src/main/sphinx/tsql/intro.rst
          • tajo-docs/src/main/sphinx/tsql/meta_command.rst
          • tajo-docs/src/main/sphinx/tsql/dfs_command.rst
          • tajo-docs/src/main/sphinx/tsql/execute_file.rst
          • tajo-docs/src/main/sphinx/tsql/variables.rst
          • tajo-docs/src/main/sphinx/cli.rst
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #390 (See https://builds.apache.org/job/Tajo-master-build/390/ ) TAJO-1062 : Update TSQL documentation (blrunner: rev 0e63abc71723c4c22f2c591ae60d892a9707973f) tajo-docs/src/main/sphinx/tsql/back_command.rst tajo-docs/src/main/sphinx/tsql/single_command.rst tajo-docs/src/main/sphinx/tsql/admin_command.rst tajo-docs/src/main/sphinx/tsql/intro.rst tajo-docs/src/main/sphinx/tsql/meta_command.rst tajo-docs/src/main/sphinx/tsql/dfs_command.rst tajo-docs/src/main/sphinx/tsql/execute_file.rst tajo-docs/src/main/sphinx/tsql/variables.rst tajo-docs/src/main/sphinx/cli.rst
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Tajo-master-CODEGEN-build #32 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/32/)
          TAJO-1062: Update TSQL documentation (blrunner: rev 0e63abc71723c4c22f2c591ae60d892a9707973f)

          • tajo-docs/src/main/sphinx/tsql/single_command.rst
          • tajo-docs/src/main/sphinx/tsql/meta_command.rst
          • tajo-docs/src/main/sphinx/tsql/dfs_command.rst
          • tajo-docs/src/main/sphinx/cli.rst
          • tajo-docs/src/main/sphinx/tsql/execute_file.rst
          • tajo-docs/src/main/sphinx/tsql/intro.rst
          • tajo-docs/src/main/sphinx/tsql/back_command.rst
          • tajo-docs/src/main/sphinx/tsql/variables.rst
          • tajo-docs/src/main/sphinx/tsql/admin_command.rst
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-CODEGEN-build #32 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/32/ ) TAJO-1062 : Update TSQL documentation (blrunner: rev 0e63abc71723c4c22f2c591ae60d892a9707973f) tajo-docs/src/main/sphinx/tsql/single_command.rst tajo-docs/src/main/sphinx/tsql/meta_command.rst tajo-docs/src/main/sphinx/tsql/dfs_command.rst tajo-docs/src/main/sphinx/cli.rst tajo-docs/src/main/sphinx/tsql/execute_file.rst tajo-docs/src/main/sphinx/tsql/intro.rst tajo-docs/src/main/sphinx/tsql/back_command.rst tajo-docs/src/main/sphinx/tsql/variables.rst tajo-docs/src/main/sphinx/tsql/admin_command.rst
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Tajo-block_iteration-branch-build #15 (See https://builds.apache.org/job/Tajo-block_iteration-branch-build/15/)
          TAJO-1062: Update TSQL documentation (blrunner: rev 0e63abc71723c4c22f2c591ae60d892a9707973f)

          • tajo-docs/src/main/sphinx/tsql/single_command.rst
          • tajo-docs/src/main/sphinx/tsql/back_command.rst
          • tajo-docs/src/main/sphinx/tsql/meta_command.rst
          • tajo-docs/src/main/sphinx/tsql/execute_file.rst
          • tajo-docs/src/main/sphinx/tsql/dfs_command.rst
          • tajo-docs/src/main/sphinx/cli.rst
          • tajo-docs/src/main/sphinx/tsql/variables.rst
          • tajo-docs/src/main/sphinx/tsql/intro.rst
          • tajo-docs/src/main/sphinx/tsql/admin_command.rst
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Tajo-block_iteration-branch-build #15 (See https://builds.apache.org/job/Tajo-block_iteration-branch-build/15/ ) TAJO-1062 : Update TSQL documentation (blrunner: rev 0e63abc71723c4c22f2c591ae60d892a9707973f) tajo-docs/src/main/sphinx/tsql/single_command.rst tajo-docs/src/main/sphinx/tsql/back_command.rst tajo-docs/src/main/sphinx/tsql/meta_command.rst tajo-docs/src/main/sphinx/tsql/execute_file.rst tajo-docs/src/main/sphinx/tsql/dfs_command.rst tajo-docs/src/main/sphinx/cli.rst tajo-docs/src/main/sphinx/tsql/variables.rst tajo-docs/src/main/sphinx/tsql/intro.rst tajo-docs/src/main/sphinx/tsql/admin_command.rst

            People

            • Assignee:
              blrunner Jaehwa Jung
              Reporter:
              blrunner Jaehwa Jung
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development