From cc384c6bda7c78dde4ba8d1f106fa9430b339b17 Mon Sep 17 00:00:00 2001 From: "liu.yu" Date: Mon, 25 Jun 2018 20:38:12 +0800 Subject: [PATCH 1/3] [TRAFODION-3119] Add *Syntax Descriptions* for *LOAD Statement* and Fix Typos in *Trafodion SQL Reference Manual* --- .../asciidoc/_chapters/sql_statements.adoc | 116 ++++++++++-------- .../src/asciidoc/_chapters/sql_utilities.adoc | 12 +- 2 files changed, 73 insertions(+), 55 deletions(-) diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc index 9abd7a7b9b..45cc88511e 100644 --- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc +++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc @@ -6429,7 +6429,7 @@ insert-source is: + names the user table or view in which to insert rows. _table_ must be a base table or an updatable view. -* `_(target-col-list)_` +* `_target-col-list_` + names the columns in the table or view in which to insert values. The data type of each target column must be compatible with the data type of its corresponding source value. Within the list, each target column must @@ -6441,8 +6441,8 @@ into the columns that do not appear in the list. See <>. +For more information, see <>. [[invoke_considerations]] === Considerations for INVOKE @@ -7175,12 +7175,11 @@ Specifies the privileges to revoke. You can specify these privileges for an obje [cols="20%,80%"] |=== | DELETE | Revokes the ability to use the DELETE statement. -| EXECUTE | Revokes the ability to execute a stored procedure using a CALL statement or revokes the ability +| EXECUTE | Revokes the ability to execute a stored procedure using a CALL statement or revokes the ability to execute a user-defined function (UDF). | INSERT [columm-list] | Revokes the ability to use the INSERT statement. | REFERENCES [column-list] | Revokes the ability to create constraints that reference the object. | SELECT [column-list] | Revokes the ability to use the SELECT statement. | UPDATE [column-list] | Revokes the ability to use the UPDATE statement. -to execute a user-defined function (UDF). | USAGE | For libraries, revokes the ability to access a library using the CREATE PROCEDURE or CREATE FUNCTION statement. For sequence generators, revokes the ability to access a sequence in a SQL query. @@ -7257,44 +7256,51 @@ REVOKE GRANT OPTION FOR SELECT (part_no, part_name), DELETE ON TABLE invent.part REVOKE SELECT (part_no, part_name), DELETE ON TABLE invent.partloc FROM jsmith, clerks; ``` -* To revoke a user’s SELECT privileges on a table: +* To revoke a user’s SELECT privileges on a table. ++ +User administrator grants the SELECT privilege to _JSMITH_. + ``` --- User administrator grants the SELECT privilege to JSMITH: GRANT SELECT ON TABLE invent.partloc TO jsmith WITH GRANT OPTION; - --- JSMITH grants the SELECT privilege to AJONES: +``` ++ +_JSMITH_ grants the SELECT privilege to _AJONES_. ++ +``` GRANT SELECT ON TABLE invent.partloc TO ajones; - --- If the user administrator attempts to revoke the SELECT --- privilege from JSMITH, this would fail because --- of the privilege granted to AJONES based on the --- privilege granted to JSMITH. --- To successfully revoke the SELECT privilege from --- JSMITH, the SELECT privilege granted to AJONES --- must be revoked first. For this example: --- 1. JSMITH revokes the SELECT privilege granted to AJONES: +``` ++ +If the user administrator attempts to revoke the SELECT privilege from _JSMITH_, this would fail because of +the privilege granted to _AJONES_ based on the privilege granted to _JSMITH_. To successfully revoke the SELECT privilege from _JSMITH_, the SELECT privilege granted to _AJONES_ +must be revoked first. ++ +For this example: ++ +_JSMITH_ revokes the SELECT privilege granted to _AJONES_. ++ +``` REVOKE SELECT ON TABLE invent.partloc FROM ajones; - --- 2. User administrator revokes the SELECT privilege on the --- table from JSMITH: +``` ++ +User administrator revokes the SELECT privilege on the table from _JSMITH_, the REVOKE operation succeeds. ++ +``` REVOKE SELECT ON TABLE invent.partloc FROM jsmith RESTRICT; - --- The REVOKE operation succeeds. --- An easier way to make the REVOKE operation successful is --- to use the CASCADE option: +``` ++ +An easier way to make the REVOKE operation successful is to use the `CASCADE option`. ++ +The REVOKE operation succeeds because the `CASCADE option` causes all specified privileges, and all privileges that +were granted based upon the specified privileges, to be removed. ++ +``` REVOKE SELECT ON TABLE invent.partloc FROM jsmith CASCADE; - --- The REVOKE operation succeeds because the CASCADE option --- causes all specified privileges, and all privileges that --- were granted based upon the specified privileges, to be --- removed. ``` -* Administration in the shipping department decides that the CLERKS role should no longer be able to grant -privileges on the invent.partloc table. Fred has recently moved to another department, so JSMITH revokes -the SELECT privilege on the invent.partloc table from Fred, who was granted the privilege by CLERKS. Then, -JSMITH revokes the grant option from CLERKS: +* Administration in the shipping department decides that the _CLERKS_ role should no longer be able to grant +privileges on the _invent.partloc_ table. _Fred_ has recently moved to another department, so _JSMITH_ revokes +the SELECT privilege on the _invent.partloc_ table from _Fred_, who was granted the privilege by _CLERKS_. Then, +_JSMITH_ revokes the grant option from _CLERKS_: + ``` REVOKE SELECT on table invent.partloc FROM fred GRANTED BY clerks; @@ -7800,10 +7806,10 @@ operation. new is not allowed. an implicit old.* return list is assumed for a de <<< **** `_col-expr_ [[AS] _name_]` + -specifies a derived column determined by the evaluation of an sql value expression in the list. any column referred to in a value -expression is from the row in the old table exposed by the delete. the old table refers to column values before the delete operation. +specifies a derived column determined by the evaluation of an sql value expression in the list. Any column referred to in a value +expression is from the row in the old table exposed by the delete. The old table refers to column values before the delete operation. + -By using the as clause, you can associate a derived column, _col-expr_, with a _name_. _name_ is an SQL identifier. See +By using the `AS clause`, you can associate a derived column, _col-expr_, with a _name_. _name_ is an SQL identifier. See <>. *** `[AS] _corr_ [(_col-expr-list_)]` @@ -7869,22 +7875,24 @@ specifies a correlation name, _corr_, and an optional column list. See <>. + -If you do not specify _target-col-list_, row values from the source +If you do not specify `_target-col-list_`, row values from the source table are inserted into or updated in all columns in table. The order of the column values in the source table must be the same order as that of the columns specified in the CREATE TABLE for _table_. (This order is diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc index 5bcde538f8..deacebe0c9 100644 --- a/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc +++ b/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc @@ -46,7 +46,7 @@ NOTE: {project-name} SQL utilities are entered interactively or from script files using a client-based tool, such as the {project-name} Command Interface (TrafCI). To install and configure a client application that enables you to connect to and issue SQL utilities, see the -{docs-url}/client_installation/index.html[_{project-name} Client Installation Guide_]. +http://trafodion.apache.org/docs/client_install/index.html[Trafodion Client Installation Guide]. <<< [[cleanup_statement]] @@ -414,8 +414,10 @@ option is: | NO POPULATE INDEXES | NO DUPLICATE CHECK | NO OUTPUT + | NO RECOVERY | INDEX TABLE ONLY | REBUILD INDEXES + | UPSERT USING LOAD ``` [[load_syntax]] @@ -513,6 +515,10 @@ prevents the LOAD statement from displaying status messages. By default, the LOAD statement prints status messages listing the steps that the Bulk Loader is executing. +** `NO RECOVERY` ++ +specifies that the Bulk Loader not use HBase snapshots for recovery. By default, the Bulk Loader handles recovery using the HBase snapshots mechanism. + ** `INDEX TABLE ONLY` + specifies that the target table, which is an index, be populated with @@ -530,6 +536,10 @@ In this case, the elapsed time of using LOAD Statement without options is nearly using LOAD WITH REBUILD INDEXES, and the elapsed time of the former is less than the latter if this CQD is turned ON. +** `UPSERT USING LOAD` ++ +specifies that data is inserted into target tables using rowset inserts without transactions. + <<< [[load_considerations]] === Considerations for LOAD From fa6004ad0e719461a0a65e49c6c041d7d72fb2a2 Mon Sep 17 00:00:00 2001 From: "liu.yu" Date: Mon, 25 Jun 2018 20:43:29 +0800 Subject: [PATCH 2/3] Fix a typo --- docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc index 45cc88511e..54a73eae1c 100644 --- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc +++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc @@ -7882,7 +7882,7 @@ table-ref [join-type] JOIN table-ref join-spec ``` <<< -*** `_join-type_ is: +*** `_join-type_` is: + `INNER | LEFT [OUTER] | RIGHT [OUTER] | FULL [OUTER]` + From 50f49abb3937a626d3277a976b1a34715185fc45 Mon Sep 17 00:00:00 2001 From: "liu.yu" Date: Tue, 26 Jun 2018 10:39:50 +0800 Subject: [PATCH 3/3] Incorporate Comments 1 --- docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc | 2 -- docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc index 54a73eae1c..23b9d76d54 100644 --- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc +++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc @@ -7889,8 +7889,6 @@ table-ref [join-type] JOIN table-ref join-spec is a joined table. You specify the `_join-type_` by using the CROSS, INNER, OUTER, LEFT, RIGHT, and FULL keywords. If you omit the optional OUTER keyword and use LEFT, RIGHT, or FULL in a join, {project-name} SQL assumes the join is an outer join. -+ -If you specify a CROSS join as the `_join-type_`, you cannot specify a NATURAL join or a *** `_join-spec_` + diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc index deacebe0c9..126ef7e158 100644 --- a/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc +++ b/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc @@ -539,6 +539,8 @@ if this CQD is turned ON. ** `UPSERT USING LOAD` + specifies that data is inserted into target tables using rowset inserts without transactions. ++ +In this case, Trafodion uses regular HBase interface (Put) rather than HBase Bulk Loader when inserting multiple rows at a time. <<< [[load_considerations]]