Connect to BigQuery

Prerequisites

  • Analytics 2.0 SKU.

  • Access to Google Cloud Platform (GCP).

  • Required permissions on both Delta Share and BigQuery.

  • Download the zip file package from the Company level Analytics tool (via Analytics > Getting Started > Connection Options > BigQuery).

Steps

Set up configuration

Delta Share configuration

  1. Create a file named config.share with your Delta Share credentials in JSON format.

  2. Get required fields.
    Note: These details can be obtained from the Analytics web application.

    • bearerToken: Your Delta Share access token.

    • endpoint: Your Delta Share endpoint URL.

    • shareCredentialsVersion: Version number (currently 1).

Example config.share file

{
"shareCredentialsVersion": 1,
"bearerToken": "",
"endpoint": ""
}

BigQuery configuration

  1. Download the bigquery.zip file from the Analytics web application.
    Note: You can download the zip file package from the Company level Analytics tool (via Analytics > Getting Started > Connection Options > BigQuery).

  2. Extract the package to a Directory of your choice.

  3. Open the config.yaml file and modify the following parameters:

    • source_config.config_path: Path to Delta Share configuration file.

    • source_config.tables: Optional list of specific tables to process. Leave it empty to process all tables.

    • target_config.project_id: GCP project ID for BigQuery.

    • target_config.dataset: BigQuery dataset name.

    • target_config.threads: Number of concurrent table processes.

Example config.yaml file
source_config:
config_path: "<path_to_delta_share_config>"
tables: # Optional - list of specific tables to process
- "table1"
- "table2"

target_config:
project_id: "<your-gcp-project-id>"
dataset: "<bigquery-dataset-name>"
target_type: bigquery

Upload configuration file

  1. Upload both config.yaml and config.share files to the gs bucket.

    1. Google Cloud Storage (GCS)

      • Use format: gs://bucket-name/path/to/config.yaml.

Run the BigQuery application

  1. Create a Python notebook and install the following package:

    • %pip install delta-sharing

    • pip install pandas-gbq -U

  2. Copy the code from delta_share_to_bq.py, paste it into your notebook, update the configuration path (config.yaml) and run it.

Monitoring and logging

The application provides detailed logging with:

  • Processing status for each table.

  • Error messages and exceptions.

  • Concurrent processing of information.

Best Practices

  • Performance optimisation

    • Adjust thread count based on system resources.

    • Monitor memory usage with large tables.

    • Consider table sizes when setting concurrent processes.

  • Error management

    • Monitor application logs.

    • Set up appropriate alerting.

    • Maintain backup configurations.

Troubleshooting

Common issues and solutions:

  • Connection failures

    • Verify network connectivity.

    • Check credential validity.

    • Confirm service account permission.

  • Processing errors

    • Verify table existence.

    • Check table access permissions.

    • Validate configuration setting.

  • Performance issues

    • Reduce concurrent threads.

    • Monitor system resources.

Support

For additional help:

  • Review application logs for error details.

  • Verify configuration setting.

  • Ensure all prerequisites are met.

  • Contact your system administrator for permission-related issues.