File-based Foreign Table
Cloud platforms typically support general object storage systems, offering scalable file read and write capabilities. These platforms are commonly used for data storage in lake scenarios. This article introduces the configuration method for file-based external tables.
Installing the Extension
Install the extension once. If it is already installed, you can skip this step.
Create a Foreign Server for File Storage
Creating a Foreign Server for AWS S3
REGION
: The region ID of the cloud storage service. For specific IDs, see AWS S3 Endpoint.
Create User Mapping
Use 'access_id' and 'access_key' to grant the local user account access rights to the designated object storage.
Creating a Foreign Table
FILENAME
: The path to the specified external file inOPTIONS
.DIR
: The directory path for the specified external object storage inOPTIONS
.- The specified file format in
OPTIONS
, andFORMAT
can be CSV (comma-separated), text (plain text), parquet, or orc.