<@U0A71G31CDV> Is it possible to modify the prope...
# questions-and-troubleshooting
s
@Rocky Is it possible to modify the properties of an existing StarRocks catalog?
r
Yes, you can modify the properties of an existing catalog in StarRocks using the
ALTER CATALOG
statement. This feature was introduced in recent versions (added via PR #56212 and confirmed in versions such as v3.2.x, v3.3.x, and v4.0). Syntax The basic syntax for modifying catalog properties is:
Copy code
sql
ALTER CATALOG <catalog_name> SET ("key" = "value", ...);
(Note: Some contexts or versions may also use
SET PROPERTIES
instead of just
SET
).
Common Use Cases You can modify various configuration properties depending on the catalog type (Hive, Iceberg, JDBC, etc.). Common examples include: * Updating Metadata Cache Settings: If you need to change how frequently StarRocks refreshes external metadata:
Copy code
sql
    ALTER CATALOG hive_catalog SET ("metastore_cache_refresh_interval_sec" = "600");
* Integrating with Apache Ranger: To add or update a Ranger service name for access control:
Copy code
sql
    ALTER CATALOG hive_catalog SET ("ranger.plugin.hive.service.name" = "ranger_hive_service");
* Modifying Connection URIs: For catalogs like Hive or Iceberg, you can update the metastore URI:
Copy code
sql
    ALTER CATALOG paimon_catalog SET ("hive.metastore.uris" = "<thrift://new_host:9083>");
* Disabling Caches: Useful for troubleshooting or when external data changes very frequently:
Copy code
sql
    ALTER CATALOG iceberg_catalog SET ("enable_iceberg_metadata_cache" = "false");
Important Notes * Documentation: As of some recent releases, this command may not be fully detailed in all versions of the official "SQL Reference" docs, but it is functional and recommended for updates that don't require a full catalog recreation. * Internal Catalog: You cannot modify the properties of the
default_catalog
(the internal StarRocks catalog) using this command. * Recreation Alternative: If you are on an older version (pre-v3.2) that does not support
ALTER CATALOG
, you must
DROP CATALOG <name>
and then
CREATE EXTERNAL CATALOG <name>
with the updated properties. Referencessql-reference/sql-statements/Catalog/SET_CATALOG.mdsql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.mdsql-reference/sql-statements/Catalog/CREATE_EXTERNAL_CATALOG.mdsql-reference/sql-statements/Resource/ALTER_RESOURCE.mddata_source/catalog/unified_catalog.mddata_source/catalog/hive_catalog.md
s
@Rocky Is it possible to modify the properties of an existing StarRocks external catalog?
r
Yes, it is possible to modify the properties of an existing StarRocks external catalog using the
ALTER CATALOG
statement. This feature was introduced via PR #56212 and is available in StarRocks versions v3.3.12+, v3.4, and v4.0. Syntax
Copy code
sql
ALTER CATALOG <catalog_name> SET ("key" = "value", ...);
Usage Examples You can update various configuration properties depending on the catalog type without needing to drop and recreate it. Common use cases include: * Integrating Apache Ranger: Update or add Ranger service names for external access control:
Copy code
sql
    ALTER CATALOG hive_catalog SET ("ranger.plugin.hive.service.name" = "ranger_hive_svc");
* Adjusting Metadata Cache: Modify how frequently StarRocks refreshes external metadata (e.g., for Hive or Hudi):
Copy code
sql
    ALTER CATALOG my_hive_catalog SET ("metastore_cache_refresh_interval_sec" = "600");
* Updating Connection URIs: Update the Hive Metastore or Glue connection details:
Copy code
sql
    ALTER CATALOG iceberg_catalog SET ("hive.metastore.uris" = "<thrift://new_host:9083>");
Important Notes 1. Supported Catalog Types: While support started with Hive and Hudi catalogs, it has been expanded to other external catalog types (like Iceberg and JDBC) in later versions. 2. Internal Catalog: You cannot use this command to modify the
default_catalog
(the internal StarRocks catalog). 3. Legacy Versions: If you are on a version earlier than v3.3.12 that does not support
ALTER CATALOG
, you must
DROP CATALOG
and
CREATE EXTERNAL CATALOG
again with the new properties. 4. Resource Alternative: For some older Iceberg/Hive setups that use "Resources," you may need to use
ALTER RESOURCE
instead. Referencessql-reference/sql-statements/Catalog/SET_CATALOG.mdsql-reference/sql-statements/Resource/ALTER_RESOURCE.mdsql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.mdsql-reference/sql-statements/Catalog/DROP_CATALOG.mdsql-reference/sql-statements/Catalog/CREATE_EXTERNAL_CATALOG.mdsql-reference/sql-statements/Database/ALTER_DATABASE.mddata_source/catalog/unified_catalog.md