Querying from StarRocks
StarRocks allows you to query table formats like Hudi, Delta and Iceberg tables using our external catalog feature. Users do not need additional configurations to work with Apache XTable™ (Incubating) synced tables.
For more information and required configurations refer to:
For hands on experimentation, please follow Creating your first interoperable table to create Apache XTable™ (Incubating) synced tables followed by Hive Metastore to register the target table in Hive Metastore. Once done, please follow the below high level steps:
- Start the StarRocks server
- From the directory where you have installed mysql-cli: login by running
mysql -P 9030 -h 127.0.0.1 -u root --prompt="StarRocks > "
.
- targetFormat: HUDI
- targetFormat: DELTA
- targetFormat: ICEBERG
If you are following the example from Hive Metastore, you can query the Apache XTable™ (Incubating) synced Hudi table from StarRocks using the below query.
CREATE EXTERNAL CATALOG unified_catalog_hms PROPERTIES ("type" = "unified","unified.metastore.type" = "hive", "hive.metastore.uris" = "thrift://hivemetastore:9083" );
SELECT * FROM unified_catalog_hms.hudi_db.<table_name>;
If you are following the example from Hive Metastore, you can query the Apache XTable™ (Incubating) synced Delta table from StarRocks using the below query.
CREATE EXTERNAL CATALOG unified_catalog_hms PROPERTIES ("type" = "unified","unified.metastore.type" = "hive", "hive.metastore.uris" = "thrift://hivemetastore:9083" );
SELECT * FROM unified_catalog_hms.delta_db.<table_name>;
If you are following the example from Hive Metastore, you can query the Apache XTable™ (Incubating) synced Iceberg table from StarRocks using the below query.
CREATE EXTERNAL CATALOG unified_catalog_hms PROPERTIES ("type" = "unified","unified.metastore.type" = "hive", "hive.metastore.uris" = "thrift://hivemetastore:9083" );
SELECT * FROM unified_catalog_hms.iceberg_db.<table_name>;