Doris

This documentation is a guide for using Paimon in Doris.

More details can be found in Apache Doris Website

Version

Paimon currently supports Apache Doris 2.0.6 and above.

Create Paimon Catalog

Use CREATE CATALOG statement in Apache Doris to create Paimon Catalog.

Doris support multi types of Paimon Catalogs. Here are some examples:

  1. -- HDFS based Paimon Catalog
  2. CREATE CATALOG `paimon_hdfs` PROPERTIES (
  3. "type" = "paimon",
  4. "warehouse" = "hdfs://172.21.0.1:8020/user/paimon",
  5. "hadoop.username" = "hadoop"
  6. );
  7. -- Aliyun OSS based Paimon Catalog
  8. CREATE CATALOG `paimon_oss` PROPERTIES (
  9. "type" = "paimon",
  10. "warehouse" = "oss://paimon-bucket/paimonoss",
  11. "oss.endpoint" = "oss-cn-beijing.aliyuncs.com",
  12. "oss.access_key" = "ak",
  13. "oss.secret_key" = "sk"
  14. );
  15. -- Hive Metastore based Paimon Catalog
  16. CREATE CATALOG `paimon_hms` PROPERTIES (
  17. "type" = "paimon",
  18. "paimon.catalog.type" = "hms",
  19. "warehouse" = "hdfs://172.21.0.1:8020/user/zhangdong/paimon2",
  20. "hive.metastore.uris" = "thrift://172.21.0.44:7004",
  21. "hadoop.username" = "hadoop"
  22. );

See Apache Doris Website for more examples.

Access Paimon Catalog

  1. Query Paimon table with full qualified name

    1. SELECT * FROM paimon_hdfs.paimon_db.paimon_table;
  2. Switch to Paimon Catalog and query

    1. SWITCH paimon_hdfs;
    2. USE paimon_db;
    3. SELECT * FROM paimon_table;

Query Optimization

  • Read optimized for Primary Key Table

    Doris can utilize the Read optimized feature for Primary Key Table(release in Paimon 0.6), by reading base data files using native Parquet/ORC reader and delta file using JNI.

  • Deletion Vectors

    Doris(2.1.4+) natively supports Deletion Vectors(released in Paimon 0.8).

Doris to Paimon type mapping

Doris Data TypePaimon Data TypeAtomic Type
BooleanBooleanTypetrue
TinyIntTinyIntTypetrue
SmallIntSmallIntTypetrue
IntIntTypetrue
BigIntBigIntTypetrue
FloatFloatTypetrue
DoubleDoubleTypetrue
VarcharVarCharTypetrue
CharCharTypetrue
BinaryVarBinaryType, BinaryTypetrue
Decimal(precision, scale)DecimalType(precision, scale)true
DatetimeTimestampType,LocalZonedTimestampTypetrue
DateDateTypetrue
ArrayArrayTypefalse
MapMapTypefalse
StructRowTypefalse