Skip to content

snowflake id (not to confuse with Snowflake service) time extract and convert functions #27058

@jasine

Description

@jasine

Use case
snowflake id is a form of unique identifier used in distributed computing. The format was created by Twitter and it is widely used in many products such as discord api and etc.

snowflake is a int64 number and generated based on timestamp, so it is comparable between two ids and it is sorting friendly, therefore it is a good replacement to uuid to be used as primary key in many occasions

when it comes to clickhouse merge key engine,

  • we can use snowflake to be the order key or primary key and extract time from it to be the partitioning key at the same time
  • some time based queries can be applied on snowflack primary keys after converting time to snowflake and speed up the queries

Describe the solution you'd like

I'd like to add a group of snowflake time extract and convert functions to solve above questions, and I wonder whether the community will accept this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions