[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-19 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157948980
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3526,7 +3526,7 @@ EMPTY_CLOB()
 
 * If EMPTY_CLOB() is specified, then a dummy lob handle is created.
 
-** No data is associated with the empty LOBs yet, but these dummy LOB 
handles can later be used to populate with new LOB data. If the LOB had data 
previously associated with it, it will be erased.
+** No data is associated with the empty LOBs yet, but these dummy LOB 
handles can later be used to populate the LOB with new data. If the LOB had 
data previously associated with it, it will be erased.
 
 ** The dummy LOB handle will get the same datatype as the underlying 
column.
 +
--- End diff --

Thanks Sandhya, I've updated this paragrahy based on you suggestions. :)


---


[GitHub] incubator-trafodion pull request #1354: [TRAFODION-2850] Add a Note for EMPT...

2017-12-19 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1354#discussion_r157937569
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/working_with_lob.adoc ---
@@ -235,6 +235,8 @@ The source for inserting into a LOB can be any of the 
following:
 An unnamed parameter can be used to prepare a statement and then during an 
execution, either a function or a simple string parameter can be passed in 
which will be converted to LOB data.
 
 * `EMPTY_BLOB()` or `EMPTY_CLOB()` 
++
+NOTE: If you want to insert `EMPTY_BLOB()` or `EMPTY_CLOB()` into a lob 
column, the CQD `TRAF_CLOB_AS_VARCHAR` which is *ON* by default must be turned 
*OFF* before creating the table.
--- End diff --

Hi @DaveBirdsall, 
1. The CQD  must be turned **'OFF'** before creating a table, otherwise an 
error will be raised if `EMPTY_BLOB()` or `EMPTY_CLOB()` is inserted into a lob 
column, and the **column definition** of lob column is **VARCHAR** (see the 
first attachment).

2. Correct behaviour:
Set the CQD 'OFF', then create a table and insert `EMPTY_BLOB()` or 
`EMPTY_CLOB()`, it will succeed and the column definition is **CLOB** rather 
than VARCHAR (see the second attachment).

3. The default value of this CQD is ON. 

Thanks for your reminding, may I change this note to the following?

Note: If you want to insert `EMPTY_BLOB()` or `EMPTY_CLOB()` into a lob 
column, the CQD `TRAF_CLOB_AS_VARCHAR` which is **ON** by default must be 
turned **OFF** before creating a table, otherwise an error will be raised and 
the column definition of the lob column is VARCHAR.

![turn the cqd off after creating a 
table](https://user-images.githubusercontent.com/20532956/34191895-71acb302-e585-11e7-89c5-acb9f8c50640.jpg)
![set the cqd off before creating a 
table](https://user-images.githubusercontent.com/20532956/34191896-764771e0-e585-11e7-9823-983e28839440.jpg)



---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655670
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3638,6 +3776,52 @@ The example displays only part of the result table 
of the EXPLAIN
 function. It first uses the EXPLAIN function to generate the table and
 then selects the desired columns.
 
+<<<
+[[externaltolob_function]]
+== EXTERNALTOLOB Function
+
+[[externaltolob_function_syntax]]
+=== Syntax Descriptions of EXTERNALTOLOB Function
+
+The EXTERNALTOLOB function converts data from an external file into LOB 
format. This function can be used in INSERT or UPDATE statement.  
--- End diff --

"an INSERT or UPDATE statement" is preferable, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655715
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -367,6 +369,9 @@ SECOND 0-59 +
 FRACTION(n) 0-99 +
 in which n is the number of significant digits (default is 6; minimum is 
1; maximum is 6); +
 stored in 2, 4, or 8 bytes depending on number of digits^2^
+.2+| LOB Data Types .2+| LOB | BLOB | Binary Large Object .2+| 10G – no 
limit + 
+Currently it sets to 10G (default) and it’s controlled by the `CQD 
LOB_MAX_SIZE`, the size can be changed depending on your needs.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655659
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3679,40 +3863,43 @@ EXTRACT (YEAR FROM INTERVAL '01-09' YEAR TO MONTH)
 +
 The result is 1.
 
-
 <<<
-[[hour_function]]
-=== HOUR Function
+[[filetolob_function]]
+== FILETOLOB Function
 
-The HOUR function converts a TIME or TIMESTAMP expression into an
-INTEGER value in the range 0 through 23 that represents the
-corresponding hour of the day.
+[[filetolob_function_syntax]]
+=== Syntax Descriptions of FILETOLOB Function
 
-HOUR is a {project-name} SQL extension.
+The FILETOLOB function converts data from a local linux/hdfs file into LOB 
format. This function can be used in INSERT or UPDATE statement.  
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655684
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -7182,6 +7404,40 @@ SELECT STDDEV (price * qty_available) FROM 
sales.parts;
 --- 1 row(s) selected.
 ```
 
+<<<
+[[stringtolob_function]]
+== STRINGTOLOB Function
+
+[[stringtolob_function_syntax]]
+=== Syntax Descriptions of STRINGTOLOB Function
+
+The STRINGTOLOB function converts a simple string literal into LOB format. 
This function can be used in INSERT or UPDATE statement.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655567
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3405,6 +3461,88 @@ DIFF2_I1TS
 --- 5 row(s) selected.
 ```
 
+<<<
+[[emptyblob_function]]
+== EMPTY_BLOB() Function
+
+[[syntax_descriptions_of_emptyblob_function]]
+=== Syntax Descriptions of EMPTY_BLOB() Function
+
+The EMPTY_BLOB() function creates a dummy LOB handle with BLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a 
LOB column or attribute to EMPTY.
+
+EMPTY_BLOB() function is a Trafodion SQL extension.
+
+For more information, see 
http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion SQL 
Large Objects Guide].
+
+```
+EMPTY_BLOB()
+```
+
+[[considerations_for_emptyblob_function]]
+=== Considerations for EMPTY_BLOB() Function
+
+* If EMPTY_BLOB() is specified, then a dummy lob handle is created.
+
+** No data is associated with the empty LOBs yet, but these dummy LOB 
handles can later be used to populate with new LOB data. If the LOB had data 
previously associated with it, it will be erased.
+
+** The dummy LOB handle will get the same datatype as the underlying 
column.
++
+For example, if the LOB column was defined as `‘EXTERNAL’` during 
table creation, then the LOB column gets that type. If it’s not defined, then 
it is considered as a regular LOB. 
+
+* An empty LOB is distinct from a LOB containing a string of length zero 
or a null LOB.
+
+[[examples_of_emptyblob_function]]
+=== Examples of EMPTY_BLOB() Function
+
+* This example uses the EMPTY_BLOB to insert an empty LOB and creates a 
dummy LOB handle. 
++
+```
+insert into test1 values (1, empty_blob());
+```
+
+<<<
+[[emptyclob_function]]
+== EMPTY_CLOB() Function
+
+[[syntax_descriptions_of_emptyclob_function]]
+=== Syntax Descriptions of EMPTY_CLOB() Function
+
+The EMPTY_CLOB() function creates a dummy LOB handle with CLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a 
LOB column or attribute to EMPTY.
+
+EMPTY_CLOB() function is a Trafodion SQL extension.
+
+For more information, see 
http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion LOB 
Guide].
+
+```
+EMPTY_CLOB()
+```
+
+[[considerations_for_emptyclob_function]]
+=== Considerations for EMPTY_CLOB() Function
+
+* If EMPTY_CLOB() is specified, then a dummy lob handle is created.
+
+** No data is associated with the empty LOBs yet, but these dummy LOB 
handles can later be used to populate with new LOB data. If the LOB had data 
previously associated with it, it will be erased.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655482
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -213,6 +213,24 @@ corresponding week of the year.
 
 See the individual entry for the function.
 
+[[lob_functions]]
+== LOB Functions
+
+Trafodion provides following LOB functions to process LOB data.
+
+[cols="25%,75%"]
+|===
+| <<emptyblob_function,EMPTY_BLOB() Function>>   | Creates a dummy LOB 
handle with BLOB.
+| <<emptyclob_function,EMPTY_CLOB() Function>>   | Creates a dummy LOB 
handle with CLOB.
--- End diff --

thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655538
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3405,6 +3461,88 @@ DIFF2_I1TS
 --- 5 row(s) selected.
 ```
 
+<<<
+[[emptyblob_function]]
+== EMPTY_BLOB() Function
+
+[[syntax_descriptions_of_emptyblob_function]]
+=== Syntax Descriptions of EMPTY_BLOB() Function
+
+The EMPTY_BLOB() function creates a dummy LOB handle with BLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a 
LOB column or attribute to EMPTY.
+
+EMPTY_BLOB() function is a Trafodion SQL extension.
+
+For more information, see 
http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion SQL 
Large Objects Guide].
+
+```
+EMPTY_BLOB()
+```
+
+[[considerations_for_emptyblob_function]]
+=== Considerations for EMPTY_BLOB() Function
+
+* If EMPTY_BLOB() is specified, then a dummy lob handle is created.
+
+** No data is associated with the empty LOBs yet, but these dummy LOB 
handles can later be used to populate with new LOB data. If the LOB had data 
previously associated with it, it will be erased.
+
+** The dummy LOB handle will get the same datatype as the underlying 
column.
++
+For example, if the LOB column was defined as `‘EXTERNAL’` during 
table creation, then the LOB column gets that type. If it’s not defined, then 
it is considered as a regular LOB. 
+
+* An empty LOB is distinct from a LOB containing a string of length zero 
or a null LOB.
+
+[[examples_of_emptyblob_function]]
+=== Examples of EMPTY_BLOB() Function
+
+* This example uses the EMPTY_BLOB to insert an empty LOB and creates a 
dummy LOB handle. 
++
+```
+insert into test1 values (1, empty_blob());
+```
+
+<<<
+[[emptyclob_function]]
+== EMPTY_CLOB() Function
+
+[[syntax_descriptions_of_emptyclob_function]]
+=== Syntax Descriptions of EMPTY_CLOB() Function
+
+The EMPTY_CLOB() function creates a dummy LOB handle with CLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a 
LOB column or attribute to EMPTY.
--- End diff --

"an INSERT or UPDATE statement" is preferable, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655475
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3405,6 +3461,88 @@ DIFF2_I1TS
 --- 5 row(s) selected.
 ```
 
+<<<
+[[emptyblob_function]]
+== EMPTY_BLOB() Function
+
+[[syntax_descriptions_of_emptyblob_function]]
+=== Syntax Descriptions of EMPTY_BLOB() Function
+
+The EMPTY_BLOB() function creates a dummy LOB handle with BLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a 
LOB column or attribute to EMPTY.
+
+EMPTY_BLOB() function is a Trafodion SQL extension.
+
+For more information, see 
http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion SQL 
Large Objects Guide].
+
+```
+EMPTY_BLOB()
+```
+
+[[considerations_for_emptyblob_function]]
+=== Considerations for EMPTY_BLOB() Function
+
+* If EMPTY_BLOB() is specified, then a dummy lob handle is created.
+
+** No data is associated with the empty LOBs yet, but these dummy LOB 
handles can later be used to populate with new LOB data. If the LOB had data 
previously associated with it, it will be erased.
+
+** The dummy LOB handle will get the same datatype as the underlying 
column.
++
+For example, if the LOB column was defined as `‘EXTERNAL’` during 
table creation, then the LOB column gets that type. If it’s not defined, then 
it is considered as a regular LOB. 
+
+* An empty LOB is distinct from a LOB containing a string of length zero 
or a null LOB.
+
+[[examples_of_emptyblob_function]]
+=== Examples of EMPTY_BLOB() Function
+
+* This example uses the EMPTY_BLOB to insert an empty LOB and creates a 
dummy LOB handle. 
++
+```
+insert into test1 values (1, empty_blob());
+```
+
+<<<
+[[emptyclob_function]]
+== EMPTY_CLOB() Function
+
+[[syntax_descriptions_of_emptyclob_function]]
+=== Syntax Descriptions of EMPTY_CLOB() Function
+
+The EMPTY_CLOB() function creates a dummy LOB handle with CLOB.
--- End diff --

thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655468
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3405,6 +3461,88 @@ DIFF2_I1TS
 --- 5 row(s) selected.
 ```
 
+<<<
+[[emptyblob_function]]
+== EMPTY_BLOB() Function
+
+[[syntax_descriptions_of_emptyblob_function]]
+=== Syntax Descriptions of EMPTY_BLOB() Function
+
+The EMPTY_BLOB() function creates a dummy LOB handle with BLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a 
LOB column or attribute to EMPTY.
+
+EMPTY_BLOB() function is a Trafodion SQL extension.
+
+For more information, see 
http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion SQL 
Large Objects Guide].
+
+```
+EMPTY_BLOB()
+```
+
+[[considerations_for_emptyblob_function]]
+=== Considerations for EMPTY_BLOB() Function
+
+* If EMPTY_BLOB() is specified, then a dummy lob handle is created.
+
+** No data is associated with the empty LOBs yet, but these dummy LOB 
handles can later be used to populate with new LOB data. If the LOB had data 
previously associated with it, it will be erased.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655159
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3405,6 +3461,88 @@ DIFF2_I1TS
 --- 5 row(s) selected.
 ```
 
