Data Export Overview
Export query results or table data from a VeloDB Cloud warehouse to external storage for downloads and data exchange. Use SELECT INTO OUTFILE for query results, EXPORT for asynchronous table exports, or mysqldump for small SQL dumps on your client.
Export and backup
Data export produces files such as Parquet, ORC, CSV, or SQL dumps for use in other systems. It does not preserve the complete warehouse configuration, SQL users, permissions, or managed recovery state. Use the warehouse backup and recovery workflow when you need to recover a warehouse.
Server-side export writes to object storage or HDFS that your warehouse can reach. It does not download files to your computer. Download the generated objects with your storage provider's tools, or use mysqldump to write a small SQL dump directly on your client.
Choose an export method
Choose among these three methods:
- SELECT INTO OUTFILE: supports exporting any SQL result set.
- EXPORT: supports exporting partial or full data at the table level.
- MySQL Dump: writes schemas and small data sets as SQL statements on your client.
Method comparison
The following table compares the three export methods across execution mode, SQL capabilities, concurrency, and supported formats, helping you choose quickly:
| Comparison Dimension | SELECT INTO OUTFILE | EXPORT | MySQL Dump |
|---|---|---|---|
| Synchronous / Asynchronous | Synchronous | Asynchronous (check progress with SHOW EXPORT after submission) | Synchronous |
| Supports arbitrary SQL | Supported | Not supported | Not supported |
| Export specified partitions | Supported | Supported | Not supported |
| Export specified tablets | Supported | Not supported | Not supported |
| Concurrent export | Parallel where the query plan allows | Parallel tasks for internal tables | One table at a time |
| Supported export formats | Parquet, ORC, CSV | Parquet, ORC, CSV | SQL statements |
| Supports external tables | Supported | Supported, without internal-table task splitting | Not supported |
| Supports views | Supported | Supported | Supported |
| Supported export locations | S3, HDFS | S3, HDFS | Client file system |
When to use each method
SELECT INTO OUTFILE
Suitable for the following scenarios:
- The exported data needs to go through complex computation logic, such as filtering, aggregation, or joins.
- Scenarios suitable for executing synchronous tasks.
For detailed usage, see SELECT INTO OUTFILE.
EXPORT
Suitable for the following scenarios:
- Single-table export of large data volumes that requires only simple filter conditions.
- Scenarios that require asynchronous task submission.
For detailed usage, see Export Data Asynchronously.
MySQL Dump
Suitable for the following scenarios:
- Compatibility with the MySQL ecosystem, with the need to export both table schemas and data.
- Use it for development, testing, schemas, or small data volumes. Review generated SQL before importing it.
For detailed usage, see MySQL Dump.
Type mappings for exported files
Parquet and ORC define their own data types. During export, the query engine converts warehouse data types to the corresponding file types. CSV stores values as text. Verify that the receiving system supports the exported types, especially timestamps and complex values.
The mappings between warehouse data types and the ORC and Parquet formats are listed below.
ORC type mapping
| Warehouse type | ORC Type |
|---|---|
| boolean | boolean |
| tinyint | tinyint |
| smallint | smallint |
| int | int |
| bigint | bigint |
| largeInt | string |
| date | string |
| datev2 | date |
| datetime | string |
| datetimev2 | timestamp |
| timestamptz | timestamp with local time zone (ORC TIMESTAMP_INSTANT) |
| varbinary | binary |
| float | float |
| double | double |
| char / varchar / string | string |
| decimal | decimal |
| struct | struct |
| map | map |
| array | array |
| json | string |
| variant | string |
| bitmap | binary |
| quantile_state | binary |
| hll | binary |
Parquet type mapping
Parquet export converts values through Arrow. The mappings are as follows:
| Warehouse type | Arrow Type | Parquet Physical Type | Parquet Logical Type |
|---|---|---|---|
| boolean | boolean | BOOLEAN | |
| tinyint | int8 | INT32 | INT_8 |
| smallint | int16 | INT32 | INT_16 |
| int | int32 | INT32 | INT_32 |
| bigint | int64 | INT64 | INT_64 |
| largeInt | utf8 | BYTE_ARRAY | UTF8 |
| date | utf8 | BYTE_ARRAY | UTF8 |
| datev2 | date32 | INT32 | DATE |
| datetime | utf8 | BYTE_ARRAY | UTF8 |
| datetimev2 | timestamp | INT96 / INT64 | TIMESTAMP(MICROS/MILLIS/SECONDS) |
| float | float32 | FLOAT | |
| double | float64 | DOUBLE | |
| char / varchar / string | utf8 | BYTE_ARRAY | UTF8 |
| decimal | decimal128 | FIXED_LEN_BYTE_ARRAY | DECIMAL(scale, precision) |
| struct | struct | Parquet Group | |
| map | map | Parquet Map | |
| array | list | Parquet List | |
| json | utf8 | BYTE_ARRAY | UTF8 |
| variant | utf8 | BYTE_ARRAY | UTF8 |
| bitmap | binary | BYTE_ARRAY | |
| quantile_state | binary | BYTE_ARRAY | |
| hll | binary | BYTE_ARRAY |
Note:
For Core 26.1.3, Parquet export uses INT96 timestamp encoding by default. For
SELECT INTO OUTFILE,enable_int96_timestampscontrols this choice. Core 26.1.3 does not accept this property inEXPORT. A future release changes the default tofalse, which writes logical INT64 timestamps, and adds stricter value validation. Confirm the behavior of your warehouse version before relying on this change. Do not useparquet.enable_int96_timestampsas the property name.
See also
- Export Data Asynchronously: use the
EXPORTcommand to asynchronously export table or partition data. - SELECT INTO OUTFILE: use
SELECT INTO OUTFILEto synchronously export query results. - MySQL Dump: use the
mysqldumptool to export table schemas and data. - Data Export Best Practices: export concurrency tuning and methods for evaluating export speed.