跳转至

UUID V5

Supported in: Batch, Streaming

Generates a deterministic UUID v5 from a namespace UUID and a name string using SHA-1 hashing (RFC 4122). The same namespace and name will always produce the same UUID. Returns null if the namespace is not a valid UUID.

Expression categories: String

Declared arguments

  • Name: The name string to hash with the namespace to produce a deterministic UUID.
    Expression\
  • Namespace UUID: A valid UUID string to use as the namespace.
    Expression\

Output type: String

Examples

Example 1: Base case

Description: Generate a deterministic UUID v5 from a namespace UUID and name string.

Argument values:

  • Name: name
  • Namespace UUID: namespace
namespace name Output
6ba7b810-9dad-11d1-80b4-00c04fd430c8 hello 9342d47a-1bab-5709-9869-c840b2eac501
6ba7b811-9dad-11d1-80b4-00c04fd430c8 https://example.com 4fd35a71-71ef-5a55-a9d9-aa75c889a6d0

Example 2: Null case

Argument values:

  • Name: name
  • Namespace UUID: namespace
namespace name Output
null hello null
6ba7b810-9dad-11d1-80b4-00c04fd430c8 null null
null null null

Example 3: Edge case

Argument values:

  • Name: name
  • Namespace UUID: namespace
namespace name Output
not-a-uuid hello null


中文翻译

UUID V5

支持:批处理(Batch)、流处理(Streaming)

使用SHA-1哈希算法(RFC 4122),从命名空间UUID和名称字符串生成确定性的UUID v5。相同的命名空间和名称将始终生成相同的UUID。如果命名空间不是有效的UUID,则返回null。

表达式类别: 字符串(String)

声明的参数

  • 名称(Name): 与命名空间一起哈希以生成确定性UUID的名称字符串。
    表达式\
  • 命名空间UUID(Namespace UUID): 用作命名空间的有效UUID字符串。
    表达式\

输出类型: String

示例

示例1:基本情况

描述: 从命名空间UUID和名称字符串生成确定性的UUID v5。

参数值:

  • 名称(Name): name
  • 命名空间UUID(Namespace UUID): namespace
namespace name 输出(Output)
6ba7b810-9dad-11d1-80b4-00c04fd430c8 hello 9342d47a-1bab-5709-9869-c840b2eac501
6ba7b811-9dad-11d1-80b4-00c04fd430c8 https://example.com 4fd35a71-71ef-5a55-a9d9-aa75c889a6d0

示例2:空值情况

参数值:

  • 名称(Name): name
  • 命名空间UUID(Namespace UUID): namespace
namespace name 输出(Output)
null hello null
6ba7b810-9dad-11d1-80b4-00c04fd430c8 null null
null null null

示例3:边界情况

参数值:

  • 名称(Name): name
  • 命名空间UUID(Namespace UUID): namespace
namespace name 输出(Output)
not-a-uuid hello null