Create External Table
Function
The external table function allows Lakehouse to query and analyze data stored in external storage systems such as object storage. Users can directly operate on external data without importing the data into Lakehouse's internal storage, providing flexibility and convenience in data processing.
Supported Scope
- Supports Alibaba Cloud Object Storage OSS, Tencent Cloud Object Storage COS, Google Cloud Object Storage GCS, AWS Object Storage S3
- Currently only supports Delta Lake format
Syntax
Parameter Description
Required Parameters:
-
CREATE EXTERNAL TABLE: Declare the creation of an external table. -
table_name: The name of the external table. -
column_definition: Column definition, specifying the name and data type of the column. -
USING DELTA: Specify using the Delta format, currently only this format is supported. -
CONNECTION connection_name: Authentication information for connecting to an external data source,connection_nameis the name of the connection object defined in Lakehouse. Used for authentication connection information, connection object storage. -
LOCATION 'file_path': Specify the path of the data file to be read, supporting various cloud storage path formats.- Google Cloud Storage: format gs://bucketname/path
- Tencent Cloud Storage format: cos://bucketname/path
- Alibaba Cloud Storage format: oss://bucketname/path
- AWS object storage supports Alibaba Fish object storage format: s3://bucketname/path
Optional Parameters:
IF NOT EXISTS: If the external table does not exist, create it; if it already exists, do nothing.PARTITIONED BY (col_name col_type [, col_name col_type, ...]): Specify partition columns and their data types for data partitioning.COMMENT 'table_comment': Provide descriptive comments for the external table.
