You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by li...@apache.org on 2018/08/29 01:08:57 UTC

[1/6] trafodion git commit: add documentation for uuid()

Repository: trafodion
Updated Branches:
  refs/heads/master 8697d9262 -> 5f230e24f


add documentation for uuid()


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/694d6d40
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/694d6d40
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/694d6d40

Branch: refs/heads/master
Commit: 694d6d407a6def098dfbac4223c0404b852d7081
Parents: 6bd3564
Author: LiuMing <ov...@sina.com>
Authored: Sun Aug 19 17:10:51 2018 +0800
Committer: LiuMing <ov...@sina.com>
Committed: Sun Aug 19 17:10:51 2018 +0800

----------------------------------------------------------------------
 .../sql_functions_and_expressions.adoc          | 38 +++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/694d6d40/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
index 5dce089..29cb4a5 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
@@ -442,7 +442,8 @@ the expressions have NULL values, the function returns a NULL value.
 | <<nvl_function,NVL Function>>                                   | Returns the value of the first operand unless it is NULL, in which case it returns the value of the second operand.
 | <<user_function,USER Function>>                                 | Returns either the database user name of the current user who invoked the function or the database user name
 associated with the specified user ID number.
-| <<sys_guid_function,SYS_GUID Function>>                         | Returns a globally unique identifier.
+| <<sys_guid_function,SYS_GUID Function>>                         | Returns a globally unique identifier. (Oracle extention)
+| <<uuid_function,UUID Function>>                                 | Returns a globally unique identifier.
 |===
 
 See the individual entry for the function.
@@ -11291,6 +11292,41 @@ ID
 ```
 
 <<<
+[[uuid_function]]
+== UUID Function
+Returns a Universal Unique Identifier (UUID) generated according to RFC 4122. 
+A UUID is designed as a number that is globally unique in space and time. 
+Two calls to UUID() are expected to generate two different values, even if 
+these calls are performed on two separate devices not connected to each other.
+
+NOTE: But UUID() can only be used in SELECT list, or very simple expressions to get a UUID.
+Do not use it in WHERE clause, the behavior is non-deterministic.
+
+
+```
+UUID ()
+```
+
+[[data_type_of_the_result]]
+==== Data Type of the Result
+
+The data type of the result is always CHAR(36).
+
+[[examples_of_uuid]]
+=== Examples of UUID
+
+* Returns a global unique identifier
++
+```
+SELECT UUID() AS ID FROM dual;
+
+ID
+-------------------------
+  6ccd780c-baba-1026-9564-5b8c656024db
+--- 1 row(s) selected.
+```
+
+<<<
 [[variance_function]]
 == VARIANCE Function
 


[5/6] trafodion git commit: update the words

Posted by li...@apache.org.
update the words


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/1de8531a
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/1de8531a
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/1de8531a

Branch: refs/heads/master
Commit: 1de8531a0799bb8d14890246b7c10cfb21ee06e3
Parents: d8ad0c7
Author: LiuMing <ov...@sina.com>
Authored: Fri Aug 24 10:56:21 2018 +0800
Committer: LiuMing <ov...@sina.com>
Committed: Fri Aug 24 10:56:21 2018 +0800

----------------------------------------------------------------------
 .../_chapters/sql_functions_and_expressions.adoc        | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/1de8531a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
index 7a8a4aa..44b968a 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
@@ -444,7 +444,7 @@ the expressions have NULL values, the function returns a NULL value.
 | <<nvl_function,NVL Function>>                                   | Returns the value of the first operand unless it is NULL, in which case it returns the value of the second operand.
 | <<user_function,USER Function>>                                 | Returns either the database user name of the current user who invoked the function or the database user name
 associated with the specified user ID number.
-| <<sys_guid_function,SYS_GUID Function>>                         | Returns a globally unique identifier. (Oracle extention)
+| <<sys_guid_function,SYS_GUID Function>>                         | Returns a globally unique identifier, similar to Oracle's SYS_GUID function.
 | <<uuid_function,UUID Function>>                                 | Returns a globally unique identifier.
 | <<uuid_short_function,UUID_SHORT Function>>                     | Returns a “short” universal identifier as a 64-bit unsigned integer.
 | <<sleep_function,SLEEP Function>>                               | Sleep for a number of seconds
@@ -11303,8 +11303,9 @@ A UUID is designed as a number that is globally unique in space and time.
 Two calls to UUID() are expected to generate two different values, even if 
 these calls are performed on two separate devices not connected to each other.
 
-NOTE: But UUID() can only be used in SELECT list, or very simple expressions to get a UUID.
-Do not use it in WHERE clause, the behavior is non-deterministic.
+NOTE: UUID() behavior is non-deterministic. Therefore it is best to use it 
+only in SELECT lists. Using it in a WHERE clause, for example, may result in i
+non-deterministic predicate evaluation.
 
 
 ```
