Skip to main content
Experimental feature Advice on use of experimental features The database supports Kudu catalogs from v3.3 onwards. A Kudu catalog is a kind of external catalog that enables you to query data from Apache Kudu without ingestion. Also, you can directly transform and load data from Kudu by using INSERT INTO based on Kudu catalogs. To ensure successful SQL workloads on your Kudu cluster, your cluster needs to integrate with the following important components:
  • Metastore like your kudu file system or Hive metastore

Usage notes

You can only use Kudu catalogs to query data. You cannot use Kudu catalogs to drop, delete, or insert data into your Kudu cluster.

Integration preparations

Before you create a Kudu catalog, make sure your cluster can integrate with the storage system and metastore of your Kudu cluster.
NOTE If an error indicating an unknown host is returned when you send a query, you must add the mapping between the host names and IP addresses of your KUDU cluster nodes to the /etc/hosts path.

Kerberos authentication

If Kerberos authentication is enabled for your KUDU cluster or Hive metastore, configure your cluster as follows:
  • Run the kinit -kt keytab_path principal command on each FE and each BE to obtain Ticket Granting Ticket (TGT) from Key Distribution Center (KDC). To run this command, you must have the permissions to access your KUDU cluster and Hive metastore. Note that accessing KDC with this command is time-sensitive. Therefore, you need to use cron to run this command periodically.
  • Add JAVA_OPTS="-Djava.security.krb5.conf=/etc/krb5.conf" to the FEHOME/conf/fe.conf∗∗fileofeachFEandtothe∗∗FE_HOME/conf/fe.conf** file of each FE and to the **BE_HOME/conf/be.conf file of each BE. In this example, /etc/krb5.conf is the save path of the krb5.conf file. You can modify the path based on your needs.

Create a Kudu catalog

Syntax

Parameters

catalog_name

The name of the Kudu catalog. The naming conventions are as follows:
  • The name can contain letters, digits (0-9), and underscores (_). It must start with a letter.
  • The name is case-sensitive and cannot exceed 1023 characters in length.

comment

The description of the Kudu catalog. This parameter is optional.

type

The type of your data source. Set the value to kudu.

CatalogParams

A set of parameters about how the database accesses the metadata of your Kudu cluster. The following table describes the parameter you need to configure in CatalogParams.
NOTE If you use Hive metastore, you must add the mapping between the host names and IP addresses of your Hive metastore nodes to the /etc/hosts path before you query Kudu data. Otherwise, the database may fail to access your Hive metastore when you start a query.

Examples

  • The following examples create a Kudu catalog named kudu_catalog whose metastore type kudu.catalog.type is set to kudu to query data from your Kudu cluster.
  • The following examples create a Kudu catalog named kudu_catalog whose metastore type kudu.catalog.type is set to hive to query data from your Kudu cluster.

View Kudu catalogs

You can use SHOW CATALOGS to query all catalogs in the current cluster:
You can also use SHOW CREATE CATALOG to query the creation statement of an external catalog. The following example queries the creation statement of a Kudu catalog named kudu_catalog:

Drop a Kudu catalog

You can use DROP CATALOG to drop an external catalog. The following example drops a Kudu catalog named kudu_catalog:

View the schema of a Kudu table

You can use one of the following syntaxes to view the schema of a Kudu table:
  • View schema
  • View schema and location from the CREATE statement

Query a Kudu table

  1. Use SHOW DATABASES to view the databases in your Kudu cluster:
  2. Use SET CATALOG to switch to the destination catalog in the current session:
    Then, use USE to specify the active database in the current session:
    Or, you can use USE to directly specify the active database in the destination catalog:
  3. Use SELECT to query the destination table in the specified database:

Load data from Kudu

Suppose you have an OLAP table named olap_tbl, you can transform and load data like below: