You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/08/22 09:46:41 UTC

[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1026: IGNITE-16860 Add info on get_random_uuid

korlov42 commented on code in PR #1026:
URL: https://github.com/apache/ignite-3/pull/1026#discussion_r951220988


##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -23,17 +23,17 @@ Creates a new table.
 [source,sql]
 ----
 CREATE TABLE [IF NOT EXISTS] [simpleName | schemaName.simpleName] (tableColumn [, tableColumn]...)
-[COLOCATE [BY] (tableColumn [, tableColumn]...)]
+[COLOCATE [BY] (columnName [, columnName]...)]
 [ENGINE engineName]
 [WITH paramName=paramValue [,paramName=paramValue]...]
-tableColumn = columnName columnType [[NOT] NULL] [DEFAULT defaultValue] [PRIMARY KEY]
+tableColumn = columnName columnType [[NOT] NULL] [DEFAULT defaultValue | gen_random_uuid] [PRIMARY KEY]

Review Comment:
   I would rather add the explanation of a 'defaultValue':
   ```
   tableColumn = columnName columnType [[NOT] NULL] [DEFAULT defaultValue] [PRIMARY KEY]
   defaultValue = literal | systemFunctionName
   ```



##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -23,17 +23,17 @@ Creates a new table.
 [source,sql]
 ----
 CREATE TABLE [IF NOT EXISTS] [simpleName | schemaName.simpleName] (tableColumn [, tableColumn]...)
-[COLOCATE [BY] (tableColumn [, tableColumn]...)]
+[COLOCATE [BY] (columnName [, columnName]...)]
 [ENGINE engineName]
 [WITH paramName=paramValue [,paramName=paramValue]...]
-tableColumn = columnName columnType [[NOT] NULL] [DEFAULT defaultValue] [PRIMARY KEY]
+tableColumn = columnName columnType [[NOT] NULL] [DEFAULT defaultValue | gen_random_uuid] [PRIMARY KEY]
 ----
 
 Parameters:
 
 * `tableName` - name of the table.
 * `tableColumn` - name and type of a column to be created in the new table.
-* `DEFAULT` - specifies a default value for the column. Only constant values are accepted.
+* `DEFAULT` - specifies a default value for the column. You can specify a constant value, or use the `gen_random_uuid` function to generate a random value.

Review Comment:
   I would prefer to use more abstract form here, because the list of supported functions may change over the time, and such an approach seems a little bit error prone to me, since we need to find all the place where the particular name of the function is used. 
   
   Let's re-phrase this as "You can specify a constant value or name of the system function to generate value" (or something similar to). Also we need to attach link to "system function" that redirect us to a list of supported functions (is it possible?)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org