string_datatype

用法

view: view_name {
  dimension: field_name {
    string_datatype: unicode
  }
}
层次结构
string_datatype
可能的字段类型
维度

接受
unicode

特殊规则
仅适用于维度为 type: string 的情况(如果未指定 type,则这是默认值)

定义

借助 string_datatype 参数,您可以指定维度的字符串值为 Unicode 字符,这对于需要特殊过滤处理的方言很有用。具体而言,您可以为包含 Unicode 字符的过滤条件所对应的字段指定 string_datatype: unicode(适用于 Microsoft SQL Server 和 MySQL)。这适用于:

  • 适用于非拉丁排序规则类型的 Microsoft SQL Server (MSSQL)
  • MySQL 的可变字符 (NVARCHAR) 和固定数字字符 (NCHAR) 类型

string_datatype: unicode 参数仅适用于维度 type: string(这是 type 参数的默认值)。

示例

dimension: comments {
  string_datatype: unicode
  sql: ${TABLE}.comments ;;