hequn8128 commented on a change in pull request #6381: [FLINK-7205] [table] Add
UUID supported in SQL and TableApi
URL: https://github.com/apache/flink/pull/6381#discussion_r207106931
##########
File path:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/sql/ScalarSqlFunctions.scala
##########
@@ -158,6 +158,15 @@ object ScalarSqlFunctions {
SqlFunctionCategory.STRING
)
+ val UUID = new SqlFunction(
+ "UUID",
+ SqlKind.OTHER_FUNCTION,
+ ReturnTypes.VARCHAR_2000,
+ null,
+ OperandTypes.NILADIC,
+ SqlFunctionCategory.STRING
+ )
Review comment:
Override `isDeterministic` function or calcite will reduce the function to a
constant value during optimize. Also add tests to check the output is distinct.
```
val UUID = new SqlFunction(
"UUID",
SqlKind.OTHER_FUNCTION,
ReturnTypes.VARCHAR_2000,
null,
OperandTypes.NILADIC,
SqlFunctionCategory.STRING
) {
override def isDeterministic: Boolean = false
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services