Skip to main content
This feature requires StarTree Cloud 0.18.0 or later. Contact StarTree support to enable the Hive Metastore catalog for your environment.
This page creates a Hive Metastore (HMS) External Table with one CREATE TABLE ... WITH statement through SQL DDL. Onboarding via API is the main Hive Metastore page. What’s supported, requirements, every option with its SQL DDL name, query behavior, limits and errors are all there. This page covers only what’s specific to SQL DDL.

Create the table

Send CREATE TABLE ... WITH (...) to POST /sql/ddl. DDL sets catalogType = hive and executor = controller for you. It infers the schema and creates an OFFLINE table.
  • Options. Use the names in the SQL DDL option column of the configuration reference.
  • type must match the table in HMS: iceberg for Iceberg tables, hive for native Parquet tables. type = 'hive' implies catalog_type = 'hive'.
  • snapshot_mode takes lowercase values: latest, earliest, snapshot_id. Setting snapshot_id implies snapshot_mode = 'snapshot_id'.
  • refresh_interval takes Ns / Nm (1–59), Nh (1–23), Nd (1–31), or a Quartz cron expression.
  • Other keys. Any option DDL doesn’t know is copied as-is into the task config, with a warning. Use this for keys such as 'enableDeletionVectors' = 'true'.
  • Azure. With storage.provider = 'azure', DDL also sets externalTableAccessPolicy = azure-sas. The S3 options are rejected with Azure, and the SAS options are rejected without it.
  • No effect. enable_schema_evolution and enable_metadata_caching are accepted with a warning and do nothing.

Change or remove

There is no ALTER for these options. To change one, drop the table and create it again. Also create a new table if the HMS table changes between native Parquet and Iceberg.

Examples

POST /sql/ddl takes a JSON body with one field, sql. Add ?dryRun=true to compile and validate without creating anything. The easiest way to send a multi-line statement is to wrap a .sql file with jq:

Iceberg in HMS, no authentication

create.sql:
The resulting sync task config:
If the Iceberg table has row deletes, add 'enableDeletionVectors' = 'true' to the WITH clause. Without it, deletes are not applied.

Kerberos-secured HMS

This uses Kerberos with a keytab, plus TLS with a custom truststore. With TLS on, sasl_qop must be auth. Stock Hive 2.3.9 can’t combine Kerberos and TLS on one listener; drop the TLS lines for it.
To use a delegation token instead, replace the four Kerberos lines with:
StarTree does not renew the token. Renew or replace it before it expires.

Native Hive Parquet, partitioned

The HMS table analytics.events is a Parquet table partitioned by event_day. It must already contain at least one Parquet file.
For Azure, replace the storage lines:
The resulting sync task config (S3):
If you write the table config JSON yourself, keep executor = controller, leave out enabled, and don’t set segmentGroupConfig, enableSnapshotConsistency = true or enableDeletionVectors = true.

Run the first sync

DDL does not run a sync. Wait for refresh_interval, or start one now:

Verify

Check the sync status and row count as described in Verify on the API page. If a statement fails, look up the message in Common errors.