import Tabs from ‘@theme/Tabs’; import TabItem from ‘@theme/TabItem’;
This document walks through the steps to register a OneTable synced Iceberg table in BigLake Metastore on GCP.
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account_key.json
utilities-0.1.0-SNAPSHOT-bundled.jar by following the steps on the Installation page:::danger Important: Currently BigLake Metastore is only accessible through Google's BigLake Rest APIs, and as such OneTable requires you to setup the below items prior to running sync on your source dataset.
Use the Try this method on Google's REST reference docs for projects.locations.catalogs.create method to create a catalog.
In this tutorial we'll use us-west1 region.
projects/<yourProjectName>/locations/us-west1/catalogs
onetable
Use the Try this method on Google's REST reference docs for projects.locations.catalogs.databases.create method to create a database.
projects/<yourProjectName>/locations/us-west1/catalogs/onetable/databases
onetable_synced_db
<Tabs groupId=“table-format” defaultValue=“hudi” values={[ { label: ‘sourceFormat: HUDI’, value: ‘hudi’, }, { label: ‘sourceFormat: DELTA’, value: ‘delta’, }, ]}
sourceFormat: HUDI targetFormats: - ICEBERG datasets: - tableBasePath: gs://path/to/source/data tableName: table_name namespace: database_name
sourceFormat: DELTA targetFormats: - ICEBERG datasets: - tableBasePath: gs://path/to/source/data tableName: table_name namespace: onetable_synced_db
The catalog information can be specified in a yaml file and passed in with the --icebergCatalogConfig option. An example catalog.yaml file to sync with BigLake Metastore:
catalogImpl: org.apache.iceberg.gcp.biglake.BigLakeCatalog catalogName: onetable catalogOptions: gcp_project: <yourProjectName> gcp_location: us-west1 warehouse: gs://path/to/warehouse
From your terminal under the cloned OneTable directory, run the sync process using the below command.
java -cp utilities/target/utilities-0.1.0-SNAPSHOT-bundled.jar:/path/to/downloaded/biglake-catalog-iceberg1.2.0-0.1.0-with-dependencies.jar io.onetable.utilities.RunSync --datasetConfig my_config.yaml --icebergCatalogConfig catalog.yaml
:::tip Note: At this point, if you check your bucket path, you will be able to see the metadata directory with metadata files which contains the information that helps query engines to interpret the data as an Iceberg table. :::
Once the sync succeeds, OneTable would have written the table directly to BigLake Metastore. We can use Try this method option on Google's REST reference docs for projects.locations.catalogs.databases.tables.get method to view the created table.
projects/<yourProjectName>/locations/us-west1/catalogs/onetable/databases/onetable_synced_db/tables/table_name
In this guide we saw how to,
projects.locations.catalogs.databases.tables.get method