+<<<
+[[emptyblob_function]]
+== EMPTY_BLOB() Function
+
+[[syntax_descriptions_of_emptyblob_function]]
+=== Syntax Descriptions of EMPTY_BLOB() Function
+
+The EMPTY_BLOB() function creates a dummy LOB handle with BLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a 
LOB column or attribute to EMPTY.
--- End diff --

"an INSERT or UPDATE statement" is preferable, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655101
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3405,6 +3461,88 @@ DIFF2_I1TS
 --- 5 row(s) selected.
 ```
 
+<<<
+[[emptyblob_function]]
+== EMPTY_BLOB() Function
+
+[[syntax_descriptions_of_emptyblob_function]]
+=== Syntax Descriptions of EMPTY_BLOB() Function
+
+The EMPTY_BLOB() function creates a dummy LOB handle with BLOB.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157655082
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -926,6 +944,45 @@ The following are BITAND restrictions:
 --- 1 row(s) selected
 ```
 
+<<<
+[[buffertolob_function]]
+== BUFFERTOLOB Function 
+
+[[buffertolob_function_syntax]]
+=== Syntax Descriptions of BUFFERTOLOB Function
+
+The BUFFERTOLOB function takes an address and a size of an input buffer, 
and converts the data pointed to by that buffer into LOB. This function can be 
used in INSERT or UPDATE statement.
+
+BUFFERTOLOB function is a Trafodion SQL extension.
+
+For more information, see 
http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion SQL 
Large Objects Guide].
+
+```
+BUFFERTOLOB(LOCATION lob source buffer address, LENGTH lob length value)   
+```
+
+* _lob source buffer address_
++
+The long value of the user buffer address in int64.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157654894
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -926,6 +944,45 @@ The following are BITAND restrictions:
 --- 1 row(s) selected
 ```
 
+<<<
+[[buffertolob_function]]
+== BUFFERTOLOB Function 
+
+[[buffertolob_function_syntax]]
+=== Syntax Descriptions of BUFFERTOLOB Function
+
+The BUFFERTOLOB function takes an address and a size of an input buffer, 
and converts the data pointed to by that buffer into LOB. This function can be 
used in INSERT or UPDATE statement.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157654813
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -213,6 +213,24 @@ corresponding week of the year.
 
 See the individual entry for the function.
 
+[[lob_functions]]
+== LOB Functions
+
+Trafodion provides following LOB functions to process LOB data.
+
+[cols="25%,75%"]
+|===
+| <<emptyblob_function,EMPTY_BLOB() Function>>   | Creates a dummy LOB 
handle with BLOB.
+| <<emptyclob_function,EMPTY_CLOB() Function>>   | Creates a dummy LOB 
handle with CLOB.
+| <<stringtolob_function,STRINGTOLOB Function>>  | Converts a simple 
string literal into LOB format.
+| <<filetolob_function,FILETOLOB Function>>  | Converts data from a 
local linux/hdfs file into LOB format.
+| <<buffertolob_function,BUFFERTOLOB_Function>> | Takes an address and 
a size of an input buffer, and converts the data pointed to by that buffer into 
LOB format.
--- End diff --

OK, thanks Dave, for your detailed explanations. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157654856
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -213,6 +213,24 @@ corresponding week of the year.
 
 See the individual entry for the function.
 
+[[lob_functions]]
+== LOB Functions
+
+Trafodion provides following LOB functions to process LOB data.
+
+[cols="25%,75%"]
+|===
+| <<emptyblob_function,EMPTY_BLOB() Function>>   | Creates a dummy LOB 
handle with BLOB.
+| <<emptyclob_function,EMPTY_CLOB() Function>>   | Creates a dummy LOB 
handle with CLOB.
+| <<stringtolob_function,STRINGTOLOB Function>>  | Converts a simple 
string literal into LOB format.
+| <<filetolob_function,FILETOLOB Function>>  | Converts data from a 
local linux/hdfs file into LOB format.
+| <<buffertolob_function,BUFFERTOLOB_Function>> | Takes an address and 
a size of an input buffer, and converts the data pointed to by that buffer into 
LOB format.
+| <<externaltolob_function,EXTERNALTOLOB_Function>> | Converts data from 
an external file into LOB format.
+| LOBTOSTRING | Converts LOB data into simple string 
literal.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-18 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157654703
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -213,6 +213,24 @@ corresponding week of the year.
 
 See the individual entry for the function.
 
+[[lob_functions]]
+== LOB Functions
+
+Trafodion provides following LOB functions to process LOB data.
+
+[cols="25%,75%"]
+|===
+| <<emptyblob_function,EMPTY_BLOB() Function>>   | Creates a dummy LOB 
handle with BLOB.
--- End diff --

OK, thanks Dave. :)


---


[GitHub] incubator-trafodion pull request #1354: [TRAFODION-2850] Add a Note for EMPT...

2017-12-18 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1354

[TRAFODION-2850] Add a Note for EMPTY_BLOB() and EMPTY_CLOB() for 
*Trafodion SQL Large Objects Guide*



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

$ git pull https://github.com/liuyu000/incubator-trafodion 
Note_for_EMPTYBLOB

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

https://github.com/apache/incubator-trafodion/pull/1354.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 #1354


commit 083fcb020e53ec0fb4e198059a866c34831e62e3
Author: liu.yu <yu@esgyn.cn>
Date:   2017-12-18T08:08:57Z

Add a Note for EMPTY_BLOB() and EMPTY_CLOB()




---


[GitHub] incubator-trafodion pull request #1350: [TRAFODION-2849] Add BLOB and CLOB f...

2017-12-15 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1350

[TRAFODION-2849] Add BLOB and CLOB for *Trafodion SQL Reference Manual*



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

$ git pull https://github.com/liuyu000/incubator-trafodion SQLLOB

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

https://github.com/apache/incubator-trafodion/pull/1350.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 #1350


commit 3f09ff5ce425cc004009b44bb1e28f7a51663ce8
Author: liu.yu <yu@esgyn.cn>
Date:   2017-12-15T10:28:15Z

Add BLOB and CLOB for *Trafodion SQL Reference Manual*

commit bb6864a78d3922e6d313ce03528d4be25f6e0d88
Author: liu.yu <yu@esgyn.cn>
Date:   2017-12-15T10:34:20Z

Remove redundancies




---


[GitHub] incubator-trafodion pull request #1346: [TRAFODION-2845] Correct the syntax ...

2017-12-14 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1346

[TRAFODION-2845] Correct the syntax descriptions of LOAD Statement for 
*Trafodion SQL Reference Manual*



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

$ git pull https://github.com/liuyu000/incubator-trafodion LoadStatement

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

https://github.com/apache/incubator-trafodion/pull/1346.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 #1346


commit 1006ee725a5f06f327ac650861377a915392da56
Author: liu.yu <yu@esgyn.cn>
Date:   2017-12-15T03:49:10Z

Correct the syntax descriptions of LOAD Statement for *Trafodion SQL 
Reference Manual*




---


[GitHub] incubator-trafodion pull request #1339: [TRAFODION-2842] Correct the descrip...

2017-12-12 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1339

[TRAFODION-2842] Correct the description of connectionTimeout in *Trafodion 
JDBC Type 4 Programmer’s Reference Guide*

-

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

$ git pull https://github.com/liuyu000/incubator-trafodion connectionTimeout

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

https://github.com/apache/incubator-trafodion/pull/1339.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 #1339


commit 6901936a53e3100217fb634d0898ce515def3dc6
Author: liu.yu <yu@esgyn.cn>
Date:   2017-12-13T04:28:16Z

Correct the description of connectionTimeout in *JDBC Type 4 Programmer’s 
Reference Guide*




---


[GitHub] incubator-trafodion pull request #1329: [TRAFODION-2833] Add VARCHAR2 for *T...

2017-12-08 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1329

[TRAFODION-2833] Add VARCHAR2 for *Trafodion SQL Reference Manual*



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

$ git pull https://github.com/liuyu000/incubator-trafodion varchar2

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

https://github.com/apache/incubator-trafodion/pull/1329.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 #1329


commit c87f7f6d277cdaa3bed6f1abc82db0e9c5b75743
Author: liu.yu <yu@esgyn.cn>
Date:   2017-12-08T11:11:21Z

Add VARCHAR2 for *Trafodion SQL Reference Manual*




---


[GitHub] incubator-trafodion pull request #1313: [TRAFODION-2820] Correct some mistak...

2017-11-27 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1313

[TRAFODION-2820] Correct some mistakes (hp) in *Trafodion JDBC Type 4 
Programmer’s Reference Guide*



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

$ git pull https://github.com/liuyu000/incubator-trafodion hptotraf

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

https://github.com/apache/incubator-trafodion/pull/1313.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 #1313


commit 4bbaa871edeaf74d1dfd5ca8b0963c61e707defa
Author: liu.yu <yu@esgyn.cn>
Date:   2017-11-28T06:07:45Z

Correct some mistakes (hp)




---


[GitHub] incubator-trafodion pull request #1309: [TRAFODION-2815] Add/Update Syntax, ...

2017-11-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1309#discussion_r152719226
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -2325,82 +2328,206 @@ following abbreviations:
 
 * `startdate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
 * `enddate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
-The method of counting crossed boundaries such as days, minutes, and
-seconds makes the result given by DATEDIFF consistent across all data
-types. The result is a signed integer value equal to the number of
-datepart boundaries crossed between the first and second date.
-
-For example, the number of weeks between Sunday, January 4, and Sunday,
-January 1 , is 1. The number of months between March 31 and April 1
-would be 1 because the month boundary is crossed from March to April.
-The DATEDIFF function generates an error if the result is out of range
-for integer values. For seconds, the maximum number is equivalent to
-approximately 68 years. The DATEDIFF function generates an error if a
-difference in weeks is requested and one of the two dates precedes
-January 7 of the year 0001.
+[[considerations_for_datediff]]
+=== Considerations for DATEDIFF 
+
+[[boundary]]
+ Boundary
+
+The method of counting crossed boundaries such as days, minutes, and 
seconds makes the result given by DATEDIFF consistent across all data types. 
+
+The result is a signed integer value equal to the number of _datepart_ 
boundaries crossed between _startdate_ and _enddate_, because the DATEDIFF 
function does not calculate the full _datepart_, it counts the difference 
between _startdate_  and _enddate_.
+
+For example:  
+
+* The difference between 2017-12-31 23:59:59 and 2018-01-01 00:00:00 is 
only a single second. 
+
++
+However, the DATEDIFF difference is 1 minute, 1 hour, 1 day, 0 week^1^, 1 
month, 1 quarter or 1 month depending on the specified _datepart_.
+
++
+^1^ NOTE: 2017-12-31 (_startdate_) falls on Sunday which cannot be 
counted. For more information, see <<the_first_day_of_week,The first day of 
week>>.
+
+* Likewise, the difference between 2017-01-01 and 2018-12-31 is almost two 
years.
+
++
+However, the DATEDIFF difference is 1 year if the specified _datepart_ is 
YEAR.
+
+[[the_first_day_of_week]]
+ The first day of week
+
+* This value cannot be specified, the default value is Sunday.
+
+* The DATEDIFF function returns the number of Sundays between _startdate_ 
and _enddate_. This function counts _enddate_ if it falls on Sunday, but 
doesn't count _startdate_ even if it does fall on a Sunday.
+
++
+For example,
+
+** The DATEDIFF difference is 1 between 2017-11-19 and 2017-11-26 if the 
specified _datepart_ is WEEK.
+
+** The DATEDIFF difference is 0 between 2017-11-19 and 2017-11-25 if the 
specified _datepart_ is WEEK.
+
+[[the_first_week_of_year]]
+ The first week of year
+
+This value cannot be specified, the default value is the week in which Jan 
1 occurs.  
+
+[[negative_or_zero]]
+ Negative or zero
+
+If _enddate_ precedes _startdate_, the return value is negative or zero.
+
+[[error]]
+ Error
+
+* The DATEDIFF function generates an error if the result is out of range 
for integer values. 
+
+** For seconds, the maximum number is equivalent to approximately 68 
years. 
+
+** For weeks, if a difference in weeks is requested, one of the two dates 
cannot precede 0001-01-07.
 
 <<<
 [[examples_of_datediff]]
 === Examples of DATEDIFF
 
-* This function returns the value of 0 because no one-second boundaries
-are crossed.
+[[date_difference_in_second]]
+ Date Difference in SECOND
+
+* This function returns the value of 0 because no one-second boundary
+is crossed.
 +
 ```
