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

2017-12-20 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[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 #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%"]
+|===
+| <>   | Creates a dummy LOB 
handle with BLOB.
+| <>   | 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%"]
+|===
+| <>   | Creates a dummy LOB 
handle with BLOB.
+| <>   | Creates a dummy LOB 
handle with CLOB.
+| <>  | Converts a simple 
string literal into LOB format.
+| <>  | Converts data from a 
local linux/hdfs file into LOB format.
+| <> | 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%"]
+|===
+| <>   | Creates a dummy LOB 
handle with BLOB.
+| <>   | Creates a dummy LOB 
handle with CLOB.
+| <>  | Converts a simple 
string literal into LOB format.
+| <>  | Converts data from a 
local linux/hdfs file into LOB format.
+| <> | Takes an address and 
a size of an input buffer, and converts the data pointed to by that buffer into 
LOB format.
+| <> | 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%"]
+|===
+| <>   | 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 DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


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

Possible word smith: "Currently the limit defaults to 10Gb. This limit can 
be configured as needed using 'CQD LOB_MAX_SIZE'.


---


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

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


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157638744
  
--- 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" or "INSERT or UPDATE statements" sounds a 
bit better


---


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

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


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157637308
  
--- 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%"]
+|===
+| <>   | Creates a dummy LOB 
handle with BLOB.
+| <>   | Creates a dummy LOB 
handle with CLOB.
--- End diff --

Similarly


---


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

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


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

I would say, "...can later be used to populate the LOB with new data. ..."


---


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

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


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

Similar to previous comment


---


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

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


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

same comment as before


---


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

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


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157638612
  
--- 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" or "INSERT or UPDATE statements" sounds 
better to my ears.


---


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

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


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

Again, "...the size..." sounds better to my ears.


---


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

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


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

same comment as before


---


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

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


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

Either "an INSERT or UPDATE statement" or "INSERT or UPDATE statements" is 
better


---


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

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


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157637747
  
--- 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%"]
+|===
+| <>   | Creates a dummy LOB 
handle with BLOB.
+| <>   | Creates a dummy LOB 
handle with CLOB.
+| <>  | Converts a simple 
string literal into LOB format.
+| <>  | Converts data from a 
local linux/hdfs file into LOB format.
+| <> | Takes an address and 
a size of an input buffer, and converts the data pointed to by that buffer into 
LOB format.
--- End diff --

Nit: To my ears, "Takes an address and the size of an input buffer..." 
sounds better. Probably the reason it sounds better to me is that I know the 
address is pointing to the input buffer. So, once we have said "an address" we 
have identified a specific input buffer, and "size" refers to the size of that 
specific buffer. So it requires the definite article rather than the indefinite 
article.

That said, perhaps another way of saying this is, "Takes the address and 
size of an input buffer, and converts the contents of that buffer into LOB 
format."


---


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

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


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157637887
  
--- 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%"]
+|===
+| <>   | Creates a dummy LOB 
handle with BLOB.
+| <>   | Creates a dummy LOB 
handle with CLOB.
+| <>  | Converts a simple 
string literal into LOB format.
+| <>  | Converts data from a 
local linux/hdfs file into LOB format.
+| <> | Takes an address and 
a size of an input buffer, and converts the data pointed to by that buffer into 
LOB format.
+| <> | Converts data from 
an external file into LOB format.
+| LOBTOSTRING | Converts LOB data into simple string 
literal.
--- End diff --

I would say, "Converts LOB data into a simple string literal."


---


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

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


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

"...of type CLOB" sounds better to my ears.


---


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

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


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

Perhaps, "The int64 value of the user buffer address"?


---


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

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


https://github.com/apache/incubator-trafodion/pull/1350#discussion_r157637289
  
--- 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%"]
+|===
+| <>   | Creates a dummy LOB 
handle with BLOB.
--- End diff --

Suggested wordsmith: "Creates a dummy LOB handle of type BLOB"


---


[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 
Date:   2017-12-15T10:28:15Z

Add BLOB and CLOB for *Trafodion SQL Reference Manual*

commit bb6864a78d3922e6d313ce03528d4be25f6e0d88
Author: liu.yu 
Date:   2017-12-15T10:34:20Z

Remove redundancies




---