@@ -11335,8 +11336,9 @@ ID
 == UUID_SHORT Function
 Returns a “short” universal identifier as a 64-bit unsigned integer.
 
-NOTE: But UUID_SHORT() can only be used in SELECT list, or very simple expressions to get a UUID.
-Do not use it in WHERE clause, the behavior is non-deterministic.
+NOTE: UUID_SHORT() behavior is non-deterministic. Therefore it is best to use it 
+only in SELECT lists. Using it in a WHERE clause, for example, may result in i
+non-deterministic predicate evaluation.
 
 
 ```


[6/6] trafodion git commit: merge [TRAFODION-2968]

Posted by li...@apache.org.
merge [TRAFODION-2968] 


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/5f230e24
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/5f230e24
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/5f230e24

Branch: refs/heads/master
Commit: 5f230e24fed3acd609cfbf70ff1fe5d7f6403715
Parents: 8697d92 1de8531
Author: Liu Ming <ov...@sina.com>
Authored: Wed Aug 29 01:08:39 2018 +0000
Committer: Liu Ming <ov...@sina.com>
Committed: Wed Aug 29 01:08:39 2018 +0000

----------------------------------------------------------------------
 .../sql_functions_and_expressions.adoc          | 135 ++++++++++++++++++-
 1 file changed, 134 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[2/6] trafodion git commit: add uuid_short() documentation

Posted by li...@apache.org.
add uuid_short() documentation


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/95348f43
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/95348f43
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/95348f43

Branch: refs/heads/master
Commit: 95348f435b9c7585c09283a95093c9dc47b0cf03
Parents: 694d6d4
Author: LiuMing <ov...@sina.com>
Authored: Sun Aug 19 17:26:09 2018 +0800
Committer: LiuMing <ov...@sina.com>
Committed: Sun Aug 19 17:26:09 2018 +0800

----------------------------------------------------------------------
 .../sql_functions_and_expressions.adoc          | 34 +++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/95348f43/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
index 29cb4a5..daa3d83 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
@@ -444,6 +444,7 @@ the expressions have NULL values, the function returns a NULL value.
 associated with the specified user ID number.
 | <<sys_guid_function,SYS_GUID Function>>                         | Returns a globally unique identifier. (Oracle extention)
 | <<uuid_function,UUID Function>>                                 | Returns a globally unique identifier.
+| <<uuid_short_function,UUID Function>>                           | Returns a “short” universal identifier as a 64-bit unsigned integer.
 |===
 
 See the individual entry for the function.
@@ -11322,7 +11323,38 @@ SELECT UUID() AS ID FROM dual;
 
 ID
 -------------------------
-  6ccd780c-baba-1026-9564-5b8c656024db
+  5cdd380c-33ba-3216-1352-2c9d624042c3
+--- 1 row(s) selected.
+```
+
+<<<
+[[uuid_short_function]]
+== UUID_SHORT Function
+
+NOTE: But UUID_SHORT() can only be used in SELECT list, or very simple expressions to get a UUID.
+Do not use it in WHERE clause, the behavior is non-deterministic.
+
+
+```
+UUID ()
+```
+
+[[data_type_of_the_result]]
+==== Data Type of the Result
+
+The data type of the result is always LARGEINT.
+
+[[examples_of_uuid_short]]
+=== Examples of UUID_SHORT
+
+* Returns a global unique identifier
++
+```
+SELECT UUID_SHORT() AS ID FROM dual;
+
+ID
+-------------------------
+  92395783831158784
 --- 1 row(s) selected.
 ```
 


[4/6] trafodion git commit: add unix_timestamp documentation

Posted by li...@apache.org.
add unix_timestamp documentation


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/d8ad0c7a
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/d8ad0c7a
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/d8ad0c7a

Branch: refs/heads/master
Commit: d8ad0c7a647863601c69bfa0ff52c168d7783138
Parents: aece499
Author: LiuMing <ov...@sina.com>
Authored: Sun Aug 19 17:52:30 2018 +0800
Committer: LiuMing <ov...@sina.com>
Committed: Sun Aug 19 17:52:30 2018 +0800

----------------------------------------------------------------------
 .../sql_functions_and_expressions.adoc          | 37 +++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/d8ad0c7a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
index f131ab9..7a8a4aa 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
@@ -257,6 +257,8 @@ _num_expr_ to _datetime_expr_.
 | <<week_function,WEEK Function>>                                           | Returns an integer in the range 1 through 54 that represents the
 corresponding week of the year.
 | INTEGER (from 1 to 54)