-DATEDIFF( SECOND
-, TIMESTAMP '2006-09-12 11:59:58.98'
-, TIMESTAMP '2006-09-12 11:59:58.99'
-)
+SELECT DATEDIFF( SECOND
+ , TIMESTAMP '2006-09-12 11:59:58.98'
+ , TIMESTAMP '2006-09-12 11:59:58.99'
+   )
+FROM DUAL;
 ```
 
 * This function returns the value 1 because a one-second boundary is
 crossed even though the two timestamps differ by only one micro

[GitHub] incubator-trafodion pull request #1309: [TRAFODION-2815] Add/Update Syntax, ...

2017-11-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1309#discussion_r152718499
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -2325,82 +2328,206 @@ following abbreviations:
 
 * `startdate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
 * `enddate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
-The method of counting crossed boundaries such as days, minutes, and
-seconds makes the result given by DATEDIFF consistent across all data
-types. The result is a signed integer value equal to the number of
-datepart boundaries crossed between the first and second date.
-
-For example, the number of weeks between Sunday, January 4, and Sunday,
-January 1 , is 1. The number of months between March 31 and April 1
-would be 1 because the month boundary is crossed from March to April.
-The DATEDIFF function generates an error if the result is out of range
-for integer values. For seconds, the maximum number is equivalent to
-approximately 68 years. The DATEDIFF function generates an error if a
-difference in weeks is requested and one of the two dates precedes
-January 7 of the year 0001.
+[[considerations_for_datediff]]
+=== Considerations for DATEDIFF 
+
+[[boundary]]
+ Boundary
+
+The method of counting crossed boundaries such as days, minutes, and 
seconds makes the result given by DATEDIFF consistent across all data types. 
+
+The result is a signed integer value equal to the number of _datepart_ 
boundaries crossed between _startdate_ and _enddate_, because the DATEDIFF 
function does not calculate the full _datepart_, it counts the difference 
between _startdate_  and _enddate_.
+
+For example:  
+
+* The difference between 2017-12-31 23:59:59 and 2018-01-01 00:00:00 is 
only a single second. 
+
++
+However, the DATEDIFF difference is 1 minute, 1 hour, 1 day, 0 week^1^, 1 
month, 1 quarter or 1 month depending on the specified _datepart_.
+
++
+^1^ NOTE: 2017-12-31 (_startdate_) falls on Sunday which cannot be 
counted. For more information, see <<the_first_day_of_week,The first day of 
week>>.
+
+* Likewise, the difference between 2017-01-01 and 2018-12-31 is almost two 
years.
+
++
+However, the DATEDIFF difference is 1 year if the specified _datepart_ is 
YEAR.
+
+[[the_first_day_of_week]]
+ The first day of week
+
+* This value cannot be specified, the default value is Sunday.
+
+* The DATEDIFF function returns the number of Sundays between _startdate_ 
and _enddate_. This function counts _enddate_ if it falls on Sunday, but 
doesn't count _startdate_ even if it does fall on a Sunday.
+
++
+For example,
+
+** The DATEDIFF difference is 1 between 2017-11-19 and 2017-11-26 if the 
specified _datepart_ is WEEK.
+
+** The DATEDIFF difference is 0 between 2017-11-19 and 2017-11-25 if the 
specified _datepart_ is WEEK.
+
+[[the_first_week_of_year]]
+ The first week of year
+
+This value cannot be specified, the default value is the week in which Jan 
1 occurs.  
+
+[[negative_or_zero]]
+ Negative or zero
+
+If _enddate_ precedes _startdate_, the return value is negative or zero.
+
+[[error]]
+ Error
+
+* The DATEDIFF function generates an error if the result is out of range 
for integer values. 
+
+** For seconds, the maximum number is equivalent to approximately 68 
years. 
+
+** For weeks, if a difference in weeks is requested, one of the two dates 
cannot precede 0001-01-07.
 
 <<<
 [[examples_of_datediff]]
 === Examples of DATEDIFF
 
-* This function returns the value of 0 because no one-second boundaries
-are crossed.
+[[date_difference_in_second]]
+ Date Difference in SECOND
+
+* This function returns the value of 0 because no one-second boundary
+is crossed.
 +
 ```
-DATEDIFF( SECOND
-, TIMESTAMP '2006-09-12 11:59:58.98'
-, TIMESTAMP '2006-09-12 11:59:58.99'
-)
+SELECT DATEDIFF( SECOND
+ , TIMESTAMP '2006-09-12 11:59:58.98'
+ , TIMESTAMP '2006-09-12 11:59:58.99'
+   )
+FROM DUAL;
 ```
 
 * This function returns the value 1 because a one-second boundary is
 crossed even though the two timestamps differ by only one micro

[GitHub] incubator-trafodion pull request #1309: [TRAFODION-2815] Add/Update Syntax, ...

2017-11-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1309#discussion_r152715161
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -2325,82 +2328,206 @@ following abbreviations:
 
 * `startdate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
 * `enddate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
-The method of counting crossed boundaries such as days, minutes, and
-seconds makes the result given by DATEDIFF consistent across all data
-types. The result is a signed integer value equal to the number of
-datepart boundaries crossed between the first and second date.
-
-For example, the number of weeks between Sunday, January 4, and Sunday,
-January 1 , is 1. The number of months between March 31 and April 1
-would be 1 because the month boundary is crossed from March to April.
-The DATEDIFF function generates an error if the result is out of range
-for integer values. For seconds, the maximum number is equivalent to
-approximately 68 years. The DATEDIFF function generates an error if a
-difference in weeks is requested and one of the two dates precedes
-January 7 of the year 0001.
+[[considerations_for_datediff]]
+=== Considerations for DATEDIFF 
+
+[[boundary]]
+ Boundary
+
+The method of counting crossed boundaries such as days, minutes, and 
seconds makes the result given by DATEDIFF consistent across all data types. 
+
+The result is a signed integer value equal to the number of _datepart_ 
boundaries crossed between _startdate_ and _enddate_, because the DATEDIFF 
function does not calculate the full _datepart_, it counts the difference 
between _startdate_  and _enddate_.
+
+For example:  
+
+* The difference between 2017-12-31 23:59:59 and 2018-01-01 00:00:00 is 
only a single second. 
+
++
+However, the DATEDIFF difference is 1 minute, 1 hour, 1 day, 0 week^1^, 1 
month, 1 quarter or 1 month depending on the specified _datepart_.
+
++
+^1^ NOTE: 2017-12-31 (_startdate_) falls on Sunday which cannot be 
counted. For more information, see <<the_first_day_of_week,The first day of 
week>>.
+
+* Likewise, the difference between 2017-01-01 and 2018-12-31 is almost two 
years.
+
++
+However, the DATEDIFF difference is 1 year if the specified _datepart_ is 
YEAR.
+
+[[the_first_day_of_week]]
+ The first day of week
+
+* This value cannot be specified, the default value is Sunday.
+
+* The DATEDIFF function returns the number of Sundays between _startdate_ 
and _enddate_. This function counts _enddate_ if it falls on Sunday, but 
doesn't count _startdate_ even if it does fall on a Sunday.
+
++
+For example,
+
+** The DATEDIFF difference is 1 between 2017-11-19 and 2017-11-26 if the 
specified _datepart_ is WEEK.
+
+** The DATEDIFF difference is 0 between 2017-11-19 and 2017-11-25 if the 
specified _datepart_ is WEEK.
+
+[[the_first_week_of_year]]
+ The first week of year
+
+This value cannot be specified, the default value is the week in which Jan 
1 occurs.  
--- End diff --

Thanks Dave, your comments have been incorporated. :)


---


[GitHub] incubator-trafodion pull request #1309: [TRAFODION-2815] Add/Update Syntax, ...

2017-11-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1309#discussion_r152715132
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -2325,82 +2328,206 @@ following abbreviations:
 
 * `startdate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
 * `enddate`
 +
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
 See <<datetime_value_expressions,Datetime Value Expressions>>.
 
-The method of counting crossed boundaries such as days, minutes, and
-seconds makes the result given by DATEDIFF consistent across all data
-types. The result is a signed integer value equal to the number of
-datepart boundaries crossed between the first and second date.
-
-For example, the number of weeks between Sunday, January 4, and Sunday,
-January 1 , is 1. The number of months between March 31 and April 1
-would be 1 because the month boundary is crossed from March to April.
-The DATEDIFF function generates an error if the result is out of range
-for integer values. For seconds, the maximum number is equivalent to
-approximately 68 years. The DATEDIFF function generates an error if a
-difference in weeks is requested and one of the two dates precedes
-January 7 of the year 0001.
+[[considerations_for_datediff]]
+=== Considerations for DATEDIFF 
+
+[[boundary]]
+ Boundary
+
+The method of counting crossed boundaries such as days, minutes, and 
seconds makes the result given by DATEDIFF consistent across all data types. 
+
+The result is a signed integer value equal to the number of _datepart_ 
boundaries crossed between _startdate_ and _enddate_, because the DATEDIFF 
function does not calculate the full _datepart_, it counts the difference 
between _startdate_  and _enddate_.
+
+For example:  
+
+* The difference between 2017-12-31 23:59:59 and 2018-01-01 00:00:00 is 
only a single second. 
+
++
+However, the DATEDIFF difference is 1 minute, 1 hour, 1 day, 0 week^1^, 1 
month, 1 quarter or 1 month depending on the specified _datepart_.
+
++
+^1^ NOTE: 2017-12-31 (_startdate_) falls on Sunday which cannot be 
counted. For more information, see <<the_first_day_of_week,The first day of 
week>>.
--- End diff --

Thanks Dave, your comments have been incorporated. :)


---


[GitHub] incubator-trafodion pull request #1309: [TRAFODION-2815] Add/Update Syntax, ...

2017-11-21 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1309

[TRAFODION-2815] Add/Update Syntax, Consideration and Example of *DATEDIFF 
Function* for *Trafodion SQL Reference Manual*

-

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

$ git pull https://github.com/liuyu000/incubator-trafodion DATEDIFF

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

https://github.com/apache/incubator-trafodion/pull/1309.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 #1309


commit 1df5707278afb5944e3cec04dee82c924cd339a0
Author: liu.yu <yu@esgyn.cn>
Date:   2017-11-22T03:50:44Z

Add/Update Syntax, Consideration and Example for *DATEDIFF Function* for 
*Trafodion SQL Reference Manual*




---


[GitHub] incubator-trafodion pull request #1295: [TRAFODION-2794] Add *DIVISION BY (C...

2017-11-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1295#discussion_r151065267
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -3308,6 +3343,43 @@ SELECT * FROM T WHERE b = 'A';
 SELECT * FROM T WHERE b = 'A' (not casespecific);
 ```
 
+* This is the 1^st^ example of DIVISION BY usage.
++
+```
+CREATE TABLE call_home_data
+(id LARGEINT NOT NULL,
+ts TIMESTAMP(6) NOT NULL,
+device_status VARCHAR(200),
+PRIMARY KEY (id, ts))
+SALT USING 16 PARTITIONS ON (id)
+DIVISION BY (date_trunc('day', ts));
+```
+
+* This is the 2^nd^ example of DIVISION BY usage.
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1295: [TRAFODION-2794] Add *DIVISION BY (C...

2017-11-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1295#discussion_r151065344
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -3308,6 +3343,43 @@ SELECT * FROM T WHERE b = 'A';
 SELECT * FROM T WHERE b = 'A' (not casespecific);
 ```
 
+* This is the 1^st^ example of DIVISION BY usage.
++
+```
+CREATE TABLE call_home_data
+(id LARGEINT NOT NULL,
+ts TIMESTAMP(6) NOT NULL,
+device_status VARCHAR(200),
+PRIMARY KEY (id, ts))
+SALT USING 16 PARTITIONS ON (id)
+DIVISION BY (date_trunc('day', ts));
+```
+
+* This is the 2^nd^ example of DIVISION BY usage.
++
+```
+CREATE TABLE sales1
+(store_id INT NOT NULL,
+item_id  INT NOT NULL,
+sale_date DATE DEFAULT DATE '2000-01-01' NOT NULL,
+sale_amt NUMERIC(10,2),
+PRIMARY KEY (store_id, item_id, sale_date))
+DIVISION BY (DATEDIFF(YEAR, '2017-11-02', sale_date));
+```
+
+* This is the 3^rd^ example of DIVISION BY usage.
--- End diff --

