FILE
Description
When you select local storage, this function reads files from managed compute hosts; it does not upload files from your computer. Before using local storage, ask VeloDB Cloud support to confirm access and arrange any required files, mount points, and managed configuration. For ordinary file queries, use S3, HTTP, or HDFS with storage reachable from the warehouse.
The File table-valued-function (tvf) is a wrapper around table functions like S3, HDFS, and LOCAL, providing a unified interface to access file contents on different storage systems.
This function is available in Core 26.1.3.
Syntax
FILE(
{StorageProperties},
{FileFormatProperties}
)
-
{StorageProperties}The StorageProperties section is used to fill in connection and authentication information related to the storage system. For details, please refer to the [Supported Storage Systems] section.
-
{FileFormatProperties}The FileFormatProperties section is used to fill in properties related to file formats, such as CSV delimiters. For details, please refer to the [Supported File Formats] section.
Supported storage systems
Supported file formats
Examples
Access S3 storage
select * from file(
"fs.s3.support" = "true",
"uri" = "s3://bucket/file.csv",
"s3.access_key" = "<access-key>",
"s3.secret_key" = "<secret-key>",
"s3.endpoint" = "endpoint",
"s3.region" = "region",
"format" = "csv"
);
Access HDFS storage
select * from file(
"fs.hdfs.support" = "true",
"uri" = "hdfs://path/to/file.csv",
"fs.defaultFS" = "hdfs://<hdfs-host>:<hdfs-port>",
"hadoop.username" = "doris",
"format" = "csv"
);
Access local storage
select * from file(
"fs.local.support" = "true",
"file_path" = "student.csv",
"backend_id" = "10003",
"format" = "csv"
);
Inspect the inferred schema
desc function file(
"fs.s3.support" = "true",
"uri" = "s3://bucket/file.csv",
"s3.access_key" = "<access-key>",
"s3.secret_key" = "<secret-key>",
"s3.endpoint" = "endpoint",
"s3.region" = "region",
"format" = "csv"
);