Data Connection to Google BigQuery

  • Last update:  2024-08-02
  • Overview

    Version

    FineBI Version
    JAR Package Version

    6.0

    /

    Application Scenario

    When the volume of data in Google BigQuery to be connected to FineBI is tens of millions, performance problems may occur if you directly invoke BigQuery APIs through server datasets. This document will introduce how to connect Google BigQuery to FineBI through JDBC drivers (namely, CData drivers or Simba drivers).

    CData Driver

    Driver Preparation

    Driver Download

    Driver Installation
    Download Address

    Choose the appropriate installation package for different system environments such as Windows/Cross-Platform Unix/Linux/Mac and download it.

    https://www.cdata.com/drivers/bigquery/jdbc/

     

    Driver Installation

    1. Install the driver by decompressing the downloaded package.

    The following figure shows the directory structure after installation.

    Google BigQuery 資料連結 图1.png


    iconNote:
    The CData driver can be trialed for free within one month and will be chargeable for further use. This section uses the trial version for testing.


    iconNote:
    The readme.htm file contains instructions for using the driver, which can be used for reference.

    2. Choose System Management > Data Connection > Data Connection Management and click Driver Management to create a driver named cdata.jdbc.googlebigquery.GoogleBigQueryDriver.

    Google BigQuery 資料連結 图2.png

    Google BigQuery 資料連結 图3.png

    3. Click Upload File and select the JAR package in \CData JDBC Driver for Google BigQuery 2023\lib. After the package is uploaded successfully, select cdata.jdbc.googlebigquery.jar.GoogleBigQueryDriver from the Driver drop-down list.

    Connection Information Collection

    1. In the driver lib directory, open the command prompt, and run the java -jar cdata.jdbc.googlebigquery.jar command to open the connection test window provided by CData.

    2. Set required parameters, as shown in the following table.

    Configuration ItemValue

    AuthScheme

    OAuth

    ProjectId

    Corresponding project ID

    InitiateOAuth

    GETANDREFRESH

    3. Click Test Connection to test the connection. In this case, the user OAuth authorization process webpage will automatically pop up. The connection can be successful only after you agree to the authorization to store account information. For details, see https://cdn.cdata.com/help/DBG/jdbc/pg_oauthembeddedapp.htm.

    iconNote:
    The identity authentication method includes user account authentication and service account authentication. User account authentication is used in this test.

    4. After the connection test is successful, copy the connection information in Connection String (required for later FineBI connection) in the lower part of the page, for example, jdbc:cdata:googlebigquery:InitiateOAuth = GETANDREFRESH;ProjectId = NameOfProject;DatasetId = NameOfDataset.

    Simba Driver

    Driver Preparation

    Driver Download

    Driver Installation
    Download Address

    Choose the appropriate installation package for different system environments such as Windows/Cross-Platform Unix/Linux/Mac and download it.

    ODBC and JDBC drivers for BigQuery | Google Cloud

    Driver Installation

    1. Decompress the downloaded driver package.

    2. Choose System Management > Data Connection > Data Connection Management and click Driver Management to create a driver named SimbaJDBCDriverforGoogleBigQuery.

    3. Click Upload File and select all files except slf4j-api-1.7.36.jar in the folder obtained after decompression. After the files are uploaded successfully, select com.simba.googlebigquery.jdbc.Driver from the Driver drop-down list.

    Connection Information Collection

    Obtain the connection URL by referring to Installation and Configuration Guide.

    Using a Google User Account

    Using a Google Service Account

    1. Obtaining the Project ID (as the Value of ProjectId)

    Create a service account by referring to Google official document.

    iconNote:
    Skip this step if you already have a service account.

    (1) Access the Service accounts page and create a project, as shown in the following figure.

    Google BigQuery 資料連結 图1.png

    (2) Enter required information according to the actual situation and click CREATE to obtain the corresponding project ID (as the value of ProjectId) from this page.

    Google BigQuery 資料連結 图2.png

    2. Obtaining the Email Address (as the Value of OAuthServiceAcctEmail)

    Create a service account by entering required information step by step, and obtain the corresponding email address (as the value of OAuthServiceAcctEmail) from this page, as shown in the following figure.

    Google BigQuery 資料連結 图3.png

    3. Obtaining the Key File (as the Value of ServiceKeyFile)

    Click the email address of the created service account and choose KEYS > ADD KEY > Create new key, as shown in the following figure.

    Google BigQuery 資料連結 图4.png

    Select the required key type and click CREATE. The key file will be automatically downloaded to the local computer, as shown in the following figure.

    Google BigQuery 資料連結 图5.png

    Specific Connection Procedure

    1. Log in to FineBI as the admin, choose System Management > Data Connection > Data Connection Management, and click New Data Connection.

    2. Choose Others > Other JDBC.

    iconNote:
    If you (not the admin) want to configure data connection, you need to be assigned the using permission of Data Connection in System Management by the admin. For details, see Data Connection Permission.

    Google BigQuery 資料連結 图10.png

    CData Method

    1. Select Custom from the Driver drop-down list, select your own driver, and enter the connection information obtained in "Connection Information Collection" of section "CData Driver."

    Google BigQuery 資料連結 图11.png

    The following table describes CData configuration items.

    Configuration Item
    ValueRemark

    Driver

    cdata.jdbc.googlebigquery.GoogleBigQueryDriver

    Enter the driver added in section "Driver Installation" here. You can manually enter it.

    Data Connection URL

    Connection information in Connection String copied in "Connection Information Collection" of section "CData Driver"

    Example: jdbc:cdata:googlebigquery:InitiateOAuth   = GETANDREFRESH;ProjectId = NameOfProject;DatasetId = NameOfDataset

    Username/Password

    Account and password of the actual database

    /

    Test Before Connection

    No

    You need to manually change the value from Yes (default value) to No.

    4. Click Test Connection. If the connection is successful, click Save.

    iconNote:
    The CData function is highly stable. Identity authentication is completed during the driver JAR package processing. You only need to configure the data connection in FineBI.

    Simba Method

    Using a Google User Account

    1. Select Custom from the Driver drop-down list, select your own driver, and enter the connection information obtained in "Using a Google User Account" of section "Connection Information Collection."

    Google BigQuery 資料連結 图12.png

    The following table describes Simba configuration items.

    Configuration Item
    ValueRemark

    Driver

    com.simba.googlebigquery.jdbc.Driver

    Select the driver added in section "Driver Installation" here. You can manually enter the driver.

    Data Connection URL

    Connection information obtained in "Using a Google User Account" of section "Connection Information Collection"

    Example: jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=civil-sentry-309307;OAuthType=1

    Username/Password

    Account and password of the actual database

    /

    Test Before Connection

    No

    You need to manually change the value from Yes (default value) to No.

    2. Click Test Connection. You will be automatically directed to the Google account login page. After login, click Allow.

    3. Return to the data connection page. If the connection is successful, click Save.

    Using a Google Service Account

    1. Select Custom from the Driver drop-down list, select your own driver, and enter the connection information obtained in

    "Using a Google Service Account" of section "Connection Information Collection."

    Google BigQuery 資料連結 图6.png

    The following table describes Simba configuration items.

    Configuration ItemValueRemark

    Driver

    com.simba.googlebigquery.jdbc.Driver

    Select the driver added in section "Driver Installation" here. You can manually enter the driver.

    Data Connection URL

    Connection information obtained in "Using a Google Service Account" of section "Connection Information Collection"

    Example:

    jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=doc-project-431101;OAuthType=0;OAuthServiceAcctEmail=doc-simba@doc-project-431101.iam.gserviceaccount.com;OAuthPvtKeyPath=C:/Users/Lauren/Downloads/doc-project-431101-fbc864ef47a2.json;

    Test Before Connection

    No

    You need to manually change the value from Yes (default value) to No.

    2. Click Test Connection. If the connection is successful, click Save.

    Adding Tables in Databases to FineBI

    For details, see Dataset.

    iconNote:
    Only extracted data is supported. Confirm the attribute of the base table before adding datasets.


    Google BigQuery 資料連結 图16.png

     



    Attachment List


    Theme: Data Center
    前の記事
    次の記事
    • いいね
    • 良くない
    • 閲覧しただけ

    フィードバック

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    9s后关闭

    反馈已提交

    网络繁忙