更新时间:2026-10-09 GMT+08:00
分享

Paimon数据类型

Spark和Paimon支持不同的类型集。Paimon会自动进行类型转换,但并非所有组合都支持,因此在设计表的列类型之前,您需要了解Paimon中的类型转换。Spark的所有数据类型均可在包org.apache.spark.sql.types中找到。

表1 类型转换

Spark Data Type

Paimon Data Type

StructType

RowType

MapType

MapType

ArrayType

ArrayType

BooleanType

BooleanType

ByteType

TinyIntType

ShortType

SmallIntType

IntegerType

IntType

LongType

BigIntType

FloatType

FloatType

DoubleType

DoubleType

StringType

VarCharType(Integer.MAX_VALUE)

VarCharType(length)

VarCharType(length)

CharType(length)

CharType(length)

DateType

DateType

TimestampType

LocalZonedTimestampType

TimestampNTZType(Spark3.4+)

TimestampType

DecimalType(precision, scale)

DecimalType(precision, scale)

BinaryType

BinaryType

VariantType

VariantType

相关文档