Skip to main content

Export Overview

The data export function is used to write the query result set or Doris table data into the specified storage system in the specified file format.

The differences between the export function and the data backup function are as follows:

 Data ExportData Backup
Final Storage LocationHDFS, Object Storage, Local File SystemHDFS, Object Storage
Data FormatOpen file formats such as Parquet, ORC, CSVDoris internal storage format
Execution SpeedModerate (requires reading data and converting to the target data format)Fast (no parsing and conversion required, directly upload Doris data files)
FlexibilityCan flexibly define the data to be exported through SQL statementsOnly supports table-level full backup
Use CasesResult set download, data exchange between different systemsData backup, data migration between Doris clusters

Choosing Export Methods​

Doris provides three different data export methods:

  • SELECT INTO OUTFILE: Supports the export of any SQL result set.
  • EXPORT: Supports the export of partial or full table data.
  • MySQL DUMP: Compatible with the MySQL dump command for data export.

The similarities and differences between the three export methods are as follows:

 SELECT INTO OUTFILEEXPORTMySQL DUMP
Synchronous/AsynchronousSynchronousAsynchronous (submit EXPORT tasks and check task progress via SHOW EXPORT command)Synchronous
Supports any SQLYesNoNo
Export specific partitionsYesYesNo
Export specific tabletsYesNoNo
Concurrent exportSupported with high concurrency (depends on whether the SQL statement has operators such as ORDER BY that need to be processed on a single node)Supported with high concurrency (supports tablet-level concurrent export)Not supported, single-threaded export only
Supported export data formatsParquet, ORC, CSVParquet, ORC, CSVMySQL Dump proprietary format
Supports exporting external tablesYesPartially supportedNo
Supports exporting viewsYesYesYes
Supported export locationsS3, HDFSS3, HDFSLOCAL

SELECT INTO OUTFILE​

Suitable for the following scenarios:

  • Data needs to be exported after complex calculations, such as filtering, aggregation, joins, etc.
  • Suitable for scenarios that require synchronous tasks.

EXPORT​

Suitable for the following scenarios:

  • Large-scale single table export, with simple filtering conditions.
  • Scenarios that require asynchronous task submission.

MySQL Dump​

Suitable for the following scenarios:

  • Compatible with the MySQL ecosystem, requires exporting both table structure and data.
  • Only for development testing or scenarios with very small data volumes.

Export File Column Type Mapping​

Parquet and ORC file formats have their own data types. Doris's export function can automatically map Doris's data types to the corresponding data types in Parquet and ORC file formats. The CSV format does not have types, all data is output as text.

The following table shows the mapping between Doris data types and Parquet, ORC file format data types:

Doris TypeArrow TypeOrc Type
booleanbooleanboolean
tinyintint8tinyint
smallintint16smallint
intint32int
bigintint64bigint
largeIntutf8string
dateutf8string
datev2Date32Typestring
datetimeutf8string
datetimev2TimestampTypetimestamp
floatfloat32float
doublefloat64double
char / varchar / stringutf8string
decimaldecimal128decimal
structstructstruct
mapmapmap
arraylistarray
jsonutf8string
variantutf8string
bitmapbinarybinary
quantile_statebinarybinary
hllbinarybinary

Note: When Doris exports data to the Parquet file format, it first converts the in-memory data of Doris into the Arrow in-memory data format, and then writes it out to the Parquet file format via Arrow.