Skip to main content

Parquet

Load Parquet files into a warehouse with Stream Load, Broker Load, or a table-valued function. Choose the method based on the file location and whether you need asynchronous loading or SQL transformations.

Before you start​

Create or select the target database, and use a warehouse SQL user with the required table and load permissions. Copy the Stream Load request URL from Connection Methods. Replace <endpoint> with its scheme, host, and port, and preserve HTTPS when it is required. Replace <username> with your warehouse SQL username. The curl commands prompt for your password.

For object storage, HDFS, or Kafka, confirm that your warehouse can reach the source and use its supported authentication settings. HDFS and private-network access depend on your deployment. Each SQL snippet is a separate example. Replace source paths, connection properties, and job labels before running it.

Applicable scenarios​

Parquet is a columnar storage format commonly used for offline data warehouses and bulk data persisted in object storage. The following scenarios are well suited to using Parquet as the import source:

  • Bulk imports of historical data from object storage or distributed file systems such as S3 or HDFS.
  • Pushing locally generated or server-generated Parquet files via Stream Load.
  • Bulk loading of Parquet files stored remotely via Broker Load.
  • On-demand queries against Parquet data in object storage or HDFS using table-valued functions (TVF), with the results written back into VeloDB Cloud.

Supported import methods​

The following table summarizes the import methods that support the Parquet format and their typical uses:

Import methodApplicable scenariosDocumentation link
Stream LoadReal-time or batch push of local or server-side filesStream Load
Broker LoadBulk imports from remote storage (HDFS, object storage)Broker Load
INSERT INTO FROM S3 TVFDirectly query Parquet files on S3 and write to the target tableS3 TVF
INSERT INTO FROM HDFS TVFDirectly query Parquet files on HDFS and write to the target tableHDFS TVF

Usage examples​

The following snippets show the format-specific parts of each load method. Supply the storage connection properties before running them. Replace the placeholders in the examples (such as <username>, <endpoint>, and bucket) with values from your actual environment.

1. Load Parquet with Stream Load​

To push a local Parquet file directly to a VeloDB Cloud table over the HTTP interface, declare format: Parquet explicitly in the request header.

curl --location-trusted -u "<username>" \
-H "format: parquet" \
-T example.parquet \
"<endpoint>/api/example_db/example_table/_stream_load"

Notes:

  • -H "format: parquet": declares that the imported file is in Parquet format.
  • -T example.parquet: specifies the local Parquet file to upload.
  • example_db and example_table in the URL are the target database and target table, respectively.

2. Load Parquet with Broker Load​

This method is suited to bulk loading of Parquet files from object storage or HDFS. Use FORMAT AS "parquet" to specify the file format.

LOAD LABEL example_db.example_label
(
DATA INFILE("s3://bucket/example.parquet")
INTO TABLE example_table
FORMAT AS "parquet"
)
WITH S3
(
"s3.endpoint" = "https://<s3-endpoint>",
"s3.region" = "<region>",
"s3.access_key" = "<access-key>",
"s3.secret_key" = "<secret-key>"
);

Notes:

  • DATA INFILE: specifies the remote path of the Parquet file. Protocols such as s3:// and hdfs:// are supported.
  • FORMAT AS "parquet": declares that the source file is in Parquet format.
  • WITH S3 (...): provides the credentials required to access object storage, such as endpoint, access_key, and secret_key.

3. Load Parquet with a TVF​

Use a table-valued function (TVF) together with INSERT INTO ... SELECT to read remote Parquet files directly and write them into the target table. This method is suitable for on-demand imports and for persisting the results of ad hoc analysis.

INSERT INTO example_table
SELECT *
FROM S3
(
"uri" = "s3://bucket/example.parquet",
"format" = "parquet",
"s3.endpoint" = "https://<s3-endpoint>",
"s3.region" = "<region>",
"s3.access_key" = "<access-key>",
"s3.secret_key" = "<secret-key>"
);

Notes:

  • S3(...): a table-valued function. The parameters must include uri and format. Add other parameters (such as authentication information) as needed.
  • For HDFS, use the HDFS TVF with its uri and HDFS connection properties. S3 credentials do not apply to HDFS.
  • SELECT * can be replaced with a column list or a query with filter conditions to import only the data you need.

FAQ​

Q1: Do you need to specify the file format explicitly when importing Parquet?

Yes. Stream Load specifies it via the format: parquet request header; Broker Load specifies it via FORMAT AS "parquet"; TVF specifies it via the "format" = "parquet" parameter.

Q2: Is importing Parquet from HDFS supported?

Yes. You can use Broker Load (with an hdfs:// path in DATA INFILE) or the HDFS TVF.

Q3: What is the difference between TVF imports and Broker Load?

Broker Load is an asynchronous bulk import job, suitable for large batches and jobs submitted by your own scheduler. A TVF runs synchronously through INSERT INTO ... SELECT, which is suitable for on-demand imports and for scenarios that require filtering, aggregation, or other processing before the data is loaded.

Common errors​

  • Authentication or connection failure: Check the generated warehouse endpoint, TLS requirements, SQL user permissions, and network access. For remote files, also check source credentials and reachability.
  • Filtered rows or parsing errors: Check the input format, delimiters, field mappings, and target column types. Inspect the returned load error before retrying. Raising the filter tolerance can discard data.
  • Unexpected duplicate rows: These examples use independent loads. Check the table model and existing rows before rerunning a sample.

See also​

Ask AI