> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Run the Bigtable Connector Externally

> Learn how to Configure OpenMetadata'sBigtable database connector using YAML. Complete setup guide with examples, parameters, and best practices.

![BigTable](https://docs.open-metadata.org/public/images/connectors/big-table.webp)

# BigTable

PROD

In this section, we provide guides and references to use the BigTable connector.
Configure and schedule BigTable metadata and profiler workflows from the OpenMetadata UI:

* [Requirements](#requirements)
* [Metadata Ingestion](#metadata-ingestion)

## How to Run the Connector Externally

To run the Ingestion via the UI you'll need to use the OpenMetadata Ingestion Container, which comes shipped with
custom Airflow plugins to handle the workflow deployment.

If, instead, you want to manage your workflows externally on your preferred orchestrator, you can check
the following docs to run the Ingestion Framework **anywhere**.

> [card] [External Schedulers](https://docs.open-metadata.org/v2.1.x/deployment/ingestion.md)
>
> Get more information about running the Ingestion Framework Externally

## Requirements

### Python Requirements

Use Python 3.10 or later. Python 3.12 is recommended, because it is what the OpenMetadata 2.0 ingestion images use. To confirm the supported range for your release, check the `Requires-Python` metadata of that release’s `openmetadata-ingestion` package.

To run the BigTable ingestion, you will need to install:

```bash theme={null}
pip3 install "openmetadata-ingestion[bigtable]"
```

### GCP Permissions

To execute metadata extraction and usage workflow successfully the user or the service account should have enough access to fetch required data. Following table describes the minimum required permissions

| # | GCP Permission | Required For |
| :- | :- | :- |
| 1 | bigtable.instances.get | Metadata Ingestion |
| 2 | bigtable.instances.list | Metadata Ingestion |
| 3 | bigtable.tables.get | Metadata Ingestion |
| 4 | bigtable.tables.list | Metadata Ingestion |
| 5 | bigtable.tables.readRows | Metadata Ingestion |

> [card] [Create Custom GCP Role](https://docs.open-metadata.org/v2.1.x/connectors/database/bigtable/roles.md)
>
> Checkout this documentation on how to create a custom role and assign it to the service account.

## Metadata Ingestion

### 1. Define the YAML Config

This is a sample config for BigTable:

#### Source Configuration

Configure the source type and service name for your BigTable connector.

#### Connection Type

**type**: Set to `BigTable` for BigTable connections.

#### Credentials

**credentials**: You can authenticate with your BigTable instance using GCP Credentials. You can either specify the file path of the service account key or pass the values directly by choosing the GCP Credentials Values from the service account key file.

You can checkout [this](https://cloud.google.com/iam/docs/keys-create-delete#iam-service-account-keys-create-console) documentation on how to create the service account keys and download it.

#### GCP Configuration

**gcpConfig:** Passing the raw credential values provided by GCP. This requires us to provide the service account credentials.

**1.** Passing the raw credential values provided by BigTable:

**gcpConfig:**

* **type**: Credentials Type is the type of the account, for a service account the value of this field is `service_account`. To fetch this key, look for the value associated with the `type` key in the service account key file.
* **projectId**: A project ID is a unique string used to differentiate your project from all others in Google Cloud. To fetch this key, look for the value associated with the `project_id` key in the service account key file. You can also pass multiple project id to ingest metadata from different BigQuery projects into one service.
* **privateKeyId**: This is a unique identifier for the private key associated with the service account. To fetch this key, look for the value associated with the `private_key_id` key in the service account file.
* **privateKey**: This is the private key associated with the service account that is used to authenticate and authorize access to BigQuery. To fetch this key, look for the value associated with the `private_key` key in the service account file.
* **clientEmail**: This is the email address associated with the service account. To fetch this key, look for the value associated with the `client_email` key in the service account key file.
* **clientId**: This is a unique identifier for the service account. To fetch this key, look for the value associated with the `client_id` key in the service account key  file.
* **authUri**: This is the URI for the authorization server. To fetch this key, look for the value associated with the `auth_uri` key in the service account key file. The default value to Auth URI is [https://accounts.google.com/o/oauth2/auth](https://accounts.google.com/o/oauth2/auth).
* **tokenUri**: The Google Cloud Token URI is a specific endpoint used to obtain an OAuth 2.0 access token from the Google Cloud IAM service. This token allows you to authenticate and access various Google Cloud resources and APIs that require authorization. To fetch this key, look for the value associated with the `token_uri` key in the service account credentials file. The default token URI is `https://oauth2.googleapis.com/token`.
* **authProviderX509CertUrl**: This is the URL of the certificate that verifies the authenticity of the authorization server. To fetch this key, look for the value associated with the `auth_provider_x509_cert_url` key in the service account key file. The Default value for Auth Provider X509Cert URL is [https://www.googleapis.com/oauth2/v1/certs](https://www.googleapis.com/oauth2/v1/certs)
* **clientX509CertUrl**: This is the URL of the certificate that verifies the authenticity of the service account. To fetch this key, look for the value associated with the `client_x509_cert_url` key in the service account key  file.

**2.** Passing a local file path that contains the credentials:

* **gcpCredentialsPath**: Path to the service account key file

#### Connection Options

**Connection Options (Optional)**: Enter the details for any additional connection options that can be sent to database during the connection. These details must be added as Key-Value pairs.

#### Connection Arguments

**Connection Arguments (Optional)**: Enter the details for any additional connection arguments such as security or protocol configs that can be sent to database during the connection. These details must be added as Key-Value pairs.

* In case you are using Single-Sign-On (SSO) for authentication, add the `authenticator` details in the Connection Arguments as a Key-Value pair as follows: `"authenticator" : "sso_login_url"`

#### Source Config

The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/databaseServiceMetadataPipeline.json):

* **markDeletedTables**: To flag tables as soft-deleted if they are not present anymore in the source system.
* **markDeletedStoredProcedures**: Optional configuration to soft delete stored procedures in OpenMetadata if the source stored procedures are deleted. Also, if the stored procedure is deleted, all the associated entities like lineage, etc., with that stored procedure will be deleted.
* **markDeletedSchemas**: Optional configuration to soft delete schemas stored in OpenMetadata if the source schema is deleted. Setting this flag to true will only keep filtered schemas and delete any other schemas that do not match schemaFilterPattern or do not exist at source.
* **markDeletedDatabases**: Additional optional configuration for soft deletion, providing a granular option to select which particular entities should be deleted.
* **includeTables**: Set to `true` or `false` to ingest table data. Default is `true`.
* **includeViews**: Set to `true` or `false` to ingest view definitions.
* **includeTags**: Optional configuration to toggle the tags ingestion.
* **includeOwners**: Set the **Include Owners** toggle to control whether to include owners to the ingested entity if the owner email matches with a user stored in the OM server as part of metadata ingestion. If the ingested entity already exists and has an owner, the owner will not be overwritten.
* **ownerConfig**: Advanced, hierarchical configuration for assigning owners to databases, schemas, and tables during ingestion, with per-entity mappings and inheritance. For more information, see [Hierarchical Owner Configuration](https://docs.open-metadata.org/connectors/ingestion/workflows/metadata/hierarchical-owner-configuration).
* **includeStoredProcedures**: Optional configuration to toggle the Stored Procedures ingestion.
* **includeDDL**: Optional configuration to toggle the DDL Statements ingestion.
* **overrideMetadata** *(boolean)*: Set the **Override Metadata** toggle to control whether to override the existing metadata in the OpenMetadata server with the metadata fetched from the source. If the toggle is set to true, the metadata fetched from the source will override the existing metadata in the OpenMetadata server. If the toggle is set to false, the metadata fetched from the source will not override the existing metadata in the OpenMetadata server. This is applicable for fields like description, tags, owner, and displayName.
* **queryLogDuration**: Configuration to tune how far we want to look back in query logs to process Stored Procedures results.
* **queryParsingTimeoutLimit**: Configuration to set the timeout for parsing the query in seconds.
* **useFqnForFiltering**: Regex will be applied on the fully qualified name (for example, `service_name.db_name.schema_name.table_name`) instead of the raw name (for example, `table_name`).
* **databaseFilterPattern**, **schemaFilterPattern**: Note that the filter supports regex as include or exclude. You can find examples [here](https://docs.open-metadata.org/connectors/ingestion/workflows/metadata/filter-patterns/database).
* **tableFilterPattern**: Note that the filter supports regex as include or exclude. You can find examples [here](https://docs.open-metadata.org/connectors/ingestion/workflows/metadata/filter-patterns/table).
* **threads (beta)**: The number of threads to use when extracting the metadata using multithreading.
* **databaseMetadataConfigType** *(string)*: Database Source Config Metadata Pipeline type.
* **incremental (beta)**: Incremental Extraction configuration. Currently implemented for [BigQuery](https://docs.open-metadata.org/connectors/ingestion/workflows/metadata/incremental-extraction/bigquery), [Redshift](https://docs.open-metadata.org/connectors/ingestion/workflows/metadata/incremental-extraction/redshift), and [Snowflake](https://docs.open-metadata.org/connectors/ingestion/workflows/metadata/incremental-extraction/snowflake).

bigtable\_config.yaml
Copy full code

```yaml theme={null}
source:
  type: bigtable
  serviceName: "<service name>"
  serviceConnection:
    config:
      type: BigTable
      credentials:
        gcpConfig:
```

```yaml theme={null}
          type: service_account
          projectId: project-id # ["project-id-1", "project-id-2"]
          privateKeyId: abc123
          privateKey: |
            -----BEGIN PRIVATE KEY-----
            Super secret key
            -----END PRIVATE KEY-----
          clientEmail: role@project.iam.gserviceaccount.com
          clientId: "1234"
          # authUri: https://accounts.google.com/o/oauth2/auth (default)
          # tokenUri: https://oauth2.googleapis.com/token (default)
          # authProviderX509CertUrl: https://www.googleapis.com/oauth2/v1/certs (default)
          clientX509CertUrl: https://www.googleapis.com/robot/v1/metadata/x509/role%40project.iam.gserviceaccount.com
```

```yaml theme={null}
      # connectionOptions:
      #   key: value
      # connectionArguments:
      #   key: value
```

```yaml theme={null}
  sourceConfig:
    config:
      type: DatabaseMetadata
      markDeletedTables: true
      markDeletedStoredProcedures: true
      markDeletedSchemas: true
      markDeletedDatabases: true
      includeTables: true
      includeViews: true
      # includeTags: true
      # includeOwners: false
      # ownerConfig:
      #   default: data-platform-team
      #   database:
      #     database1: owner1
      #   databaseSchema:
      #     database1.schema1: owner1
      #   table:
      #     database1.schema1.table1: owner1
      #   enableInheritance: true
      # includeStoredProcedures: true
      # includeDDL: true
      # overrideMetadata: false
      # queryLogDuration: 1
      # queryParsingTimeoutLimit: 300
      # useFqnForFiltering: false
      # threads: 1
      # databaseMetadataConfigType: ()
      # incremental:
      #   enabled: true
      #   lookbackDays: 7
      #   safetyMarginDays: 1
      # databaseFilterPattern:
      #   includes:
      #     - database1
      #     - database2
      #   excludes:
      #     - database3
      #     - database4
      # schemaFilterPattern:
      #   includes:
      #     - schema1
      #     - schema2
      #   excludes:
      #     - schema3
      #     - schema4
      # tableFilterPattern:
      #   includes:
      #     - users
      #     - type_test
      #   excludes:
      #     - table3
      #     - table4
```

```yaml theme={null}
sink:
  type: metadata-rest
  config: {}
```

```yaml theme={null}
workflowConfig:
  loggerLevel: INFO  # DEBUG, INFO, WARNING or ERROR
  openMetadataServerConfig:
    hostPort: "http://localhost:8585/api"
    authProvider: openmetadata
    securityConfig:
      jwtToken: "{bot_jwt_token}"
    ## Store the service Connection information
    storeServiceConnection: true  # false
    ## Secrets Manager Configuration
    # secretsManagerProvider: aws, azure or noop
    # secretsManagerLoader: airflow or env
    ## If SSL, fill the following
    # verifySSL: validate  # or ignore
    # sslConfig:
    #   caCertificate: /local/path/to/certificate
# ingestionPipelineFQN: <service name>.<ingestion name> ## e.g., "my_redshift.metadata"
```

### 2. Run with the CLI

First, we will need to save the YAML file. Afterward, and with all requirements installed, we can run:

```bash theme={null}
metadata ingest -c <path-to-yaml>
```

Note that from connector to connector, this recipe will always be the same. By updating the YAML configuration,
you will be able to extract metadata from different sources.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.