+| <<unix_timestamp_function,UNIX_TIMESTAMP Function>>                       | Returns a Unix timestamp 
+| INTEGER 
 | <<year_function,YEAR Function>>                                           | Returns an integer that represents the year.
 | INTEGER 
 |===
@@ -11349,7 +11351,7 @@ The data type of the result is always UNSIGNED LARGEINT.
 [[examples_of_uuid_short]]
 === Examples of UUID_SHORT
 
-* Returns a global unique identifier
+* Returns a global unique identifier as a 64-bit unsigned integer.
 +
 ```
 SELECT UUID_SHORT() AS ID FROM dual;
@@ -11604,6 +11606,39 @@ Start/Date Time/Shipped               (EXPR)
 2008-04-10 2008-04-21 08:15:00.000000   2008
 ```
 
+<<<
+[[unix_timestamp_function]]
+== UNIX_TIMESTAMP Function
+If called with no argument, returns a Unix timestamp (seconds since '1970-01-01 00:00:00' UTC) 
+as an unsigned integer. If UNIX_TIMESTAMP() is called with a date argument, it returns the value 
+of the argument as seconds since '1970-01-01 00:00:00' UTC.
+
+UNIX_TIMESTAMP is a MySQL SQL extension.
+
+```
+UNIX_TIMESTAMP (datetime-expression | emtpy)
+```
+
+* `_datetime-expression_`
++
+is an expression that evaluates to a datetime value of type DATE or
+TIMESTAMP. See <<datetime_value_expressions,Datetime Value Expressions>>.
+
+[[examples_of_unix_timestamp]]
+=== Examples of UNIX_TIMESTAMP 
+
++
+```
+>>select unix_timestamp() from dual;
+
+(EXPR)
+--------------------
+
+          1534672251
+
+--- 1 row(s) selected.
+
+```
 
 <<<
 [[zeroifnull_function]]


[3/6] trafodion git commit: add documentation for sleep() function

Posted by li...@apache.org.
add documentation for sleep() function


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/aece4997
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/aece4997
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/aece4997

Branch: refs/heads/master
Commit: aece4997c66b13fe845f980082713f17e07cc4d1
Parents: 95348f4
Author: LiuMing <ov...@sina.com>
Authored: Sun Aug 19 17:36:19 2018 +0800
Committer: LiuMing <ov...@sina.com>
Committed: Sun Aug 19 17:36:19 2018 +0800

----------------------------------------------------------------------
 .../sql_functions_and_expressions.adoc          | 36 +++++++++++++++++---
 1 file changed, 32 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/aece4997/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
index daa3d83..f131ab9 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
@@ -444,7 +444,8 @@ the expressions have NULL values, the function returns a NULL value.
 associated with the specified user ID number.
 | <<sys_guid_function,SYS_GUID Function>>                         | Returns a globally unique identifier. (Oracle extention)
 | <<uuid_function,UUID Function>>                                 | Returns a globally unique identifier.
-| <<uuid_short_function,UUID Function>>                           | Returns a “short” universal identifier as a 64-bit unsigned integer.
+| <<uuid_short_function,UUID_SHORT Function>>                     | Returns a “short” universal identifier as a 64-bit unsigned integer.
+| <<sleep_function,SLEEP Function>>                               | Sleep for a number of seconds
 |===
 
 See the individual entry for the function.
@@ -11330,19 +11331,20 @@ ID
 <<<
 [[uuid_short_function]]
 == UUID_SHORT Function
+Returns a “short” universal identifier as a 64-bit unsigned integer.
 
 NOTE: But UUID_SHORT() can only be used in SELECT list, or very simple expressions to get a UUID.
 Do not use it in WHERE clause, the behavior is non-deterministic.
 
 
 ```
-UUID ()
+UUID_SHORT ()
 ```
 
 [[data_type_of_the_result]]
 ==== Data Type of the Result
 
-The data type of the result is always LARGEINT.
+The data type of the result is always UNSIGNED LARGEINT.
 
 [[examples_of_uuid_short]]
 === Examples of UUID_SHORT
@@ -11354,7 +11356,33 @@ SELECT UUID_SHORT() AS ID FROM dual;
 
 ID
 -------------------------
-  92395783831158784
+  4716501302154732154 
+
+--- 1 row(s) selected.
+```
+
+<<<
+[[sleep_function]]
+== SLEEP Function
+Sleeps (pauses) for the number of seconds given by the duration argument, then returns 1. 
+
+```
+SLEEP( seconds )
+```
+
+[[examples_of_sleep]]
+=== Examples of SLEEP
+
+* Sleep (Pause) for a given number of seconds
++
+```
+SELECT SLEEP(5) AS ID FROM dual;
+
+(EXPR)
+-----------
+
+          1
+
 --- 1 row(s) selected.
 ```