You need to enable JavaScript to run this app.
导航

常用数据类型

最近更新时间2022.12.15 10:08:27

首次发布时间2022.12.15 10:08:27

数据格式

常用数据格式

  • 整型

    • UInt(无符号整形):UInt8, UInt16, UInt32, UInt64

    • Int (整形):Int8, Int16, Int32, Int64

  • 浮点型

    • Float(浮点型):Float32, Float64

    • Decimal(定点型):Decimal(P, S)

      • P 代表数字 (1 <= P && P <= 38 )

      • S 代表小数点位数 (0 <= S && S <= P)

      • 例如: Decimal(3, 1) 可以表示 (-99.9, 99.9) 之间的数字

      • Decimal 精度更高,常用于金额计算等场景

  • 日期、时间

    • Date, DateTime
  • 字符串:

    • String, FixedString
  • 数组

    • Array(T):T 是任意非 Nullable 的基础类型,如Array(Int64)

其他数据类型请参考:社区文档

关于 Nullable

指当前列可以为空。基础类型都能为 Nullable,格式为:Nullable(T),例如 Nullable(Int64)。除了以下情况:

  • 复合类型 Map 和 Array 不能为 Nullable。

  • 建表时的特定字段不能为 Nullable:

    • 分区键(Partition Key)

    • 分片键(Shard Key)

    • 排序键(Order-by Key)