Use a Delta Lake catalog—an external catalog type in E-MapReduce (EMR) StarRocks—to run SQL queries against Delta Lake data without moving or copying the data. This topic explains how to create a Delta Lake catalog and query Delta Lake tables from an EMR StarRocks cluster.
Prerequisites
Before you begin, ensure that you have:
A cluster with the Delta Lake service, such as a DataLake cluster or a custom cluster. For more information, see Create a cluster
A StarRocks cluster. For more information, see Create a StarRocks cluster
Create a Delta Lake catalog
Syntax
CREATE EXTERNAL CATALOG <catalog_name>
PROPERTIES
(
"key"="value",
...
);Parameters
catalog_name
Required. The name of the Delta Lake catalog. The name must meet the following requirements:
Can contain letters, digits, and underscores (
_), and must start with a letterMust be 1 to 64 characters in length
PROPERTIES
Required. The properties of the Delta Lake catalog. The required properties vary based on the metadata service used by the Delta Lake data source.
Hive Metastore
| Property | Required | Description |
|---|---|---|
type | Yes | The type of the data source. Set the value to deltalake. |
hive.metastore.uris | Yes | The URI of the Hive metastore. Format: thrift://<metastore_IP>:<port>. The default port is 9083. |
Data Lake Formation (DLF)
For more information, see Access external tables whose metadata is stored in DLF.
Example
CREATE EXTERNAL CATALOG delta_catalog
PROPERTIES
(
"type" = "deltalake",
"hive.metastore.uris" = "thrift://xx.xx.xx.xx:9083"
);Query data in a Delta Lake table
You can execute the following statement to query data in a specific table of a database:
SELECT * FROM <catalog_name>.<database_name>.<table_name>;