Thanks for your details.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1295: [TRAFODION-2794] Add *DIVISION BY (C...

2017-11-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1295#discussion_r151065104
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -2816,6 +2817,38 @@ Considerations for LOAD IF EXISTS and NO LOAD 
options of CREATE TABLE AS>>.
 +
 specifies a select query which is used to populate the created table. A 
select query can be any SQL select statement.
 
+* `_division-expr-list_`
++
+is a list of expressions that can only refer to primary key or STORE BY 
columns.
+
++
+The followings are allowed expressions in the DIVISON BY clause, they are 
monotonically increasing expressions:
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1295: [TRAFODION-2794] Add *DIVISION BY (C...

2017-11-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1295#discussion_r151065065
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -2573,7 +2573,7 @@ DATE_PART('year', date'12/05/2006')
 DATE_PART('day', TIMESTAMP '2006-12-31 11:59:59.99')
 ```
 
-* This function returns the value 201 07.
+* This function returns the value 2011 07.
--- End diff --

Thanks for your reminding, yes it returns 201107. 
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1295: [TRAFODION-2794] Add *DIVISION BY (C...

2017-11-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1295#discussion_r151065116
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -3308,6 +3343,43 @@ SELECT * FROM T WHERE b = 'A';
 SELECT * FROM T WHERE b = 'A' (not casespecific);
 ```
 
+* This is the 1^st^ example of DIVISION BY usage.
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1295: [TRAFODION-2794] Add *DIVISION BY (C...

2017-11-10 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1295

[TRAFODION-2794] Add *DIVISION BY (CREATE TABLE Statement)* for *Trafodion 
SQL Reference Manual* + Fix some Typos

-

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

$ git pull https://github.com/liuyu000/incubator-trafodion 
DivisionBy_CreateTableStatement

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

https://github.com/apache/incubator-trafodion/pull/1295.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 #1295


commit 87a993756b21a9efae2a6ebe09afcde792ca01cf
Author: liu.yu <yu@esgyn.cn>
Date:   2017-11-10T09:08:30Z

Add Division By for *Create Table Statement* and Fix some typos




---


[GitHub] incubator-trafodion pull request #1247: [TRAFODION-2755] Create *Trafodion S...

2017-10-10 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1247#discussion_r143653865
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/working_with_lob.adoc ---
@@ -751,4 +751,380 @@ CQD `LOB_MAX_SIZE` (default 10G expressed in M 
[1M]).
 
 * Extract Target Locations
 +
-The file to extract to can be a local linux file or a local HDFS file.
\ No newline at end of file
+The file to extract to can be a local linux file or a local HDFS file.
+
+[#deleting column from a sql table containing lob columns]
+== Deleting Column from a SQL Table Containing LOB columns
+
+[#syntax]
+=== Syntax
+
+```
+DELETE lob-column-name FROM table-name [WHERE CLAUSE]
+```
+
+[#considerations]
+=== Considerations
+
+When one or more rows containing LOB columns are deleted from LOB table, 
only the metadata information is dropped and the hdfs data remains as it is. 
The references to the lob data are removed from the lob descriptor file. 
+
+This mechanism has not been implemented yet as a separate utility but it 
is triggered as a part of insert, update and append operations. For more 
information, see <>.
+
+[#dropping a sql table containing lob columns ]
+== Dropping a SQL Table Containing LOB Columns 
+
+Drop works like any other drop table. All dependent tables are deleted. 
All files in hdfs (data and descriptor) files are also deleted.
+
+For more information, see <<drop_table_statement,DROP TABLE Statement>> in 
http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion 
SQL Reference Manual].
+
+[#garbage collection]
+== Garbage Collection
+
+When a lob datafile for a column has reached a certain limit, defined by a 
CQD `LOB_GC_LIMIT_SIZE`, then a compaction is triggered automatically. +
+The default GC Limit is 10GB and can be changed if needed. 
+
+The need for GC arises because when a delete operation or an update 
operation is performed, the old data black in the hdfs file will be left as 
unused. +
+In the case of update, the old data will be left as unused and the new 
data will be written into a new section, so all these “holes” in the LOB 
data file are needlessly occupying space. 
+
+The LOB descriptor chunks file is looked at to see which ranges and 
offsets are actually used. The LOB datafile is temporarily saved. The 
compaction is done into a new tempfile. When the sections have all been copied 
into the tempfile, Trafodion will delete the existing lob data file and rename 
the tempfile. 
+
+Finally, the saved copy of the LOB datafile is dropped. The saved copy is 
there just in case you need to fall back to it in case of an error. Since this 
operation is triggered as part of an IUD operation, a definite slowdown will 
occur for that insert/update operation compared to subsequent inserts/updates. 
+
+Also, each lob column of a table can be compacted separately as needed. GC 
does not have to be done to all columns of the LOB table all at once. 
+
+NOTE: Currently the GC is done in the same transaction as the transaction 
being used for the insert or update operation. If any part of the GC fails, 
then the entire transaction is aborted. 
+
+When Trafodion has support for local transactions, Trafodion will do the 
GC in a separate transaction or in a separate process, so you can fail the GC 
with a warning and allow the insert to go through. 
+
+Setting the CQD `LOB_GC_LIMIT_SIZE` to 0 would prevent GC from occurring.
+
+[#cleanup of a sql table containing lob columns]
+== Cleanup of a SQL Table Containing LOB Columns
+
+Cleanup works like cleanup of any other table. The command ensures all 
dependent SQL LOB tables and hdfs files are dropped ignoring errors if any.
+
+For more information, see <<cleanup_statement,CLEANUP Statement>> in 
http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion 
SQL Reference Manual].
+
+[#showddl for lob]
+== SHOWDDL for LOB
+
+SHOWDDL for LOB with a special option will show all the dependent objects, 
names and details about the table.
+
+[#syntax]
+=== Syntax
+
+```
+SHOWDDL table-name, LOB DETAILS
+```
+
+[#examples]
+=== Examples
+
+* This example displays the details of the table t1ob1.
+
++
+
+```
+>>SHOWDDL tlob1, LOB DETAILS;
+CREATE TABLE TRAFODION.SEABASE.TLOB1
+  (
+C1   INT NO DEFAULT NOT NULL NOT DROPPABLE 
SERIALIZED
+  , C2   BLOB DEFAULT NULL NOT SERIALIZED
+  , PRIMARY KEY (C1 ASC)
+  )
+;
+
+LOB Metadata
+
+
+CREATE TABLE TRAFODION.SEABASE.LOBMD_042390919

[GitHub] incubator-trafodion pull request #1247: [TRAFODION-2755] Create *Trafodion S...

2017-10-10 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1247#discussion_r143653877
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/working_with_lob.adoc ---
@@ -751,4 +751,380 @@ CQD `LOB_MAX_SIZE` (default 10G expressed in M 
[1M]).
 
 * Extract Target Locations
 +
-The file to extract to can be a local linux file or a local HDFS file.
\ No newline at end of file
+The file to extract to can be a local linux file or a local HDFS file.
+
+[#deleting column from a sql table containing lob columns]
+== Deleting Column from a SQL Table Containing LOB columns
+
+[#syntax]
+=== Syntax
+
+```
+DELETE lob-column-name FROM table-name [WHERE CLAUSE]
+```
+
+[#considerations]
+=== Considerations
+
+When one or more rows containing LOB columns are deleted from LOB table, 
only the metadata information is dropped and the hdfs data remains as it is. 
The references to the lob data are removed from the lob descriptor file. 
+
+This mechanism has not been implemented yet as a separate utility but it 
is triggered as a part of insert, update and append operations. For more 
information, see <>.
+
+[#dropping a sql table containing lob columns ]
+== Dropping a SQL Table Containing LOB Columns 
+
+Drop works like any other drop table. All dependent tables are deleted. 
All files in hdfs (data and descriptor) files are also deleted.
+
+For more information, see <<drop_table_statement,DROP TABLE Statement>> in 
http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion 
SQL Reference Manual].
+
+[#garbage collection]
+== Garbage Collection
+
+When a lob datafile for a column has reached a certain limit, defined by a 
CQD `LOB_GC_LIMIT_SIZE`, then a compaction is triggered automatically. +
+The default GC Limit is 10GB and can be changed if needed. 
+
+The need for GC arises because when a delete operation or an update 
operation is performed, the old data black in the hdfs file will be left as 
unused. +
+In the case of update, the old data will be left as unused and the new 
data will be written into a new section, so all these “holes” in the LOB 
data file are needlessly occupying space. 
+
+The LOB descriptor chunks file is looked at to see which ranges and 
offsets are actually used. The LOB datafile is temporarily saved. The 
compaction is done into a new tempfile. When the sections have all been copied 
into the tempfile, Trafodion will delete the existing lob data file and rename 
the tempfile. 
+
+Finally, the saved copy of the LOB datafile is dropped. The saved copy is 
there just in case you need to fall back to it in case of an error. Since this 
operation is triggered as part of an IUD operation, a definite slowdown will 
occur for that insert/update operation compared to subsequent inserts/updates. 
+
+Also, each lob column of a table can be compacted separately as needed. GC 
does not have to be done to all columns of the LOB table all at once. 
+
+NOTE: Currently the GC is done in the same transaction as the transaction 
being used for the insert or update operation. If any part of the GC fails, 
then the entire transaction is aborted. 
+
+When Trafodion has support for local transactions, Trafodion will do the 
GC in a separate transaction or in a separate process, so you can fail the GC 
with a warning and allow the insert to go through. 
+
+Setting the CQD `LOB_GC_LIMIT_SIZE` to 0 would prevent GC from occurring.
+
+[#cleanup of a sql table containing lob columns]
+== Cleanup of a SQL Table Containing LOB Columns
+
+Cleanup works like cleanup of any other table. The command ensures all 
dependent SQL LOB tables and hdfs files are dropped ignoring errors if any.
+
+For more information, see <<cleanup_statement,CLEANUP Statement>> in 
http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion 
SQL Reference Manual].
+
+[#showddl for lob]
+== SHOWDDL for LOB
+
+SHOWDDL for LOB with a special option will show all the dependent objects, 
names and details about the table.
+
+[#syntax]
+=== Syntax
+
+```
+SHOWDDL table-name, LOB DETAILS
+```
+
+[#examples]
+=== Examples
+
+* This example displays the details of the table t1ob1.
+
++
+
+```
+>>SHOWDDL tlob1, LOB DETAILS;
+CREATE TABLE TRAFODION.SEABASE.TLOB1
+  (
+C1   INT NO DEFAULT NOT NULL NOT DROPPABLE 
SERIALIZED
+  , C2   BLOB DEFAULT NULL NOT SERIALIZED
+  , PRIMARY KEY (C1 ASC)
+  )
+;
+
+LOB Metadata
+
+
+CREATE TABLE TRAFODION.SEABASE.LOBMD_042390919

[GitHub] incubator-trafodion pull request #1243: [TRAFODION-2744] Correct the Descrip...

2017-10-10 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1243#discussion_r143638994
  
--- Diff: docs/odb_user/src/asciidoc/_chapters/load.adoc ---
@@ -117,7 +117,7 @@ If you add a `+` sign in front of the file-name, odb  
*appends* to ``inste
  +
 - one thread to read from the input file and +
 - as many threads as the parallel argument to write via ODBC. This option 
is database independent.
-| `errmax=num` | odb prints up to num error messages per rowset. Normally 
used with soe to limit the number of error messages printed to the standard 
error
+| `errmax=num` | odb prints up to num error messages per rowset. Normally 
used with soe to limit the number of error messages printed to the standard 
error.
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1243: [TRAFODION-2744] Correct the Descrip...

2017-10-09 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1243#discussion_r143626661
  
--- Diff: docs/odb_user/src/asciidoc/_chapters/load.adoc ---
@@ -1080,24 +1080,54 @@ define the size of this buffer in two different 
ways: +
 | `ifempty` | Loads the target table only if empty.
 | `nomark` | Don’t print the number of records loaded so far during 
loads.
 | `soe` | Stop On Error. odb stops as soon as it encounters an error.
-| `parallel=num` | odb uses as many threads as the parallel argument to 
extract data from partitioned source tables
-*PLUS* an equivalent number of threads to write to the target table. +
- +
- *Example* +
-  +
-If you specify `parallel=4` and the source table is made of 32 partitions, 
then odb start *four* threads
-(four ODBC connections) to read from the source table *PLUS* four threads 
(four ODBC connections) to write to the target table: +
- +
-- thread 0 extracts partitions 0-7 from source +
-- thread 1 writes data extracted from thread 0 to target +
-- thread 2 extracts partitions 8-15 from source +
-- thread 3 writes data extracted from thread 2 to target +
-- thread 4 extracts partitions 16-23 from source +
-- thread 5 writes data extracted from thread 4 to target +
-- thread 6 extracts partitions 24-31 from source +
-- thread 7 writes data extracted from thread 6 to target +
- +
-*You have to specify `splitby`.*
+| `parallel=num` | odb uses two kinds of threads: +
+
+ To extract data from partitioned source table. +
+The number of the threads is as many as the parallel argument. +
+
+ To write data to the target table. +
+The number of the threads is equal to *parallel argument* * *number of 
loaders*. + 
   
+
+*Example* 
+
+If you specify parallel argument = 4 and the source table is made of 32 
partitions, then odb start: +
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1247: [TRAFODION-2755] Create *Trafodion S...

2017-10-09 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1247#discussion_r143623072
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/working_with_lob.adoc ---
@@ -751,4 +751,380 @@ CQD `LOB_MAX_SIZE` (default 10G expressed in M 
[1M]).
 
 * Extract Target Locations
 +
-The file to extract to can be a local linux file or a local HDFS file.
\ No newline at end of file
+The file to extract to can be a local linux file or a local HDFS file.
+
+[#deleting column from a sql table containing lob columns]
+== Deleting Column from a SQL Table Containing LOB columns
+
+[#syntax]
+=== Syntax
+
+```
+DELETE lob-column-name FROM table-name [WHERE CLAUSE]
+```
+
+[#considerations]
+=== Considerations
+
+When one or more rows containing LOB columns are deleted from LOB table, 
only the metadata information is dropped and the hdfs data remains as it is. 
The references to the lob data are removed from the lob descriptor file. 
+
+This mechanism has not been implemented yet as a separate utility but it 
is triggered as a part of insert, update and append operations. For more 
information, see <>.
+
+[#dropping a sql table containing lob columns ]
+== Dropping a SQL Table Containing LOB Columns 
+
+Drop works like any other drop table. All dependent tables are deleted. 
All files in hdfs (data and descriptor) files are also deleted.
+
+For more information, see <<drop_table_statement,DROP TABLE Statement>> in 
http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion 
SQL Reference Manual].
+
+[#garbage collection]
+== Garbage Collection
+
+When a lob datafile for a column has reached a certain limit, defined by a 
CQD `LOB_GC_LIMIT_SIZE`, then a compaction is triggered automatically. +
+The default GC Limit is 10GB and can be changed if needed. 
+
+The need for GC arises because when a delete operation or an update 
operation is performed, the old data black in the hdfs file will be left as 
unused. +
+In the case of update, the old data will be left as unused and the new 
data will be written into a new section, so all these “holes” in the LOB 
data file are needlessly occupying space. 
+
+The LOB descriptor chunks file is looked at to see which ranges and 
offsets are actually used. The LOB datafile is temporarily saved. The 
compaction is done into a new tempfile. When the sections have all been copied 
into the tempfile, Trafodion will delete the existing lob data file and rename 
the tempfile. 
+
+Finally, the saved copy of the LOB datafile is dropped. The saved copy is 
there just in case you need to fall back to it in case of an error. Since this 
operation is triggered as part of an IUD operation, a definite slowdown will 
occur for that insert/update operation compared to subsequent inserts/updates. 
+
+Also, each lob column of a table can be compacted separately as needed. GC 
does not have to be done to all columns of the LOB table all at once. 
+
+NOTE: Currently the GC is done in the same transaction as the transaction 
being used for the insert or update operation. If any part of the GC fails, 
then the entire transaction is aborted. 
+
+When Trafodion has support for local transactions, Trafodion will do the 
GC in a separate transaction or in a separate process, so you can fail the GC 
with a warning and allow the insert to go through. 
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1247: [TRAFODION-2755] Create *Trafodion S...

2017-10-09 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1247#discussion_r143622870
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/working_with_lob.adoc ---
@@ -751,4 +751,380 @@ CQD `LOB_MAX_SIZE` (default 10G expressed in M 
[1M]).
 
 * Extract Target Locations
 +
-The file to extract to can be a local linux file or a local HDFS file.
\ No newline at end of file
+The file to extract to can be a local linux file or a local HDFS file.
+
+[#deleting column from a sql table containing lob columns]
+== Deleting Column from a SQL Table Containing LOB columns
+
+[#syntax]
+=== Syntax
+
+```
+DELETE lob-column-name FROM table-name [WHERE CLAUSE]
+```
+
+[#considerations]
+=== Considerations
+
+When one or more rows containing LOB columns are deleted from LOB table, 
only the metadata information is dropped and the hdfs data remains as it is. 
The references to the lob data are removed from the lob descriptor file. 
+
+This mechanism has not been implemented yet as a separate utility but it 
is triggered as a part of insert, update and append operations. For more 
information, see <>.
+
+[#dropping a sql table containing lob columns ]
+== Dropping a SQL Table Containing LOB Columns 
+
+Drop works like any other drop table. All dependent tables are deleted. 
All files in hdfs (data and descriptor) files are also deleted.
+
+For more information, see <<drop_table_statement,DROP TABLE Statement>> in 
http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion 
SQL Reference Manual].
+
+[#garbage collection]
+== Garbage Collection
+
+When a lob datafile for a column has reached a certain limit, defined by a 
CQD `LOB_GC_LIMIT_SIZE`, then a compaction is triggered automatically. +
+The default GC Limit is 10GB and can be changed if needed. 
+
+The need for GC arises because when a delete operation or an update 
operation is performed, the old data black in the hdfs file will be left as 
unused. +
+In the case of update, the old data will be left as unused and the new 
data will be written into a new section, so all these “holes” in the LOB 
data file are needlessly occupying space. 
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1247: [TRAFODION-2755] Create *Trafodion S...

2017-10-09 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1247#discussion_r143622658
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/working_with_lob.adoc ---
@@ -751,4 +751,380 @@ CQD `LOB_MAX_SIZE` (default 10G expressed in M 
[1M]).
 
 * Extract Target Locations
 +
-The file to extract to can be a local linux file or a local HDFS file.
\ No newline at end of file
+The file to extract to can be a local linux file or a local HDFS file.
+
+[#deleting column from a sql table containing lob columns]
+== Deleting Column from a SQL Table Containing LOB columns
+
+[#syntax]
+=== Syntax
+
+```
+DELETE lob-column-name FROM table-name [WHERE CLAUSE]
+```
+
+[#considerations]
+=== Considerations
+
+When one or more rows containing LOB columns are deleted from LOB table, 
only the metadata information is dropped and the hdfs data remains as it is. 
The references to the lob data are removed from the lob descriptor file. 
+
+This mechanism has not been implemented yet as a separate utility but it 
is triggered as a part of insert, update and append operations. For more 
information, see <>.
+
+[#dropping a sql table containing lob columns ]
+== Dropping a SQL Table Containing LOB Columns 
+
+Drop works like any other drop table. All dependent tables are deleted. 
All files in hdfs (data and descriptor) files are also deleted.
+
+For more information, see <<drop_table_statement,DROP TABLE Statement>> in 
http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion 
SQL Reference Manual].
+
+[#garbage collection]
+== Garbage Collection
+
+When a lob datafile for a column has reached a certain limit, defined by a 
CQD `LOB_GC_LIMIT_SIZE`, then a compaction is triggered automatically. +
+The default GC Limit is 10GB and can be changed if needed. 
--- End diff --

Thanks Dave.
I've corrected. :) 


---


[GitHub] incubator-trafodion pull request #1247: [TRAFODION-2755] Create *Trafodion S...

2017-09-28 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1247

[TRAFODION-2755] Create *Trafodion SQL Large Objects Guide* 2



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

$ git pull https://github.com/liuyu000/incubator-trafodion lob2

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

https://github.com/apache/incubator-trafodion/pull/1247.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 #1247


commit 07226cf18c07516acc49aef12480d39c16876a1c
Author: liu.yu <yu@esgyn.cn>
Date:   2017-09-28T08:26:58Z

Add Chapter 2, Section 2.7 - 2.12




---


[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-25 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140945525
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1243: [TRAFODION-2744] Correct the Descrip...

2017-09-25 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1243

[TRAFODION-2744] Correct the Descriptions and Example of *parallel=num 
(Copy Operators)* in *Trafodion ODB User Guide**



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

$ git pull https://github.com/liuyu000/incubator-trafodion threads

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

https://github.com/apache/incubator-trafodion/pull/1243.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 #1243


commit 245fa4fff91ba7c13d3d70f160c92d64e5ad1303
Author: liu.yu <yu@esgyn.cn>
Date:   2017-09-25T13:38:36Z

Correct the Descriptions and Example of *parallel=num (Copy Operators)*




---


[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140444657
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140177394
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140176015
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140175779
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140168341
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
--- End diff --

Thanks Dave! :)
I've corrected.


---


[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140166131
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
--- End diff --

Thanks Dave! :)
I've corrected.


---


[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r140161665
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
--- End diff --

Thanks for the detailed explanation! :)
I've changed to "How to work with LOBs".


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139303434
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139303423
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139303401
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139303398
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139303375
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139302835
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139302837
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139302827
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139302735
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-17 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139302665
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-16 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139301423
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-16 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139301178
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-16 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139300972
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
--- End diff --

Thanks Dave. :)

I'm planning to change it to:

insert-source is: 
VALUES(column-expr[, column-expr]…) 

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139076734
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
--- End diff --

Thanks Dave, for your eagle eyes.
Yes, I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139076558
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
--- End diff --

Thanks Dave.
Yes, I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-15 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139075962
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
--- End diff --

Thanks Dave, I've corrected. :)



---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-14 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139053292
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
--- End diff --

1. STORAGE clause 

Syntax:
...
lob-type is:
BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
...

So the STORAGE clause is optional, it's ok if you don't specify it (the 
attachment
![create a sql table with lob 
columns](https://user-images.githubusercontent.com/20532956/30423142-8cfd079a-9974-11e7-9eb9-151183271ee5.jpg)
).

2.  limit on LOB size
I've asked Sandhya the some question, the answer from her:

Minimum size:
We allow for an “empty” LOB so technically that’s a  0 length lob. 
We can insert using empty_blob(), empty_clob()  syntax.

Maxmum size:
Currently this is set to 10GB and it's controlled by the CQD LOB_MAX_SIZE. 
But this can be changed depending on the customers needs to whatever they 
want. 
There isn’t a real limit as such so we could go to 8 terabytes if needed 
but the user will have to configure enough HDFS disks to be able to support 
such a large LOB and several of them potentially. 


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-14 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138845773
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
--- End diff --

Thanks Dave! :)

I'm planning to change it to:

CREATE TABLE table-name (column-spec[, column-spec]…)

column-spec is:
lob-column-spec  | 
other-column-spec

lob-column-spec is:
column-name {lob-data-type} [column-constraint]

other-column-spec is:
column-name {data-type} [column-constraint]

lob-type is:
BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']

...

Any comments?


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138796677
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
--- End diff --

Thanks Dave.

Using gerund or verb (base) in title/headline is a style issue that should 
be followed consistently.

Gerundive (continuous) form is common in title and verb form seems more 
imperative, but given that 
1. the topic title plays a huge role in the search results
2. Trafodion has many users of non-native English speakers

I think the verb form might be better as it more likely to match what 
people will search for, and uses the more familiar form of the verb. 

Any thoughts?


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138785512
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/introduction.adoc ---
@@ -0,0 +1,152 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#introduction]
+= Introduction
+
+[#what is a lOB]
+== What is a LOB
+
+LOB (Large Object), a set of large object data types used to store large 
volumes of data, provides random and piece-wise access to the data. 
+
+Database support for LOB is not universal.
+
+[#lob data types]
+== LOB Data Types
+
+The following are the data types supported by Trafodion. +
+
+
+[caption="Table 1-1 "]
+.Descriptions for BLOB and CLOB
+[cols="30%,70%",options="header"]
+|===
+| *Data Type* | *Desciprtion*
+| BLOB| Binary Large Object. + 
+
+Holds large blocks of unstructured data in binary format. +
+
+BLOB is ideal for storing and handling unstructured data, such as images, 
audio, video and other multimedia objects.
+| CLOB| Character Large Object. +
+
+Stores unusually large amounts of string data in character set format. +
+
+CLOB is ideal for storing and processing semi-structured data, such as a 
large document or string.
+|===
+
+[#lob storage]
+== LOB Storage
+
+The basic design idea is to allow a database row to have multiple LOB 
columns and a table to have multiple such rows. The design takes a combination 
approach of row store and column store. 
+
+When a SQL table with a LOB column is created, there are several dependent 
objects that are created to hold metadata information on the LOB as well as the 
data.
+
+The LOB data itself is stored in an HDFS file while the Trafodion table 
contains a unique LOB handle for each LOB value. The LOB handle provides the 
identifier that is used to query the LOB metadata tables to find the location 
of the LOB data files.
+
+The naming conventions for the LOB tables are as follows: 
+[caption="Table 1-2 "]
+.Naming Conventions for LOB Tables
+[cols="2*",options="header"]
+|===
+2+|*Naming Conventions*
+| SQL Table| TLOB 
+| LOB MD table +
+(one per SQL table containing LOB columns)
+   | LOBMD_{object UID}
+| LOB Descriptor Handle Table +
+(one per LOB column)
+   | LOBDescHandle_{object UID}_{LOB number}
+| LOB Descriptor Chunks Table +
+(one per LOB column)
+   | LOBDescChunks_{object UID}_{LOB number}
+| LOB Data Table + 
+(in HDFS one per LOB column)
+   | LOBP_{object UID}_{LOB number}
+|===
+
+[#lob handle]
+== LOB Handle
+
+The LOB handle is used to describe a LOB value. A SQL table that contains 
a LOB column will contain this handle structure in each row for each LOB value 
inserted.
+
+The actual LOB data will be stored in unstructured HDFS files as column 
store whereas the LOB handle—that describes the location, offset information, 
descriptor information and so on can be thought of as a unique identifier to 
the lob data, is stored in the database row of the table as a traditional row 
store. 
+
+The handle can be thought of as a file locator as is more commonly 
referred to in LOB related terminology. 
+
+[#external structure]
+=== External Structure
+
+The following is an external structure that is stored in the row of a SQL 
table:
+

+LOBH0002000100047335557604604880171074381106028370118212279894381354363017"TRAFODION"."SCH"
+
+[#lob restrictions]
+== LOB Restrictions
+
+* LOB columns cannot appear in FROM clauses as join predicates.
+* LOB columns cannot

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138785363
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/introduction.adoc ---
@@ -0,0 +1,152 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#introduction]
+= Introduction
+
+[#what is a lOB]
+== What is a LOB
+
+LOB (Large Object), a set of large object data types used to store large 
volumes of data, provides random and piece-wise access to the data. 
+
+Database support for LOB is not universal.
+
+[#lob data types]
+== LOB Data Types
+
+The following are the data types supported by Trafodion. +
+
+
+[caption="Table 1-1 "]
+.Descriptions for BLOB and CLOB
+[cols="30%,70%",options="header"]
+|===
+| *Data Type* | *Desciprtion*
+| BLOB| Binary Large Object. + 
+
+Holds large blocks of unstructured data in binary format. +
+
+BLOB is ideal for storing and handling unstructured data, such as images, 
audio, video and other multimedia objects.
+| CLOB| Character Large Object. +
+
+Stores unusually large amounts of string data in character set format. +
+
+CLOB is ideal for storing and processing semi-structured data, such as a 
large document or string.
+|===
+
+[#lob storage]
+== LOB Storage
+
+The basic design idea is to allow a database row to have multiple LOB 
columns and a table to have multiple such rows. The design takes a combination 
approach of row store and column store. 
+
+When a SQL table with a LOB column is created, there are several dependent 
objects that are created to hold metadata information on the LOB as well as the 
data.
+
+The LOB data itself is stored in an HDFS file while the Trafodion table 
contains a unique LOB handle for each LOB value. The LOB handle provides the 
identifier that is used to query the LOB metadata tables to find the location 
of the LOB data files.
+
+The naming conventions for the LOB tables are as follows: 
+[caption="Table 1-2 "]
+.Naming Conventions for LOB Tables
+[cols="2*",options="header"]
+|===
+2+|*Naming Conventions*
+| SQL Table| TLOB 
+| LOB MD table +
+(one per SQL table containing LOB columns)
+   | LOBMD_{object UID}
+| LOB Descriptor Handle Table +
+(one per LOB column)
+   | LOBDescHandle_{object UID}_{LOB number}
+| LOB Descriptor Chunks Table +
+(one per LOB column)
+   | LOBDescChunks_{object UID}_{LOB number}
+| LOB Data Table + 
+(in HDFS one per LOB column)
+   | LOBP_{object UID}_{LOB number}
+|===
+
+[#lob handle]
+== LOB Handle
+
+The LOB handle is used to describe a LOB value. A SQL table that contains 
a LOB column will contain this handle structure in each row for each LOB value 
inserted.
+
+The actual LOB data will be stored in unstructured HDFS files as column 
store whereas the LOB handle—that describes the location, offset information, 
descriptor information and so on can be thought of as a unique identifier to 
the lob data, is stored in the database row of the table as a traditional row 
store. 
+
+The handle can be thought of as a file locator as is more commonly 
referred to in LOB related terminology. 
+
+[#external structure]
+=== External Structure
+
+The following is an external structure that is stored in the row of a SQL 
table:
--- End diff --

Thanks Dave.
Yes, I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138557787
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/introduction.adoc ---
@@ -0,0 +1,152 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#introduction]
+= Introduction
+
+[#what is lOB]
+== What is LOB
+
+LOB (Large Object), a set of large object data types used to store large 
volumes of data, provides random and piece-wise access to the data. 
+
+Database support for LOB is not universal.
+
+[#lob data types]
+== LOB Data Types
+
+The following are the data types supported by Trafodion. +
+
+
+[caption="Table 1-1 "]
+.Descriptions for BLOB and CLOB
+[cols="30%,70%",options="header"]
+|===
+| *Data Type* | *Desciprtion*
+| BLOB| Binary Large Object. + 
+
+Holds large blocks of unstructured data in binary format. +
+
+BLOB is ideal for storing and handling unstructured data, such as images, 
audio, video and other multimedia objects.
+| CLOB| Character Large Object. +
+
+Stores unusually large amounts of string data in character set format. +
+
+CLOB is ideal for storing and processing semi-structured data, such as 
large document or string.
+|===
+
+[#lob storage]
+== LOB Storage
+
+The basic design idea is to allow a database row to have multiple LOB 
columns and a table to have multiple such rows. The design takes a combination 
approach of rows store and column store. 
+
+When a SQL table with LOB column is created, there are several dependent 
objects that are created to hold metadata information on the LOB as well as the 
data.
+
+The LOB data itself is stored in HDFS while the Trafodion table contains a 
unique LOB handle for each row/column. The LOB handle provides the identifier 
that is used to query the LOB metadata tables to find the location of the LOB 
data files.
--- End diff --

Thanks Dave.
I've corrected. :)

Answer from Sandhya:
Each lob column in any table will have  it’s own unique lob data file. So 
any lob data belonging to that column will be stored in that HDFS file. 
So if a table has 3 columns, you will see 3 lob data files with the first 
part of the name being the same and the column number will be appended to it.

For example, for a table with 2 lob columns:
Location: /user/trafodion/lobs
DataFile: LOBP_04474425229029907479_0001

Location: /user/trafodion/lobs
DataFile: LOBP_04474425229029907479_0002


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138542336
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/introduction.adoc ---
@@ -0,0 +1,152 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#introduction]
+= Introduction
+
+[#what is lOB]
+== What is LOB
+
+LOB (Large Object), a set of large object data types used to store large 
volumes of data, provides random and piece-wise access to the data. 
+
+Database support for LOB is not universal.
+
+[#lob data types]
+== LOB Data Types
+
+The following are the data types supported by Trafodion. +
+
+
+[caption="Table 1-1 "]
+.Descriptions for BLOB and CLOB
+[cols="30%,70%",options="header"]
+|===
+| *Data Type* | *Desciprtion*
+| BLOB| Binary Large Object. + 
+
+Holds large blocks of unstructured data in binary format. +
+
+BLOB is ideal for storing and handling unstructured data, such as images, 
audio, video and other multimedia objects.
+| CLOB| Character Large Object. +
+
+Stores unusually large amounts of string data in character set format. +
+
+CLOB is ideal for storing and processing semi-structured data, such as 
large document or string.
+|===
+
+[#lob storage]
+== LOB Storage
+
+The basic design idea is to allow a database row to have multiple LOB 
columns and a table to have multiple such rows. The design takes a combination 
approach of rows store and column store. 
+
+When a SQL table with LOB column is created, there are several dependent 
objects that are created to hold metadata information on the LOB as well as the 
data.
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138542281
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/introduction.adoc ---
@@ -0,0 +1,152 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#introduction]
+= Introduction
+
+[#what is lOB]
+== What is LOB
+
+LOB (Large Object), a set of large object data types used to store large 
volumes of data, provides random and piece-wise access to the data. 
+
+Database support for LOB is not universal.
+
+[#lob data types]
+== LOB Data Types
+
+The following are the data types supported by Trafodion. +
+
+
+[caption="Table 1-1 "]
+.Descriptions for BLOB and CLOB
+[cols="30%,70%",options="header"]
+|===
+| *Data Type* | *Desciprtion*
+| BLOB| Binary Large Object. + 
+
+Holds large blocks of unstructured data in binary format. +
+
+BLOB is ideal for storing and handling unstructured data, such as images, 
audio, video and other multimedia objects.
+| CLOB| Character Large Object. +
+
+Stores unusually large amounts of string data in character set format. +
+
+CLOB is ideal for storing and processing semi-structured data, such as 
large document or string.
+|===
+
+[#lob storage]
+== LOB Storage
+
+The basic design idea is to allow a database row to have multiple LOB 
columns and a table to have multiple such rows. The design takes a combination 
approach of rows store and column store. 
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138542183
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/introduction.adoc ---
@@ -0,0 +1,152 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#introduction]
+= Introduction
+
+[#what is lOB]
+== What is LOB
+
+LOB (Large Object), a set of large object data types used to store large 
volumes of data, provides random and piece-wise access to the data. 
+
+Database support for LOB is not universal.
+
+[#lob data types]
+== LOB Data Types
+
+The following are the data types supported by Trafodion. +
+
+
+[caption="Table 1-1 "]
+.Descriptions for BLOB and CLOB
+[cols="30%,70%",options="header"]
+|===
+| *Data Type* | *Desciprtion*
+| BLOB| Binary Large Object. + 
+
+Holds large blocks of unstructured data in binary format. +
+
+BLOB is ideal for storing and handling unstructured data, such as images, 
audio, video and other multimedia objects.
+| CLOB| Character Large Object. +
+
+Stores unusually large amounts of string data in character set format. +
+
+CLOB is ideal for storing and processing semi-structured data, such as 
large document or string.
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138541983
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/introduction.adoc ---
@@ -0,0 +1,152 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#introduction]
+= Introduction
+
+[#what is lOB]
+== What is LOB
+
+LOB (Large Object), a set of large object data types used to store large 
volumes of data, provides random and piece-wise access to the data. 
+
+Database support for LOB is not universal.
--- End diff --

1. Just for Trafodion.
2. Both. Define the notion first, and then the value (1.4 LOB Handle).


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138540283
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/about.adoc ---
@@ -0,0 +1,195 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[[About_This_Document]]
+= About This Document
+This guide dwscribes how to use Large Object (LOB) datatypes.
+
+[[Intended_Audience]]
+== Intended Audience
+This manual is intended for programmers who use LOB datatypes. 
+
+[[New_and_Changed_Information]]
+== New and Changed Information
+This is a new guide.
+
+[[Document_Organization]]
+== Document Organization
+
+[cols="30%,70%",options="header"]
+|===
+|Chapter   | Description
+| <<Introduction,Introduction>>| Introduces LOB and covers 
following topics: +
+ 1.1 <> +
+ 1.2 <> +
+ 1.3 <> +
+ 1.4 <> +
+ 1.5 <> +
+ 1.6 <>.
+
+| <>  | Explains how to use LOB 
with SQL statement and covers following topics: +
+ 2.1  <> +
+ 2.2  <> +
+ 2.3  <> +
+ 2.4  <> +
+ 2.5  <> +
+ 2.6  <> +
+ 2.7  <> +
+ 2.8  <> +
+ 2.9  <> +
+ 2.10 <> +
+ 2.11 <> +
+ 2.12 <>
+|===
+
+== Notation Conventions
+This list summarizes the notation conventions for syntax presentation in 
this manual.
+
+* UPPERCASE LETTERS
++
+Uppercase letters indicate keywords and reserved words. Type these items 
exactly as shown. Items not enclosed in brackets are required. 
++
+```
+SELECT
+```
+
+* lowercase letters
++
+Lowercase letters, regardless of font, indicate variable items that you 
supply. Items not enclosed in brackets are required.
++
+```
+file-name
+```
+
+*   Brackets 
++
+Brackets enclose optional syntax items.
++
+```
+DATETIME [start-field TO] end-field
+```
++
+A group of items enclosed in brackets is a list from which you can choose 
one item or none.
++
+The items in the list can be arranged either vertically, with aligned 
brackets on each side of the list, or horizontally, enclosed in a pair of 
brackets and separated by vertical lines.
++
+For example: 
++
+```
+DROP SCHEMA schema [CASCADE]
+DROP SCHEMA schema [ CASCADE | RESTRICT ]
+```
+
+<<<
+* { } Braces 
++
+Braces enclose required syntax items.
++
+```
+FROM { grantee [, grantee ] ... }
+```
++ 
+A group of items enclosed in braces is a list from which you are required 
to choose one item.
++
+The items in the list can be arranged either vertically, with aligned 
braces on each side of the list, or horizontally, enclosed in a pair of braces 
and separated by vertical lines.
++
+For example:
++
+```
+INTERVAL { start-field TO end-field }
+{ single-field } 
+INTERVAL { start-field TO end-field | single-field }
+``` 
+* | Vertical Line 
++
+A vertical line separates alternatives in a horizontal list that is 
enclosed in brackets or braces.
++
+```
+{expression | NULL} 
+```
+*  Ellipsis
++
+An ellipsis immediately following a pair of brackets or braces indicates 
that you can repeat the enclosed sequence of syntax items any number of times.
++
+```
+ATTRIBUTE[S] attribute [, attribute] ...
+{, sql-expression } ...
+```
++ 
+An ellipsis immediately following a single syntax item indicates that you 
can repeat that syntax item any number of times.
++
+For example:
++
+```
+expression-n ...
+```
+
+* Punctuation
++
+Parentheses, commas, semicolons, and other symbols not previously 
described mus

[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138539084
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/about.adoc ---
@@ -0,0 +1,195 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[[About_This_Document]]
+= About This Document
+This guide dwscribes how to use Large Object (LOB) datatypes.
+
+[[Intended_Audience]]
+== Intended Audience
+This manual is intended for programmers who use LOB datatypes. 
+
+[[New_and_Changed_Information]]
+== New and Changed Information
+This is a new guide.
+
+[[Document_Organization]]
+== Document Organization
+
+[cols="30%,70%",options="header"]
+|===
+|Chapter   | Description
+| <<Introduction,Introduction>>| Introduces LOB and covers 
following topics: +
+ 1.1 <> +
+ 1.2 <> +
+ 1.3 <> +
+ 1.4 <> +
+ 1.5 <> +
+ 1.6 <>.
+
+| <>  | Explains how to use LOB 
with SQL statement and covers following topics: +
+ 2.1  <> +
+ 2.2  <> +
+ 2.3  <> +
+ 2.4  <> +
+ 2.5  <> +
+ 2.6  <> +
+ 2.7  <> +
+ 2.8  <> +
+ 2.9  <> +
+ 2.10 <> +
+ 2.11 <> +
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138539061
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/about.adoc ---
@@ -0,0 +1,195 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[[About_This_Document]]
+= About This Document
+This guide dwscribes how to use Large Object (LOB) datatypes.
+
+[[Intended_Audience]]
+== Intended Audience
+This manual is intended for programmers who use LOB datatypes. 
+
+[[New_and_Changed_Information]]
+== New and Changed Information
+This is a new guide.
+
+[[Document_Organization]]
+== Document Organization
+
+[cols="30%,70%",options="header"]
+|===
+|Chapter   | Description
+| <<Introduction,Introduction>>| Introduces LOB and covers 
following topics: +
+ 1.1 <> +
+ 1.2 <> +
+ 1.3 <> +
+ 1.4 <> +
+ 1.5 <> +
+ 1.6 <>.
+
+| <>  | Explains how to use LOB 
with SQL statement and covers following topics: +
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138538583
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/about.adoc ---
@@ -0,0 +1,195 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[[About_This_Document]]
+= About This Document
+This guide dwscribes how to use Large Object (LOB) datatypes.
+
+[[Intended_Audience]]
+== Intended Audience
+This manual is intended for programmers who use LOB datatypes. 
+
+[[New_and_Changed_Information]]
+== New and Changed Information
+This is a new guide.
+
+[[Document_Organization]]
+== Document Organization
+
+[cols="30%,70%",options="header"]
+|===
+|Chapter   | Description
+| <<Introduction,Introduction>>| Introduces LOB and covers 
following topics: +
+ 1.1 <> +
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138538389
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/about.adoc ---
@@ -0,0 +1,195 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[[About_This_Document]]
+= About This Document
+This guide dwscribes how to use Large Object (LOB) datatypes.
+
+[[Intended_Audience]]
+== Intended Audience
+This manual is intended for programmers who use LOB datatypes. 
+
+[[New_and_Changed_Information]]
+== New and Changed Information
+This is a new guide.
+
+[[Document_Organization]]
+== Document Organization
+
+[cols="30%,70%",options="header"]
+|===
+|Chapter   | Description
+| <<Introduction,Introduction>>| Introduces LOB and covers 
following topics: +
--- End diff --

Thanks Dave.
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138538326
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/about.adoc ---
@@ -0,0 +1,195 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[[About_This_Document]]
+= About This Document
+This guide dwscribes how to use Large Object (LOB) datatypes.
--- End diff --

Thanks Dave. 
I've corrected. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138538113
  
--- Diff: docs/lob_guide/pom.xml ---
@@ -0,0 +1,301 @@
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+ 
+  4.0.0
+  org.apache.trafodion
+  sql-reference-manual
+  ${env.TRAFODION_VER}
+  pom
+  Trafodion SQL Reference Manual
+  This manual describes reference information about the 
syntax of SQL statements, 
--- End diff --

Thanks Dave.
Yes I've changed. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138538076
  
--- Diff: docs/lob_guide/pom.xml ---
@@ -0,0 +1,301 @@
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+ 
+  4.0.0
+  org.apache.trafodion
+  sql-reference-manual
+  ${env.TRAFODION_VER}
+  pom
+  Trafodion SQL Reference Manual
--- End diff --

Thanks for your reminding. :) 
Yes I've changed it to Trafodion SQL Large Objects Guide.


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138537922
  
--- Diff: docs/lob_guide/pom.xml ---
@@ -0,0 +1,301 @@
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+ 
+  4.0.0
+  org.apache.trafodion
+  sql-reference-manual
+  ${env.TRAFODION_VER}
+  pom
+  Trafodion SQL Reference Manual
+  This manual describes reference information about the 
syntax of SQL statements, 
--- End diff --

Yes I've changed. :)


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-13 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r138537372
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/about.adoc ---
@@ -0,0 +1,195 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[[About_This_Document]]
+= About This Document
+This guide dwscribes how to use Large Object (LOB) datatypes.
--- End diff --

Thanks Dave, I've corrected and added. 


---


[GitHub] incubator-trafodion pull request #1229: [Trafodion-2734] Create *Trafodion L...

2017-09-10 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1229

[Trafodion-2734] Create *Trafodion LOB Guide* and Add 1st Chapter 
*Introduction*

Changes proposed in this pull request:
1. Create **Trafodion LOB Guide**
2. Add 1st Chapter **Introduction**

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

$ git pull https://github.com/liuyu000/incubator-trafodion lob

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

https://github.com/apache/incubator-trafodion/pull/1229.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 #1229


commit 4c54b742371206c67ac9bd564cc926f57f8ef01a
Author: liu.yu <yu@esgyn.cn>
Date:   2017-09-10T11:26:08Z

add lob folder and 1st chapter




---


[GitHub] incubator-trafodion pull request #1215: Cherry-pick changes of [TRAFODION-27...

2017-08-21 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1215

Cherry-pick changes of [TRAFODION-2703] & [TRAFODION-2710] to 2.2



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

$ git pull https://github.com/liuyu000/incubator-trafodion 
cherrypickaltercolumn

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

https://github.com/apache/incubator-trafodion/pull/1215.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 #1215


commit ef73b7719c746bc721587f2b4b4a032d71d03c65
Author: liu.yu <yu@esgyn.cn>
Date:   2017-08-15T04:12:48Z

cherry-pick altercolumn




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1203: [TRAFODION-2710] Add *Alter Column (...

2017-08-13 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1203

[TRAFODION-2710] Add *Alter Column (Alter Table Statement)* for Trafodion 
SQL Reference Manual

Changes proposed in this pull request:

1. Add **Alter Column** for Alter Table Statement

2. Fix two typos:
- ISO8891→ISO8859-1
- DATEPART(text, datetime-expr)→DATE_PART(text, datetime-expr)

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

$ git pull https://github.com/liuyu000/incubator-trafodion 
altercolumn_altertablestatement

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

https://github.com/apache/incubator-trafodion/pull/1203.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 #1203


commit 72968db9ff445ae36941ed416d98ab160a071ad4
Author: liu.yu <yu@esgyn.cn>
Date:   2017-08-14T03:56:00Z

add alter column (alter table statement) and fix some typos in Chapter 7




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1202: [TRAFODION-2703] Add *Load XML Files...

2017-08-13 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1202

[TRAFODION-2703] Add *Load XML Files* for ODB User Guide

Changes proposed in this pull request:

1. Add **Load XML Files**


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

$ git pull https://github.com/liuyu000/incubator-trafodion loadxmlfiles

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

https://github.com/apache/incubator-trafodion/pull/1202.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 #1202


commit d19c364e05ec69505d73ffafdfffb7136ef9a760
Author: liu.yu <yu@esgyn.cn>
Date:   2017-08-13T08:06:25Z

add Load XML Files




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1137: [TRAFODION-2665] Update Character St...

2017-06-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1137#discussion_r123659013
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -649,18 +664,18 @@ shorter than the maximum length, but the maximum 
internal size of a
 VARYING column is actually four bytes larger than the size required for
 an equivalent column that is not VARYING.
 
-* `VARCHAR (_length_) [_char-set_] [UPSHIFT] [[NOT]CASESPECIFIC]`
+* `VARCHAR (_length_ [_unit_]) [_char-set_] [UPSHIFT] [[NOT]CASESPECIFIC]`
 +
 specifies a column with varying-length character data. VARCHAR is
 equivalent to data type CHAR[ACTER] VARYING.
 
 * `NCHAR [(_length_)] [UPSHIFT] [[NOT]CASESPECIFIC], NATIONAL CHAR[ACTER] 
[(_length_)] [UPSHIFT] [[NOT]CASESPECIFIC]`
 +
-specifies a column with data in the predefined national character set.
+specifies a column with data in the predefined national character 
set(USC2).
 
--- End diff --

Thanks Hans. I've incorporated your comment. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1137: [TRAFODION-2665] Update Character St...

2017-06-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1137#discussion_r123659021
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -649,18 +664,18 @@ shorter than the maximum length, but the maximum 
internal size of a
 VARYING column is actually four bytes larger than the size required for
 an equivalent column that is not VARYING.
 
-* `VARCHAR (_length_) [_char-set_] [UPSHIFT] [[NOT]CASESPECIFIC]`
+* `VARCHAR (_length_ [_unit_]) [_char-set_] [UPSHIFT] [[NOT]CASESPECIFIC]`
 +
 specifies a column with varying-length character data. VARCHAR is
 equivalent to data type CHAR[ACTER] VARYING.
 
 * `NCHAR [(_length_)] [UPSHIFT] [[NOT]CASESPECIFIC], NATIONAL CHAR[ACTER] 
[(_length_)] [UPSHIFT] [[NOT]CASESPECIFIC]`
 +
-specifies a column with data in the predefined national character set.
+specifies a column with data in the predefined national character 
set(USC2).
 
 * `NCHAR VARYING [(_length_)] [UPSHIFT] [[NOT]CASESPECIFIC], NATIONAL 
CHAR[ACTER] VARYING (_length_) [UPSHIFT] [[NOT]CASESPECIFIC]`
 +
-specifies a column with varying-length data in the predefined national 
character set.
+specifies a column with varying-length data in the predefined national 
character set(USC2).
 
--- End diff --

Thanks Hans. I've incorporated your comment. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1137: [TRAFODION-2665] Update Character St...

2017-06-22 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1137#discussion_r123658976
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -604,39 +604,54 @@ numeric, datetime, or interval data.
 * `_character-type_` is:
 +
 ```
-CHAR[ACTER] [(_length_ [CHARACTERS])] [_char-set_] [UPSHIFT] 
[[NOT]CASESPECIFIC]
-| CHAR[ACTER] VARYING(_length_) [CHARACTERS][_char-set_] [UPSHIFT] 
[[NOT]CASESPECIFIC]
-| VARCHAR(_length_) [CHARACTERS] [_char-set_] [UPSHIFT] [[NOT]CASESPECIFIC]
-| NCHAR [(_length_)] [CHARACTERS] [UPSHIFT] [[NOT]CASESPECIFIC]
-| NCHAR VARYING (_length_) [CHARACTERS] [UPSHIFT] [[NOT]CASESPECIFIC]
-| NATIONAL CHAR[ACTER] [(_length_)] [CHARACTERS] [UPSHIFT] 
[[NOT]CASESPECIFIC]
-| NATIONAL CHAR[ACTER] VARYING (_length_) [CHARACTERS] [UPSHIFT] 
[[NOT]CASESPECIFIC]
+CHAR[ACTER] [(length [unit])] [char-set] [UPSHIFT] [[NOT]CASESPECIFIC]
+| CHAR[ACTER] VARYING(length [unit]) [char-set] [UPSHIFT] 
[[NOT]CASESPECIFIC]
+| VARCHAR(length [unit]) [CHARACTERS] [char-set] [UPSHIFT] 
[[NOT]CASESPECIFIC]
+| NCHAR [(length)] [UPSHIFT] [[NOT]CASESPECIFIC]
+| NCHAR VARYING (length) [UPSHIFT] [[NOT]CASESPECIFIC]
+| NATIONAL CHAR[ACTER] [(length)] [UPSHIFT] [[NOT]CASESPECIFIC]
+| NATIONAL CHAR[ACTER] VARYING (length) [UPSHIFT] [[NOT]CASESPECIFIC]
 ```
 
-* `_char-set_` is
 +
-```
-CHARACTER SET char-set-name
-```
-
 CHAR, NCHAR, and NATIONAL CHAR are fixed-length character types. CHAR
 VARYING, VARCHAR, NCHAR VARYING and NATIONAL CHAR VARYING are
 varying-length character types.
 
 * `_length_`
 +
-is a positive integer that specifies the number of characters allowed in
+is a positive integer that specifies the number of characters (or bytes, 
see below) allowed in
 the column. You must specify a value for _length_.
 
-* `_char-set-name_`
+* `_unit_`
++
+is an optional unit of either CHAR[ACTER[S]] or BYTE[S]. This unit is 
meaningful only for UTF8 characters.
+A UTF8 character is one to four bytes in length, therefore the storage 
length of a CHAR column that can hold _n_ UTF8 characters is 4*_n_ bytes.
--- End diff --

Thanks Hans. I've incorporated your comment. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1137: [TRAFODION-2665] Update Character St...

2017-06-22 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1137

[TRAFODION-2665] Update Character String Data Types

Changes proposed in this pull request:

1. Add description for `unit` and `char-set-name`.
2. Fix some mistakes based on AsciiDoc syntax.


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

$ git pull https://github.com/liuyu000/incubator-trafodion 
characterstringdatatypes

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

https://github.com/apache/incubator-trafodion/pull/1137.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 #1137


commit 3c2f37df081dcefe2f707257642bd87c99f9f078
Author: liu.yu <yu@esgyn.cn>
Date:   2017-06-22T13:27:02Z

update Character String Data Types




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1133: [TRAFODION-2548] Add tinyint data ty...

2017-06-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1133#discussion_r123417121
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -320,84 +320,70 @@ more information, see <<cast_expression,CAST 
Expression>>.
 
 The following table summarizes the {project-name} SQL data types:
 
-[cols="13%,29%,29%,29%",options="header"]
+[cols="14%,14%,24%,24%,24%",options="header"]
 |===
-| Type | SQL Designation | Description | Size or Range^1^
-| Fixed-length character | CHAR[ACTER]  | Fixed-length character 
data| 1 to 32707 characters^2^
-|| NCHAR| Fixed-length character 
data in predefined national character set | 1 to 32707 bytes^3^ ^7^
-|| NATIONAL CHAR[ACTER] | Fixed-length character 
data in predefined national character set | 1 to 32707 bytes^3^ ^7^
-| Variable-length character | VARCHAR  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
-|   | CHAR[ACTER] VARYING  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
-|   | NCHAR VARYING| 
Variable-length ASCII character string | 1 to 32703 bytes^4^ ^8^
-|   | NATIONAL CHAR[ACTER] VARYING | 
Variable-length ASCII character string | 1 to 32703 characters^4^ ^8^
-| Numeric
-| NUMERIC (1,_scale_) to +
-NUMERIC (128,_scale_)
-| Binary number with optional scale; signed or unsigned for 1 to 9 digits
-| 1 to 128 digits; stored: +
-1 to 4 digits in 2 bytes +
- +
-5 to 9 digits in 4 bytes +
- +
-10 to 128 digits in 8-64 bytes, depending on precision
-|   | SMALLINT  | Binary 
integer; signed or unsigned| 0 to 65535 unsigned, -32768 to +32767 signed; 
stored in 2 bytes
-|   | INTEGER   | Binary 
integer; signed or unsigned| 0 to 4294967295 unsigned, -2147483648 to 
+2147483647 signed; stored in 4 bytes
-|   | LARGEINT  | Binary 
integer; signed only   | -2**63 to +(2**63)-1; stored in 8 bytes
-| Numeric (extended numeric precision) | NUMERIC (precision 19 to 128) | 
Binary integer; signed or unsigned| Stored as multiple chunks of 16-bit 
integers, with a minimum storage
-length of 8 bytes.
-| Floating point number
-| FLOAT[(_precision_)]
-| Floating point number; precision designates from 1 through 52 bits of 
precision
-| +/- 2.2250738585072014e-308 through +/-1.7976931348623157e+308; stored 
in 8 bytes
-|  | REAL  | 
Floating point number (32 bits)| +/- 1.17549435e-38 through +/ 
3.40282347e+38; stored in 4 bytes
-|
-| DOUBLE PRECISION
-| Floating-point numbers (64 bits) with 1 through 52 bits of precision (52 
bits of binary precision and 1 bits of exponent)
-| +/- 2.2250738585072014e-308 through +/-1.7976931348623157e+308; stored 
in 8 byte
-| Decimal number
-| DECIMAL (1,_scale_) to DECIMAL (18,_scale_)
-| Decimal number with optional scale; stored as ASCII characters; signed 
or unsigned for 1 to 9 digits; signed required for 10 or more digits
-| 1 to 18 digits. Byte length equals the number of digits. Sign is stored 
as the first bit of the leftmost byte.
-|
-| Date-Time
-| Point in time, using the Gregorian calendar and a 24 hour clock system. 
The five supported designations are listed below.
+| Category | Type | SQL Designation | Description | Size or Range^1^
+.7+| Character String Data Type .3+| Fixed-length character | CHAR[ACTER]  
| Fixed-length character data| 1 to 32707 characters^2^
+| NCHAR| Fixed-length character data in predefined 
national character set | 1 to 32707 bytes^3^ ^7^
+| NATIONAL CHAR[ACTER] | Fixed-length character data in predefined 
national character set | 1 to 32707 bytes^3^ ^7^
+.4+| Variable-length character | VARCHAR  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
+| CHAR[ACTER] VARYING  | Variable-length ASCII character string | 
1 to 32703 characters^4^
+| NCHAR VARYING| Variable-length ASCII character string | 
1 to 32703 bytes^4^ ^7^
+| NATIONAL CHAR[ACTER] VARYING | Variable-length ASCII character string | 
1 to 32703 characters^4^ ^7^
+.6+| Datetime Data Types .6+| Date-Time | | Point in time, using the 
Gregorian calendar and a 24 hour clock system. The five supported designations 
are listed below.
 | YEAR 0001- +
 MONTH 1-12 +
 DAY 1-31 +
- +
 DAY constrained by MONTH 

[GitHub] incubator-trafodion pull request #1133: [TRAFODION-2548] Add tinyint data ty...

2017-06-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1133#discussion_r123416355
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -320,84 +320,70 @@ more information, see <<cast_expression,CAST 
Expression>>.
 
 The following table summarizes the {project-name} SQL data types:
 
-[cols="13%,29%,29%,29%",options="header"]
+[cols="14%,14%,24%,24%,24%",options="header"]
 |===
-| Type | SQL Designation | Description | Size or Range^1^
-| Fixed-length character | CHAR[ACTER]  | Fixed-length character 
data| 1 to 32707 characters^2^
-|| NCHAR| Fixed-length character 
data in predefined national character set | 1 to 32707 bytes^3^ ^7^
-|| NATIONAL CHAR[ACTER] | Fixed-length character 
data in predefined national character set | 1 to 32707 bytes^3^ ^7^
-| Variable-length character | VARCHAR  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
-|   | CHAR[ACTER] VARYING  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
-|   | NCHAR VARYING| 
Variable-length ASCII character string | 1 to 32703 bytes^4^ ^8^
-|   | NATIONAL CHAR[ACTER] VARYING | 
Variable-length ASCII character string | 1 to 32703 characters^4^ ^8^
-| Numeric
-| NUMERIC (1,_scale_) to +
-NUMERIC (128,_scale_)
-| Binary number with optional scale; signed or unsigned for 1 to 9 digits
-| 1 to 128 digits; stored: +
-1 to 4 digits in 2 bytes +
- +
-5 to 9 digits in 4 bytes +
- +
-10 to 128 digits in 8-64 bytes, depending on precision
-|   | SMALLINT  | Binary 
integer; signed or unsigned| 0 to 65535 unsigned, -32768 to +32767 signed; 
stored in 2 bytes
-|   | INTEGER   | Binary 
integer; signed or unsigned| 0 to 4294967295 unsigned, -2147483648 to 
+2147483647 signed; stored in 4 bytes
-|   | LARGEINT  | Binary 
integer; signed only   | -2**63 to +(2**63)-1; stored in 8 bytes
-| Numeric (extended numeric precision) | NUMERIC (precision 19 to 128) | 
Binary integer; signed or unsigned| Stored as multiple chunks of 16-bit 
integers, with a minimum storage
-length of 8 bytes.
-| Floating point number
-| FLOAT[(_precision_)]
-| Floating point number; precision designates from 1 through 52 bits of 
precision
-| +/- 2.2250738585072014e-308 through +/-1.7976931348623157e+308; stored 
in 8 bytes
-|  | REAL  | 
Floating point number (32 bits)| +/- 1.17549435e-38 through +/ 
3.40282347e+38; stored in 4 bytes
-|
-| DOUBLE PRECISION
-| Floating-point numbers (64 bits) with 1 through 52 bits of precision (52 
bits of binary precision and 1 bits of exponent)
-| +/- 2.2250738585072014e-308 through +/-1.7976931348623157e+308; stored 
in 8 byte
-| Decimal number
-| DECIMAL (1,_scale_) to DECIMAL (18,_scale_)
-| Decimal number with optional scale; stored as ASCII characters; signed 
or unsigned for 1 to 9 digits; signed required for 10 or more digits
-| 1 to 18 digits. Byte length equals the number of digits. Sign is stored 
as the first bit of the leftmost byte.
-|
-| Date-Time
-| Point in time, using the Gregorian calendar and a 24 hour clock system. 
The five supported designations are listed below.
+| Category | Type | SQL Designation | Description | Size or Range^1^
+.7+| Character String Data Type .3+| Fixed-length character | CHAR[ACTER]  
| Fixed-length character data| 1 to 32707 characters^2^
+| NCHAR| Fixed-length character data in predefined 
national character set | 1 to 32707 bytes^3^ ^7^
+| NATIONAL CHAR[ACTER] | Fixed-length character data in predefined 
national character set | 1 to 32707 bytes^3^ ^7^
+.4+| Variable-length character | VARCHAR  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
+| CHAR[ACTER] VARYING  | Variable-length ASCII character string | 
1 to 32703 characters^4^
+| NCHAR VARYING| Variable-length ASCII character string | 
1 to 32703 bytes^4^ ^7^
+| NATIONAL CHAR[ACTER] VARYING | Variable-length ASCII character string | 
1 to 32703 characters^4^ ^7^
+.6+| Datetime Data Types .6+| Date-Time | | Point in time, using the 
Gregorian calendar and a 24 hour clock system. The five supported designations 
are listed below.
 | YEAR 0001- +
 MONTH 1-12 +
 DAY 1-31 +
- +
 DAY constrained by MONTH 

[GitHub] incubator-trafodion pull request #1133: [TRAFODION-2548] Add tinyint data ty...

2017-06-21 Thread liuyu000
Github user liuyu000 commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1133#discussion_r123415984
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -320,84 +320,70 @@ more information, see <<cast_expression,CAST 
Expression>>.
 
 The following table summarizes the {project-name} SQL data types:
 
-[cols="13%,29%,29%,29%",options="header"]
+[cols="14%,14%,24%,24%,24%",options="header"]
 |===
-| Type | SQL Designation | Description | Size or Range^1^
-| Fixed-length character | CHAR[ACTER]  | Fixed-length character 
data| 1 to 32707 characters^2^
-|| NCHAR| Fixed-length character 
data in predefined national character set | 1 to 32707 bytes^3^ ^7^
-|| NATIONAL CHAR[ACTER] | Fixed-length character 
data in predefined national character set | 1 to 32707 bytes^3^ ^7^
-| Variable-length character | VARCHAR  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
-|   | CHAR[ACTER] VARYING  | 
Variable-length ASCII character string | 1 to 32703 characters^4^
-|   | NCHAR VARYING| 
Variable-length ASCII character string | 1 to 32703 bytes^4^ ^8^
-|   | NATIONAL CHAR[ACTER] VARYING | 
Variable-length ASCII character string | 1 to 32703 characters^4^ ^8^
-| Numeric
-| NUMERIC (1,_scale_) to +
-NUMERIC (128,_scale_)
-| Binary number with optional scale; signed or unsigned for 1 to 9 digits
-| 1 to 128 digits; stored: +
-1 to 4 digits in 2 bytes +
- +
-5 to 9 digits in 4 bytes +
- +
-10 to 128 digits in 8-64 bytes, depending on precision
-|   | SMALLINT  | Binary 
integer; signed or unsigned| 0 to 65535 unsigned, -32768 to +32767 signed; 
stored in 2 bytes
-|   | INTEGER   | Binary 
integer; signed or unsigned| 0 to 4294967295 unsigned, -2147483648 to 
+2147483647 signed; stored in 4 bytes
-|   | LARGEINT  | Binary 
integer; signed only   | -2**63 to +(2**63)-1; stored in 8 bytes
-| Numeric (extended numeric precision) | NUMERIC (precision 19 to 128) | 
Binary integer; signed or unsigned| Stored as multiple chunks of 16-bit 
integers, with a minimum storage
-length of 8 bytes.
-| Floating point number
-| FLOAT[(_precision_)]
-| Floating point number; precision designates from 1 through 52 bits of 
precision
-| +/- 2.2250738585072014e-308 through +/-1.7976931348623157e+308; stored 
in 8 bytes
-|  | REAL  | 
Floating point number (32 bits)| +/- 1.17549435e-38 through +/ 
3.40282347e+38; stored in 4 bytes
-|
-| DOUBLE PRECISION
-| Floating-point numbers (64 bits) with 1 through 52 bits of precision (52 
bits of binary precision and 1 bits of exponent)
-| +/- 2.2250738585072014e-308 through +/-1.7976931348623157e+308; stored 
in 8 byte
-| Decimal number
-| DECIMAL (1,_scale_) to DECIMAL (18,_scale_)
-| Decimal number with optional scale; stored as ASCII characters; signed 
or unsigned for 1 to 9 digits; signed required for 10 or more digits
-| 1 to 18 digits. Byte length equals the number of digits. Sign is stored 
as the first bit of the leftmost byte.
-|
-| Date-Time
-| Point in time, using the Gregorian calendar and a 24 hour clock system. 
The five supported designations are listed below.
+| Category | Type | SQL Designation | Description | Size or Range^1^
+.7+| Character String Data Type .3+| Fixed-length character | CHAR[ACTER]  
| Fixed-length character data| 1 to 32707 characters^2^
--- End diff --

Thanks for your reminding, Hans. :)

Ming has helped me to check that they default to 20 characters/bytes 
and can be declared explicitly by using the TRAF_MAX_CHARACTER_COL_LENGTH CQD. 

I've made corresonding changes.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #1134: [TRAFODION-2657] Remove Automating U...

2017-06-21 Thread liuyu000
GitHub user liuyu000 opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1134

[TRAFODION-2657] Remove Automating Update Statistics for SQL Reference 
Manual

Changes proposed in this pull request: 

1. Remove **Automating Update Statistics** 

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

$ git pull https://github.com/liuyu000/incubator-trafodion 
automatingupdatestatistics

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

https://github.com/apache/incubator-trafodion/pull/1134.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 #1134


commit d8dc53fee8b2b5351bf4740d8df5fd95bcb05ba1
Author: liu.yu <yu@esgyn.cn>
Date:   2017-06-21T09:31:23Z

remove automating update statistics




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   >