matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Feature Request]: Support uuid function

Open domingozhang opened this issue 2 years ago • 3 comments

Is there an existing issue for the same feature request?

  • [X] I have checked the existing issues.

Is your feature request related to a problem?

No response

Describe the feature you'd like

Such as MySQL, the uuid funciton will return column's uuid in storage level.

create table t1(a varchar(20)); insert into t1 values('123123sdafsdf');

select uuid(),a from t1; +--------------------------------------+---------------+ | uuid() | a | +--------------------------------------+---------------+ | 976efd08-041a-11ed-a36c-c48e7bbf4d43 | 123123sdafsdf | +--------------------------------------+---------------+

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

No response

Additional information

No response

domingozhang avatar Jul 15 '22 08:07 domingozhang

uuid() is just a new function. It is arguably important enough so that we create a uuid type.

fengttt avatar Jul 23 '22 18:07 fengttt

mysql UUID: https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid

qingxinhome avatar Aug 03 '22 10:08 qingxinhome

This feature request of uuid function has been fixed, unit test and bvt test have been completed, and now request acceptance test, please know! @fengttt @domingozhang @daviszhen @aressu1985

qingxinhome avatar Aug 15 '22 06:08 qingxinhome

Let me reactivate this one and repurpose it.

Can we add a UUID type? [16]byte. Just 3 functions on this, cast/parse string to uuid, cast uuid to string, and uuid1 equal uuid2.

fengttt avatar Aug 19 '22 08:08 fengttt

now,the Mo database will supports UUID data types. The functions involved are as follows:

  1. The DDL table creation statement supports UUID type fields
  2. UUID type fields can be used as primary key columns of tables
  3. UUID type fields can be queried and displayed in the client in string form
  4. Fields of UUID type can be sorted (order by clause)
  5. The UUID type supports comparison operation, and the UUID field can be used in the where / having condition
  6. The group by clause supports the UUID field as a grouping condition
  7. UUID type fields can be used as parameters of aggregation functions (max, min, count)
  8. The insert statement supports the insertion of UUID type data
  9. The update statement supports updating the field data of the UUID type table
  10. The delete statement supports deleting data according to the UUID type table field
  11. UUID type data can be converted to and from string type
  12. Support uuid() built-in functions

qingxinhome avatar Sep 08 '22 13:09 qingxinhome

The feature requests related to uuid type and uuid function had been fixed, unit test and bvt test have been completed, and now request acceptance test, please know! @fengttt @yingfeng @daviszhen @domingozhang @aressu1985

qingxinhome avatar Sep 09 '22 10:09 qingxinhome