Intégration au metastore Hive externe Data Catalog
Data Catalog fournit un metastore hautement disponible et évolutif pour les implémentations Hive.
Prérequis
Vous devez déjà disposer des éléments suivants :
- Un cluster Big Data Service avec la version 3.0.3 ou supérieure. La dernière version de Big Data Service est affichée dans l'onglet Informations sur le cluster de la page des détails du Cluster.
- Un metastore Data Catalog et l'OCID extrait du metastore.
- Le connecteur OCI HDFS configuré pour Object Storage.
- Une clé d'API générée et la clé privée téléchargée.
- La clé privée copiée sur tous les noeuds du cluster Big Data Service.
Validation du cluster
Vous pouvez vous connecter au cluster Big Data Service et tester Spark à l'aide de structures client spark-shell, spark-sql, spark-submit ou spark-beeline pour exécuter des travaux Spark. Utilisez les exemples suivants pour valider le cluster.
Exemples pour une table gérée
CREATE DATABASE IF NOT EXISTS managed_db LOCATION 'oci://<bucket-name>@<tenancy-name-of-bucket>/<path/to/managed/table/directory>'
DESCRIBE DATABASE EXTENDED managed_db
USE managed_db
create table IF NOT EXISTS myINTtable_metastorecert (id int, name string) partitioned by (part int, part2 int)
insert into myINTtable_metastorecert partition(part=1, part2=1) values (3, "SK")
show partitions myINTtable_metastorecert
msck repair table myINTtable_metastorecert
show tables
show databases
Exemples pour une table externe
CREATE DATABASE IF NOT EXISTS external_db LOCATION 'oci://<bucket-name>@<tenancy-name-of-bucket>/<path/to/external/table/directory>'
DESCRIBE DATABASE EXTENDED external_db
USE external_db
CREATE EXTERNAL TABLE external_test(a string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'location 'oci://<bucket-name>@<tenancy-name-of-bucket>/<path/to/external/table/directory>'
select * from external_test
select count(*) from external_test