Google Cloud Storage#
Object storage connectors can access
Google Cloud Storage data using the
gs:// URI prefix.
To use Google Cloud Storage with non-anonymous access objects, you need:
The key for the service account in JSON format
The use of Google Cloud Storage as a storage location for an object storage catalog requires setting a configuration property that defines the authentication method for any non-anonymous access object. Access methods cannot be combined.
The default root path used by the
gs:\\ prefix is set in the catalog by the
contents of the specified key file, or the key file used to create the OAuth
JSON key file used to authenticate your Google Cloud service account with Google Cloud Storage.
Use client-provided OAuth token to access Google Cloud Storage.
The following uses the Delta Lake connector in an example of a minimal configuration file for an object storage catalog using a JSON key file:
Create a schema to use if one does not already exist, as in the following example:
CREATE SCHEMA storage_catalog.sales_data_in_gcs WITH (location = 'gs://example_location');
Once you have created a schema, you can create tables in the schema, as in the following example:
CREATE TABLE storage_catalog.sales_data_in_gcs.orders (
This statement creates the folder
gs://sales_data_in_gcs/orders in the root
folder defined in the JSON key file.
Your table is now ready to populate with data using
Alternatively, you can use
CREATE TABLE AS statements to create and
populate the table in a single statement.