You can import the following file formats into
Dataproc Metastore:
A set of Avro files stored in a folder.
A single MySQL dump file stored in a Cloud Storage folder.
The MySQL or Avro files you're importing must be generated from a relational
database.
If your files are in a different format, such as PostgreSQL, you must convert
them to the Avro or MySQL format. After the conversion, you can import them into
Dataproc Metastore.
Avro
Avro based imports are only supported for Hive versions 2.3.6 and 3.1.2. When
importing Avro files, Dataproc Metastore expects a series of
<table-name>.avro files for each table in your database.
To import Avro files, your Dataproc Metastore service can use
the MySQL or Spanner database type.
MySQL
MySQL based imports are supported for all Hive versions. When importing MySQL
files, Dataproc Metastore expects a single SQL file containing
all of your table information.
MySQL dumps obtained from a Managed Service for Apache Spark cluster using Native SQL are
also supported.
To import MySQL files, your Dataproc Metastore service must use
the MySQL database type. The Spanner database type doesn't support MySQL
imports.
Import considerations
Importing overwrites all existing metadata stored in a
Dataproc Metastore service.
The metadata import feature only imports metadata. Data that's created by
Apache Hive in internal tables isn't replicated in the import.
Importing doesn't transform database content and doesn't handle file
migration. If you move your data to a different location, you must manually
update your table data locations and schema in your
Dataproc Metastore service.
Importing doesn't restore or replace fine-grained IAM
policies.
If you're using VPC Service Controls, then
you can only import data from a Cloud Storage bucket that resides in the
same service perimeter as the Dataproc Metastore service.
These predefined roles contain
the permissions required to import metadata into Dataproc Metastore. To see the exact permissions that are
required, expand the Required permissions section:
Required permissions
The following permissions are required to import metadata into Dataproc Metastore:
To import metadata:
metastore.imports.create
on the metastore service.
For MySQL, to use the Cloud Storage object (SQL dump file) for import, grant your user account and the Dataproc Metastore service agent:
storage.objects.get
on the Cloud Storage bucket containing the metadata dump being imported.
For Avro, to use the Cloud Storage bucket for import, grant your user account and the Dataproc Metastore service agent:
storage.objects.get
on the Cloud Storage bucket containing the metadata dump being imported.
The import operation is a two-step process. First, you prepare your import files
and then you import them into Dataproc Metastore.
When you start an import, Dataproc Metastore performs a Hive
metadata schema validation. This validation verifies the tables in the SQL dump
file and the filenames for Avro. If a table is missing, the import fails with an
error message describing the missing table.
Before you can import your files into Dataproc Metastore, you
must copy your metadata dump files into Cloud Storage, such as your
artifacts Cloud Storage
bucket.
Move your files to Cloud Storage
Create a database dump of the external database that you want to import into
Dataproc Metastore.
For instructions on creating a database dump, see the following pages:
While an import is running, you can't update a Dataproc Metastore
service — for example changing configuration settings. However, you can
still use it for normal operations, such as using it to access its metadata from
attached Managed Service for Apache Spark or self-managed clusters.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026年08月26日 UTC."],[],[]]