Data Catalog Overview
A data catalog stores the connection properties used to access a data source from a warehouse.
Before creating a catalog, ensure that the warehouse can reach both its metadata service and storage endpoints, and that the source credentials have the required permissions. SQL catalogs and Console integrations have different setup workflows; a catalog does not require a matching Console integration. Use SQL Editor or a SQL client connected to your warehouse.
In VeloDB Cloud, you can create multiple data catalogs pointing to different data sources (such as Hive, Iceberg, Paimon, PostgreSQL). VeloDB Cloud automatically retrieves databases, tables, schemas, partitions, and data locations from the corresponding data source through data catalogs. Users can access these data catalogs for data analysis using standard SQL statements, and perform join queries across data from multiple data catalogs.
There are two types of data catalogs in VeloDB Cloud:
| Type | Description |
|---|---|
| Internal Catalog | The built-in data catalog with a fixed name of internal, used to store warehouse table data. It cannot be created, modified, or dropped. |
| External Catalog | External data catalogs, referring to all data catalogs other than the Internal Catalog. Users can create, modify, and drop external data catalogs. |
Data catalogs are primarily applicable to the following three types of scenarios, but different data catalogs have different applicable scenarios. Refer to the corresponding data catalog documentation for details.
| Scenario | Description |
|---|---|
| Query acceleration | Query on lakehouse data such as Hive, Iceberg, Paimon, etc. |
| Data Integration | Query multiple sources without first loading their data into warehouse tables. |
| Write data to external sources | Process and transform data through VeloDB Cloud, then write it back to external data sources. |
This article uses Iceberg Catalog as an example to introduce the basic operations of data catalogs. For detailed introductions to different data catalogs, please refer to the corresponding data catalog documentation.
Create a data catalog
Create an Iceberg Catalog using the CREATE CATALOG statement.
CREATE CATALOG iceberg_catalog PROPERTIES (
'type' = 'iceberg',
'iceberg.catalog.type' = 'hadoop',
'warehouse' = 's3://bucket/dir/key',
's3.endpoint' = 'https://s3.us-east-1.amazonaws.com',
's3.access_key' = 'ak',
's3.secret_key' = 'sk'
);
Essentially, a data catalog created in VeloDB Cloud acts as a "proxy" to access the metadata service (such as Hive Metastore) and storage service (such as HDFS/S3) of the corresponding data source. The warehouse stores the catalog configuration and caches metadata as needed; creating a catalog does not copy the source data into warehouse tables.
Common properties
In addition to the property set specific to each data catalog, this section introduces the common properties {CommonProperties} shared by all data catalogs.
| Property | Description | Example |
|---|---|---|
include_database_list | Specifies multiple databases to synchronize, separated by ,. By default, all databases are synchronized. Database names are case-sensitive. When the external data source has a large number of databases but only a few need to be accessed, this parameter can be used to avoid synchronizing a large amount of metadata. | 'include_database_list' = 'db1,db2' |
exclude_database_list | Specifies multiple databases to exclude from synchronization, separated by ,. By default, no filtering is applied and all databases are synchronized. Database names are case-sensitive. Applicable to the same scenario as above, but for inversely excluding databases that do not need to be accessed. In case of conflict, exclude takes precedence over include. | 'exclude_database_list' = 'db1,db2' |
include_table_list | Specifies multiple tables to synchronize, in db.tbl format, separated by ,. When set, listing tables under a database will only return the specified tables, rather than fetching the full table list from the remote metadata service. Applicable when the external data source has a large number of tables and fetching the full table list may time out. | 'include_table_list' = 'db1.tbl1,db1.tbl2,db2.tbl3' |
lower_case_table_names | Catalog-level table name case control. See the Table Name Case Sensitivity section below for values and their meanings. The default value inherits from the global variable lower_case_table_names. | 'lower_case_table_names' = '1' |
lower_case_database_names | Catalog-level database name case control. See the Database Name Case Sensitivity section below for values and their meanings. The default value is 0 (case-sensitive). | 'lower_case_database_names' = '2' |
Specify a table list
This behavior is implemented in Core 26.1.3.
When the external data source (such as Hive Metastore) contains a large number of tables, fetching the full table list from the remote metadata service can be very time-consuming or even time out. By setting the include_table_list property, you can specify the tables to synchronize and avoid fetching the full table list from the remote.
include_table_list uses the db.tbl format, with multiple tables separated by commas ,.
CREATE CATALOG hive_catalog PROPERTIES (
'type' = 'hms',
'hive.metastore.uris' = 'thrift://hms-host:9083',
'include_table_list' = 'db1.table1,db1.table2,db2.table3'
);
Behavior after setting:
- When listing tables under
db1, onlytable1andtable2are returned, without calling the remote metadata service's full table list API. - When listing tables under
db2, onlytable3is returned. - For databases not included in
include_table_list(such asdb3), the full table list will still be fetched from the remote metadata service. - Incorrectly formatted entries in
include_table_list(not indb.tblformat) will be ignored.
Tip:
This property can be used in combination with
include_database_list. For example, first filter the required databases usinginclude_database_list, then further specify the required tables usinginclude_table_list.
Table name case sensitivity
This behavior is implemented in Core 26.1.3.
The lower_case_table_names property allows you to control table name case handling at the Catalog level. This property supports three modes:
| Value | Mode | Description |
|---|---|---|
0 | Case-sensitive (default) | Table names are stored and compared with their original case. When referencing a table name, it must exactly match the case in the remote metadata. |
1 | Stored as lowercase | Table names are stored in lowercase in VeloDB Cloud. Suitable for scenarios where you want to uniformly use lowercase table names to access external data sources. |
2 | Case-insensitive comparison | Table names are compared in a case-insensitive manner, but the original case from the remote metadata is preserved when displayed. Suitable for scenarios where table name cases are inconsistent in the external data source and you want to access tables in a case-insensitive way. |
If this property is not set, it inherits the value of the global variable lower_case_table_names by default.
CREATE CATALOG hive_catalog PROPERTIES (
'type' = 'hms',
'hive.metastore.uris' = 'thrift://hms-host:9083',
'lower_case_table_names' = '2'
);
Warning:
When
lower_case_table_namesis set to1or2, if tables with names that differ only in case exist in the remote metadata (such asMyTableandmytable), conflicts may occur. VeloDB Cloud will detect such conflicts and report an error.
Database name case sensitivity
This behavior is implemented in Core 26.1.3.
The lower_case_database_names property allows you to control database name case handling at the Catalog level. This property supports three modes:
| Value | Mode | Description |
|---|---|---|
0 | Case-sensitive (default) | Database names are stored and compared with their original case. When referencing a database name, it must exactly match the case in the remote metadata. |
1 | Stored as lowercase | Database names are stored in lowercase in VeloDB Cloud. Suitable for scenarios where you want to uniformly use lowercase database names to access external data sources. |
2 | Case-insensitive comparison | Database names are compared in a case-insensitive manner, but the original case from the remote metadata is preserved when displayed. Suitable for scenarios where database name cases are inconsistent in the external data source and you want to access databases in a case-insensitive way. |
The default value is 0 (case-sensitive).
CREATE CATALOG hive_catalog PROPERTIES (
'type' = 'hms',
'hive.metastore.uris' = 'thrift://hms-host:9083',
'lower_case_database_names' = '2',
'lower_case_table_names' = '2'
);
Warning:
When
lower_case_database_namesis set to1or2, if databases with names that differ only in case exist in the remote metadata (such asMyDBandmydb), conflicts may occur. VeloDB Cloud will detect such conflicts and report an error.
Note:
lower_case_database_namesandlower_case_table_namescan be set independently without affecting each other. For example, you can set database names to be case-sensitive (0) while setting table names to be case-insensitive (2).
Column type mapping
After a user creates a data catalog, VeloDB Cloud automatically synchronizes the databases, tables, and schemas of the data catalog. For column type mapping rules of different data catalogs, please refer to the corresponding data catalog documentation.
For external data types that cannot currently be mapped to VeloDB Cloud column types, such as UNION, INTERVAL, etc., VeloDB Cloud maps the column type to UNSUPPORTED. For queries involving UNSUPPORTED types, see the following examples:
Assume the synchronized table schema is:
k1 INT,
k2 INT,
k3 UNSUPPORTED,
k4 INT
The query behavior is as follows:
SELECT * FROM table; -- Error: Unsupported type 'UNSUPPORTED_TYPE' in 'k3'
SELECT * EXCEPT(k3) FROM table; -- Query OK.
SELECT k1, k3 FROM table; -- Error: Unsupported type 'UNSUPPORTED_TYPE' in 'k3'
SELECT k1, k4 FROM table; -- Query OK.
Nullable property
VeloDB Cloud currently has special limitations on the Nullable property support for external table columns. The specific behavior is as follows:
| Source Type | VeloDB Cloud Read Behavior | VeloDB Cloud Write Behavior |
|---|---|---|
| Nullable | Nullable | Allows writing Null values |
| Not Null | Nullable, i.e., still read as a column that allows NULL | Allows writing Null values, i.e., no strict check on Null values. Users need to ensure data integrity and consistency on their own. |
Use data catalogs
View data catalogs
After creation, you can view the catalog using the SHOW CATALOGS command:
mysql> SHOW CATALOGS;
+-----------+-----------------+----------+-----------+-------------------------+---------------------+------------------------+
| CatalogId | CatalogName | Type | IsCurrent | CreateTime | LastUpdateTime | Comment |
+-----------+-----------------+----------+-----------+-------------------------+---------------------+------------------------+
| 10024 | iceberg_catalog | iceberg | yes | 2023-12-25 16:11:41.687 | 2023-12-25 20:43:18 | NULL |
| 0 | internal | internal | | NULL | NULL | Doris internal catalog |
+-----------+-----------------+----------+-----------+-------------------------+---------------------+------------------------+
You can view the CREATE CATALOG statement using SHOW CREATE CATALOG.
Switch data catalogs
VeloDB Cloud provides the SWITCH statement to switch the connection session context to the corresponding data catalog, similar to using the USE statement to switch databases.
After switching to a data catalog, you can use the USE statement to further switch to a specific database, or use SHOW DATABASES to view the databases under the current data catalog.
SWITCH iceberg_catalog;
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| iceberg_db |
+--------------------+
USE iceberg_db;
You can also use the USE statement with the fully qualified name catalog_name.database_name to directly switch to a specific database under a specific data catalog:
USE iceberg_catalog.iceberg_db;
The fully qualified name can also be used in MySQL command line or JDBC connection strings to be compatible with the MySQL connection protocol.
# Command line tool
mysql -h <warehouse-host> -P <mysql-port> -u <sql-user> -p -D iceberg_catalog.iceberg_db
# JDBC url
jdbc:mysql://<warehouse-host>:<mysql-port>/iceberg_catalog.iceberg_db
The built-in data catalog has a fixed name of internal. The switching method is the same as for external data catalogs.
Default data catalog
Use the user property default_init_catalog to set the default data catalog for a specific user. Once set, when the specified user connects to VeloDB Cloud, the session will automatically switch to the configured data catalog.
SET PROPERTY default_init_catalog=hive_catalog;
Note 1: If a data catalog is explicitly specified in the MySQL command line or JDBC connection string, the specified one takes precedence and the default_init_catalog user property does not take effect.
Note 2: If the data catalog set by the user property default_init_catalog no longer exists, the session will automatically switch to the default internal data catalog.
Run queries
You can query tables in external data catalogs using any SQL statement supported by VeloDB Cloud.
SELECT id, SUM(cost) FROM iceberg_db.table1
GROUP BY id ORDER BY id;
Query across catalogs
VeloDB Cloud supports join queries across data catalogs.
Create a MySQL Catalog. Replace the connection placeholders and use a driver URL approved for the warehouse; contact VeloDB Cloud support if driver provisioning is needed:
CREATE CATALOG mysql_catalog properties(
'type' = 'jdbc',
'user' = '<source-user>',
'password' = '<source-password>',
'jdbc_url' = 'jdbc:mysql://<mysql-host>:3306/mysql_db',
'driver_url' = '<approved-driver-url>',
'driver_class' = 'com.mysql.cj.jdbc.Driver'
);
Then perform a join query between the Iceberg table and the MySQL table using SQL:
SELECT * FROM
iceberg_catalog.iceberg_db.table1 tbl1 JOIN mysql_catalog.mysql_db.dim_table tbl2
ON tbl1.id = tbl2.id;
Load data into warehouse tables
You can import data from data sources into VeloDB Cloud using the INSERT command.
INSERT INTO internal.doris_db.tbl1
SELECT * FROM iceberg_catalog.iceberg_db.table1;
You can also use the CTAS (Create Table As Select) statement to create a warehouse table from an external data source and import the data:
CREATE TABLE internal.doris_db.tbl1
AS
SELECT * FROM iceberg_catalog.iceberg_db.table1;
Write data to external sources
VeloDB Cloud supports writing data back to external data sources directly using the INSERT statement. For details, refer to:
Refresh data catalogs
Data catalogs created in VeloDB Cloud act as "proxies" to access the metadata service of the corresponding data source. VeloDB Cloud caches some metadata. Caching can improve metadata access performance and avoid frequent cross-network requests. However, caching also has timeliness issues — if the cache is not refreshed, the latest metadata cannot be accessed. Therefore, VeloDB Cloud provides multiple ways to refresh data catalogs.
-- Refresh catalog
REFRESH CATALOG catalog_name;
-- Refresh specified database
REFRESH DATABASE catalog_name.db_name;
-- Refresh specified table
REFRESH TABLE catalog_name.db_name.table_name;
You can disable selected metadata-cache entries when freshness is more important than reducing metadata-service requests. Disabling a cache increases source load and does not guarantee that the source itself returns current data. See Metadata Cache and the cache settings for each catalog:
Modify data catalogs
You can modify the properties or name of a data catalog using ALTER CATALOG:
-- Rename a catalog
ALTER CATALOG iceberg_catalog RENAME iceberg_catalog2;
-- Modify properties of a catalog
ALTER CATALOG iceberg_catalog SET PROPERTIES ('key1' = 'value1' [, 'key' = 'value2']);
-- Modify the comment of a catalog
ALTER CATALOG iceberg_catalog MODIFY COMMENT 'my iceberg catalog';
Drop data catalogs
You can drop a specified external data catalog using DROP CATALOG.
DROP CATALOG [IF EXISTS] iceberg_catalog;
Dropping an external data catalog from VeloDB Cloud does not delete the actual data. It only removes the data catalog mapping stored in VeloDB Cloud.
Permission management
Grant warehouse SQL privileges on external catalogs, databases, and tables to control SQL access. These grants do not replace permissions on the external metadata and storage services. See Privileges.
External table partition validation
The following validation is planned for a future release. It is not part of the verified Core 26.1.3 scope. External table creation validates the Catalog partition model before converting the partition definition:
| Catalog | Supported definition | Unsupported definition |
|---|---|---|
| Hive | PARTITION BY LIST using existing column names | RANGE, partition expressions, and explicit partition values |
| Paimon / MaxCompute | Partition keys specified by column name | Partition function expressions and explicit partition values |
| Iceberg | Supported column or transform partition definitions | Explicit partition values in VeloDB Cloud internal-table syntax |
Do not reuse internal-table definitions that enumerate partition values for external tables. For example, Hive creates partitions from the data written, so you do not need to list VALUES IN (...) in advance.