Update some comments.
Project: http://git-wip-us.apache.org/repos/asf/tajo/repo Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/b6c06138 Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/b6c06138 Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/b6c06138 Branch: refs/heads/block_iteration Commit: b6c06138e756823daebf188174e63bead43c0c05 Parents: e1f2b6b Author: Jaehwa Jung <[email protected]> Authored: Wed Oct 1 15:25:43 2014 +0900 Committer: Jaehwa Jung <[email protected]> Committed: Wed Oct 1 15:25:43 2014 +0900 ---------------------------------------------------------------------- tajo-docs/src/main/sphinx/cli.rst | 2 +- .../src/main/sphinx/tsql/background_command.rst | 29 ++++ tajo-docs/src/main/sphinx/tsql/dfs_command.rst | 12 +- tajo-docs/src/main/sphinx/tsql/execute_file.rst | 2 +- tajo-docs/src/main/sphinx/tsql/meta_command.rst | 174 +------------------ .../src/main/sphinx/tsql/single_command.rst | 3 +- 6 files changed, 39 insertions(+), 183 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/cli.rst ---------------------------------------------------------------------- diff --git a/tajo-docs/src/main/sphinx/cli.rst b/tajo-docs/src/main/sphinx/cli.rst index 5fd2461..2bb500c 100644 --- a/tajo-docs/src/main/sphinx/cli.rst +++ b/tajo-docs/src/main/sphinx/cli.rst @@ -10,7 +10,7 @@ Tajo provides a shell utility named Tsql. It is a command-line interface (CLI) w tsql/intro tsql/single_command tsql/execute_file - tsql/back_command + tsql/background_command tsql/meta_command tsql/dfs_command tsql/variables http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/background_command.rst ---------------------------------------------------------------------- diff --git a/tajo-docs/src/main/sphinx/tsql/background_command.rst b/tajo-docs/src/main/sphinx/tsql/background_command.rst new file mode 100644 index 0000000..755405b --- /dev/null +++ b/tajo-docs/src/main/sphinx/tsql/background_command.rst @@ -0,0 +1,29 @@ +********************************* +Executing as background process +********************************* + + +If you execute tsql as a background process, tsql will exit before executing a query because of some limitation of Jline2. + +Example: + + .. code-block:: sql + + $ bin/tsql -f aggregation.sql & + [1] 19303 + $ + [1]+ Stopped ./bin/tsql -f aggregation.sql + + +To avoid above problem, Tajo provides the -B command as follows: + +.. code-block:: sql + + $ bin/tsql -B -f aggregation.sql & + [2] 19419 + Progress: 0%, response time: 0.218 sec + Progress: 0%, response time: 0.22 sec + Progress: 0%, response time: 0.421 sec + Progress: 0%, response time: 0.823 sec + Progress: 0%, response time: 1.425 sec + Progress: 1%, response time: 2.227 sec http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/dfs_command.rst ---------------------------------------------------------------------- diff --git a/tajo-docs/src/main/sphinx/tsql/dfs_command.rst b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst index e261159..d26c501 100644 --- a/tajo-docs/src/main/sphinx/tsql/dfs_command.rst +++ b/tajo-docs/src/main/sphinx/tsql/dfs_command.rst @@ -2,25 +2,25 @@ Executing HDFS commands ********************************* -You can run the hadoop dfs command(FsShell) within tsql. ``\dfs`` command provides a shortcut to the hadoop dfs commands. If you want to use this command, just specify FsShell arguments and add the semicolon at the end as follows: +You can run the hadoop dfs command (FsShell) within tsql. ``\dfs`` command provides a shortcut to the hadoop dfs commands. If you want to use this command, just specify FsShell arguments and add the semicolon at the end as follows: .. code-block:: sql - default> \dfs -ls /; + default> \dfs -ls / Found 3 items drwxr-xr-x - tajo supergroup 0 2014-08-14 04:04 /tajo drwxr-xr-x - tajo supergroup 0 2014-09-04 02:20 /tmp drwxr-xr-x - tajo supergroup 0 2014-09-16 13:41 /user - default> \dfs -ls /tajo; + default> \dfs -ls /tajo Found 2 items drwxr-xr-x - tajo supergroup 0 2014-08-14 04:04 /tajo/system drwxr-xr-x - tajo supergroup 0 2014-08-14 04:15 /tajo/warehouse - default> \dfs -mkdir /tajo/temp; + default> \dfs -mkdir /tajo/temp - default> \dfs -ls /tajo; + default> \dfs -ls /tajo Found 3 items drwxr-xr-x - tajo supergroup 0 2014-08-14 04:04 /tajo/system drwxr-xr-x - tajo supergroup 0 2014-09-23 06:48 /tajo/temp - drwxr-xr-x - tajo supergroup 0 2014-08-14 04:15 /tajo/warehouse \ No newline at end of file + drwxr-xr-x - tajo supergroup 0 2014-08-14 04:15 /tajo/warehouse http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/execute_file.rst ---------------------------------------------------------------------- diff --git a/tajo-docs/src/main/sphinx/tsql/execute_file.rst b/tajo-docs/src/main/sphinx/tsql/execute_file.rst index a513973..c791ad8 100644 --- a/tajo-docs/src/main/sphinx/tsql/execute_file.rst +++ b/tajo-docs/src/main/sphinx/tsql/execute_file.rst @@ -8,7 +8,7 @@ Basic usages ----------------------------------------------- -Tajo can execute more queries that were saved to a file using the -f file argument as follows: +``-f`` command allows tsql to execute more than one SQL statements stored in a text file as follows: .. code-block:: sql http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/meta_command.rst ---------------------------------------------------------------------- diff --git a/tajo-docs/src/main/sphinx/tsql/meta_command.rst b/tajo-docs/src/main/sphinx/tsql/meta_command.rst index 1b7eac2..1c92f4e 100644 --- a/tajo-docs/src/main/sphinx/tsql/meta_command.rst +++ b/tajo-docs/src/main/sphinx/tsql/meta_command.rst @@ -116,184 +116,12 @@ The prompt ``default>`` indicates the current database. Basically, all SQL state abs | FLOAT8 | FLOAT8 | Absolute value | GENERAL acos | FLOAT8 | FLOAT4 | Inverse cosine. | GENERAL acos | FLOAT8 | FLOAT8 | Inverse cosine. | GENERAL - add_days | TIMESTAMP | DATE,INT2 | Return date value which is added with given pa| GENERAL - add_days | TIMESTAMP | DATE,INT4 | Return date value which is added with given pa| GENERAL - add_days | TIMESTAMP | DATE,INT8 | Return date value which is added with given pa| GENERAL - add_days | TIMESTAMP | TIMESTAMP,INT2 | Return date value which is added with given pa| GENERAL - add_days | TIMESTAMP | TIMESTAMP,INT4 | Return date value which is added with given pa| GENERAL - add_days | TIMESTAMP | TIMESTAMP,INT8 | Return date value which is added with given pa| GENERAL - add_months | TIMESTAMP | DATE,INT2 | Return date value which is added with given pa| GENERAL - add_months | TIMESTAMP | DATE,INT4 | Return date value which is added with given pa| GENERAL - add_months | TIMESTAMP | DATE,INT8 | Return date value which is added with given pa| GENERAL - add_months | TIMESTAMP | TIMESTAMP,INT2 | Return date value which is added with given pa| GENERAL - add_months | TIMESTAMP | TIMESTAMP,INT4 | Return date value which is added with given pa| GENERAL - add_months | TIMESTAMP | TIMESTAMP,INT8 | Return date value which is added with given pa| GENERAL - ascii | INT4 | TEXT | ASCII code of the first character of the argum| GENERAL - asin | FLOAT8 | FLOAT4 | Inverse sine. | GENERAL - asin | FLOAT8 | FLOAT8 | Inverse sine. | GENERAL - atan | FLOAT8 | FLOAT4 | Inverse tangent. | GENERAL - atan | FLOAT8 | FLOAT8 | Inverse tangent. | GENERAL - atan2 | FLOAT8 | FLOAT4,FLOAT4 | Inverse tangent of y/x. | GENERAL - atan2 | FLOAT8 | FLOAT8,FLOAT8 | Inverse tangent of y/x. | GENERAL - avg | FLOAT8 | INT8 | the mean of a set of numbers | AGGREGATIO - avg | FLOAT8 | FLOAT4 | The mean of a set of numbers. | AGGREGATIO - avg | FLOAT8 | INT4 | the mean of a set of numbers. | AGGREGATIO - avg | FLOAT8 | FLOAT8 | The mean of a set of numbers. | AGGREGATIO - bit_length | INT4 | TEXT | Number of bits in string | GENERAL - btrim | TEXT | TEXT | Remove the longest string consisting only of | GENERAL - btrim | TEXT | TEXT,TEXT | Remove the longest string consisting only of | GENERAL - cbrt | FLOAT8 | FLOAT4 | Cube root | GENERAL - cbrt | FLOAT8 | FLOAT8 | Cube root | GENERAL - ceil | INT8 | FLOAT4 | Smallest integer not less than argument. | GENERAL - ceil | INT8 | FLOAT8 | Smallest integer not less than argument. | GENERAL - ceiling | INT8 | FLOAT4 | Smallest integer not less than argument. | GENERAL - ceiling | INT8 | FLOAT8 | Smallest integer not less than argument. | GENERAL - char_length | INT4 | TEXT | Number of characters in string | GENERAL - character_length| INT4 | TEXT | Number of characters in string | GENERAL - chr | CHAR | INT4 | Character with the given code. | GENERAL - coalesce | BOOLEAN | BOOLEAN,BOOLEAN_ARRAY | Returns the first of its arguments that is not| GENERAL - coalesce | INT8 | INT8_ARRAY | Returns the first of its arguments that is not| GENERAL - coalesce | FLOAT8 | FLOAT8_ARRAY | Returns the first of its arguments that is not| GENERAL - coalesce | TEXT | TEXT_ARRAY | Returns the first of its arguments that is not| GENERAL - coalesce | DATE | DATE_ARRAY | Returns the first of its arguments that is not| GENERAL - coalesce | TIME | TIME_ARRAY | Returns the first of its arguments that is not| GENERAL - coalesce | TIMESTAMP | TIMESTAMP_ARRAY | Returns the first of its arguments that is not| GENERAL - concat | TEXT | TEXT,TEXT_ARRAY | Concatenate all arguments. | GENERAL - concat_ws | TEXT | TEXT,TEXT,TEXT_ARRAY | Concatenate all but first arguments with separ| GENERAL - cos | FLOAT8 | FLOAT4 | Cosine. | GENERAL - cos | FLOAT8 | FLOAT8 | Cosine. | GENERAL - count | INT8 | ANY | The number of rows for which the supplied exp| DISTINCT_A - count | INT8 | | the total number of retrieved rows | AGGREGATIO - count | INT8 | ANY | The number of retrieved rows for which the sup| AGGREGATIO - current_date | DATE | | Get current date. Result is DATE type. | GENERAL - current_time | TIME | | Get current time. Result is TIME type. | GENERAL - date | INT8 | INT4 | Extracts the date part of the date or datetime| GENERAL - date_part | FLOAT8 | TEXT,TIME | Extract field from time | GENERAL - date_part | FLOAT8 | TEXT,TIMESTAMP | Extract field from timestamp | GENERAL - date_part | FLOAT8 | TEXT,DATE | Extract field from date | GENERAL - decode | TEXT | TEXT,TEXT | Decode binary data from textual representation| GENERAL - degrees | FLOAT8 | FLOAT4 | Radians to degrees | GENERAL - degrees | FLOAT8 | FLOAT8 | Radians to degrees | GENERAL - digest | TEXT | TEXT,TEXT | Calculates the Digest hash of string | GENERAL - div | INT8 | INT8,INT8 | Division(integer division truncates results) | GENERAL - div | INT8 | INT8,INT4 | Division(integer division truncates results) | GENERAL - div | INT8 | INT4,INT8 | Division(integer division truncates results) | GENERAL - div | INT8 | INT4,INT4 | Division(integer division truncates results) | GENERAL - encode | TEXT | TEXT,TEXT | Encode binary data into a textual representati| GENERAL - exp | FLOAT8 | FLOAT4 | Exponential | GENERAL - exp | FLOAT8 | FLOAT8 | Exponential | GENERAL - find_in_set | INT4 | TEXT,TEXT | Returns the first occurrence of str in str_arr| GENERAL - floor | INT8 | FLOAT4 | Largest integer not greater than argument. | GENERAL - floor | INT8 | FLOAT8 | Largest integer not greater than argument. | GENERAL - geoip_country_co| TEXT | TEXT | Convert an ipv4 address string to a geoip coun| GENERAL - geoip_country_co| TEXT | INET4 | Convert an ipv4 address to a geoip country cod| GENERAL - geoip_in_country| BOOLEAN | TEXT,TEXT | If the given country code is same with the cou| GENERAL - geoip_in_country| BOOLEAN | INET4,TEXT | If the given country code is same with the cou| GENERAL - initcap | TEXT | TEXT | Convert the first letter of each word to upper| GENERAL - left | TEXT | TEXT,INT4 | First n characters in the string. | GENERAL - length | INT4 | TEXT | Number of characters in string. | GENERAL - locate | INT4 | TEXT,TEXT | Location of specified substring | GENERAL - locate | INT4 | TEXT,TEXT,INT4 | Location of specified substring | GENERAL - lower | TEXT | TEXT | Convert string to lower case | GENERAL - lpad | TEXT | TEXT,INT4 | Fill up the string to length length by prepend| GENERAL - lpad | TEXT | TEXT,INT4,TEXT | Fill up the string to length length by prepend| GENERAL - ltrim | TEXT | TEXT | Remove the longest string containing only char| GENERAL - ltrim | TEXT | TEXT,TEXT | Remove the longest string containing only char| GENERAL - max | INT4 | INT4 | the maximum value of expr | AGGREGATIO - max | INT8 | INT8 | the maximum value of expr | AGGREGATIO - max | FLOAT4 | FLOAT4 | the maximum value of expr | AGGREGATIO - max | FLOAT8 | FLOAT8 | the maximum value of expr | AGGREGATIO - max | TEXT | TEXT | the maximum value of expr | AGGREGATIO - md5 | TEXT | TEXT | Calculates the MD5 hash of string | GENERAL - min | INT4 | INT4 | the minimum value of expr | AGGREGATIO - min | INT8 | INT8 | the minimum value of expr | AGGREGATIO - min | FLOAT4 | FLOAT4 | the minimum value of expr | AGGREGATIO - min | FLOAT8 | FLOAT8 | the minimum value of expr | AGGREGATIO - min | TEXT | TEXT | the minimum value of expr | AGGREGATIO - mod | INT8 | INT8,INT8 | Remainder of y/x | GENERAL - mod | INT8 | INT8,INT4 | Remainder of y/x | GENERAL - mod | INT8 | INT4,INT8 | Remainder of y/x | GENERAL - mod | INT8 | INT4,INT4 | Remainder of y/x | GENERAL - now | TIMESTAMP | | Get current time. Result is TIMESTAMP type. | GENERAL - octet_length | INT4 | TEXT | Number of bytes in string. | GENERAL - pi | FLOAT8 | | "??" constant | GENERAL - pow | FLOAT8 | FLOAT4,FLOAT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | FLOAT4,FLOAT8 | x raised to the power of y | GENERAL - pow | FLOAT8 | FLOAT8,FLOAT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | FLOAT8,FLOAT8 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT4,INT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT4,INT8 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT8,INT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT8,INT8 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT4,FLOAT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT4,FLOAT8 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT8,FLOAT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | INT8,FLOAT8 | x raised to the power of y | GENERAL - pow | FLOAT8 | FLOAT4,INT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | FLOAT4,INT8 | x raised to the power of y | GENERAL - pow | FLOAT8 | FLOAT8,INT4 | x raised to the power of y | GENERAL - pow | FLOAT8 | FLOAT8,INT8 | x raised to the power of y | GENERAL - quote_ident | TEXT | TEXT | Return the given string suitably quoted to be | GENERAL - radians | FLOAT8 | FLOAT8 | Degrees to radians | GENERAL - radians | FLOAT8 | FLOAT4 | Degrees to radians | GENERAL - random | INT4 | INT4 | A pseudorandom number | GENERAL - rank | INT8 | | The number of rows for which the supplied exp| WINDOW - regexp_replace | TEXT | TEXT,TEXT,TEXT | Replace substring(s) matching a POSIX regular| GENERAL - repeat | TEXT | TEXT,INT4 | Repeat string the specified number of times. | GENERAL - reverse | TEXT | TEXT | Reverse str | GENERAL - right | TEXT | TEXT,INT4 | Last n characters in the string | GENERAL - round | INT8 | FLOAT4 | Round to nearest integer. | GENERAL - round | INT8 | FLOAT8 | Round to nearest integer. | GENERAL - round | INT8 | INT4 | Round to nearest integer. | GENERAL - round | INT8 | INT8 | Round to nearest integer. | GENERAL - round | FLOAT8 | FLOAT8,INT4 | Round to s decimalN places. | GENERAL - round | FLOAT8 | INT8,INT4 | Round to s decimalN places. | GENERAL - row_number | INT8 | | the total number of retrieved rows | WINDOW - rpad | TEXT | TEXT,INT4 | Fill up the string to length length by appendi| GENERAL - rpad | TEXT | TEXT,INT4,TEXT | Fill up the string to length length by appendi| GENERAL - rtrim | TEXT | TEXT | Remove the longest string containing only cha| GENERAL - rtrim | TEXT | TEXT,TEXT | Remove the longest string containing only cha| GENERAL - sign | FLOAT8 | FLOAT8 | sign of the argument (-1, 0, +1) | GENERAL - sign | FLOAT8 | FLOAT4 | sign of the argument (-1, 0, +1) | GENERAL - sign | FLOAT8 | INT8 | sign of the argument (-1, 0, +1) | GENERAL - sign | FLOAT8 | INT4 | sign of the argument (-1, 0, +1) | GENERAL - sin | FLOAT8 | FLOAT4 | Sine. | GENERAL - sin | FLOAT8 | FLOAT8 | Sine. | GENERAL - sleep | INT4 | INT4 | sleep for seconds | GENERAL - split_part | TEXT | TEXT,TEXT,INT4 | Split string on delimiter and return the given| GENERAL - sqrt | FLOAT8 | FLOAT8 | Square root | GENERAL - sqrt | FLOAT8 | FLOAT4 | Square root | GENERAL - strpos | INT4 | TEXT,TEXT | Location of specified substring. | GENERAL - strposb | INT4 | TEXT,TEXT | Binary location of specified substring. | GENERAL - substr | TEXT | TEXT,INT4 | Extract substring. | GENERAL - substr | TEXT | TEXT,INT4,INT4 | Extract substring. | GENERAL - sum | INT8 | INT8 | the sum of a distinct and non-null values | DISTINCT_A - sum | INT8 | INT8 | the sum of a set of numbers | AGGREGATIO - sum | INT8 | INT4 | the sum of a set of numbers | AGGREGATIO - sum | INT8 | INT4 | the sum of a distinct and non-null values | DISTINCT_A - sum | FLOAT8 | FLOAT8 | the sum of a set of numbers | AGGREGATIO - sum | FLOAT8 | FLOAT4 | the sum of a set of numbers | AGGREGATIO - sum | FLOAT8 | FLOAT4 | the sum of a distinct and non-null values | DISTINCT_A - sum | FLOAT8 | FLOAT8 | the sum of a distinct and non-null values | DISTINCT_A - tan | FLOAT8 | FLOAT4 | Tangent. | GENERAL - tan | FLOAT8 | FLOAT8 | Tangent. | GENERAL - to_bin | TEXT | INT8 | Returns n in binary. | GENERAL - to_bin | TEXT | INT4 | Returns n in binary. | GENERAL - to_char | TEXT | TIMESTAMP,TEXT | Convert time stamp to string. Format should be| GENERAL - to_date | DATE | TEXT,TEXT | Convert string to date. Format should be a SQL| GENERAL - to_hex | TEXT | INT4 | Convert the argument to hexadecimal | GENERAL - to_hex | TEXT | INT8 | Convert the argument to hexadecimal | GENERAL - to_timestamp | TIMESTAMP | TEXT,TEXT | Convert string to time stamp | GENERAL - to_timestamp | TIMESTAMP | INT4 | Convert UNIX epoch to time stamp | GENERAL - to_timestamp | TIMESTAMP | INT8 | Convert UNIX epoch to time stamp | GENERAL - trim | TEXT | TEXT | Remove the longest string consisting only of | GENERAL - trim | TEXT | TEXT,TEXT | Remove the longest string consisting only of | GENERAL - upper | TEXT | TEXT | Convert string to upper case. | GENERAL utc_usec_to | INT8 | TEXT,INT8 | Extract field from time | GENERAL utc_usec_to | INT8 | TEXT,INT8,INT4 | Extract field from time | GENERAL (181) rows + For Reference, many details have been omitted in order to present a clear picture of the process. ``\df [function name]`` command also shows a function description as follows: :: http://git-wip-us.apache.org/repos/asf/tajo/blob/b6c06138/tajo-docs/src/main/sphinx/tsql/single_command.rst ---------------------------------------------------------------------- diff --git a/tajo-docs/src/main/sphinx/tsql/single_command.rst b/tajo-docs/src/main/sphinx/tsql/single_command.rst index fc28202..21eb10d 100644 --- a/tajo-docs/src/main/sphinx/tsql/single_command.rst +++ b/tajo-docs/src/main/sphinx/tsql/single_command.rst @@ -3,8 +3,7 @@ Executing a single command ********************************* -You may want to run more queries without entering tsql prompt. Tsql provides the -c argument for above -requirement. And Tajo assumes that queries are separated by semicolon as follows: +You may want to run more queries without entering tsql prompt. Tsql provides the ``-c`` argument for above requirement. And Tajo assumes that queries are separated by semicolon as follows: .. code-block:: sql
