# Big Query Connector

**Overview**&#x20;

The Big Query connector in Graphite Note allows you to import your data from a BigQuery data warehouse.&#x20;

**Prerequisites**&#x20;

Before starting, ensure your firewall allows incoming requests from the following IP addresses:&#x20;

* 99.81.63.220&#x20;

**Steps to Import Data**&#x20;

**1. Create a New Dataset**&#x20;

* Option 1: Go to the homepage and click on "Create" under Datasets.&#x20;
* Option 2: From the datasets list, click on "New Dataset."&#x20;

&#x20;

<figure><img src="https://3727300098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgnR78y9L7FDWeb4jdvdW%2Fuploads%2F1S1emwzPFbrOi5WdiVaT%2FScreenshot%202024-07-23%20104135.png?alt=media&#x26;token=6a8fdffb-4ad3-44ba-bae3-08ee8a906b25" alt=""><figcaption><p>Option 1: Create Dataset using homepage</p></figcaption></figure>

<figure><img src="https://3727300098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgnR78y9L7FDWeb4jdvdW%2Fuploads%2FrGNt9WQiRNGu8bC6wDyT%2FScreenshot%202024-07-23%20095530.png?alt=media&#x26;token=feec1124-7be1-4270-bca7-a049636ee487" alt=""><figcaption><p>Option 2: Create Dataset from the Dataset List page</p></figcaption></figure>

**2. Select Big Query**

* Choose "Big Query" as your dataset source and click "Next".&#x20;

<figure><img src="https://3727300098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgnR78y9L7FDWeb4jdvdW%2Fuploads%2FLjBloFSNT4cfeXg9OKtM%2FScreenshot%202024-07-29%20125237.png?alt=media&#x26;token=14692cea-6b54-4a3d-9fb2-612054a99337" alt=""><figcaption></figcaption></figure>

**3. Enter Dataset Information**&#x20;

* Name: Provide a name for the dataset.&#x20;
* Description: Add a short description of the data.&#x20;
* Tags: Add tags for better organization.&#x20;
* Click "Next" to proceed.

<figure><img src="https://3727300098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgnR78y9L7FDWeb4jdvdW%2Fuploads%2FLwNaZpchFK1PM2NavcnL%2FScreenshot%202024-07-23%20095900.png?alt=media&#x26;token=2f022290-aafa-4651-833c-ae0cdef9adc8" alt=""><figcaption></figcaption></figure>

#### 4. **Configure Big Query Connection**

* **Project ID**: Enter your Google Cloud project ID.
* **Dataset ID**: Enter the Big Query dataset ID.
* **Table ID**: Enter the table ID if you want to import data from a specific table.

<figure><img src="https://3727300098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgnR78y9L7FDWeb4jdvdW%2Fuploads%2FLc2PNzfNUiXFVdlFDs2C%2FScreenshot%202024-07-29%20152929.png?alt=media&#x26;token=00dc1266-926c-4a1b-aa16-d3b69bf71c17" alt=""><figcaption></figcaption></figure>

#### 5. Download JSON Key from BigQuery

To enable Graphite Note to access your BigQuery data, you'll need to provide a service account key in JSON format:

1. **Create a Service Account:**
   * Navigate to the Google Cloud Console.
   * Select your project or create a new one.
   * Go to **IAM & Admin** > **Service Accounts**.
   * Click on **+ CREATE SERVICE ACCOUNT**.
   * Provide a name and description for the service account, then click **CREATE**.
2. **Grant Permissions:**
   * Assign the necessary roles, such as **BigQuery Data Viewer** and **BigQuery Job User**. These roles allow the service account to view datasets and execute queries.
3. **Create Key:**
   * In the service account list, click on the created service account.
   * Go to the **Keys** tab and click **ADD KEY** > **Create new key**.
   * Select **JSON** as the key type and click **Create**. This will download the JSON key file to your computer.

#### 6. Upload JSON Key to Graphite Note

1. **Access the Dataset Creation Page:**
   * Return to the Graphite Note platform where you left off at the "Create a New Dataset" step.
2. **Upload JSON Key:**
   * You will be prompted to upload the JSON key file. Click on **Upload JSON Key** and select the file you downloaded from the Google Cloud Console.
3. **Check Connection:**
   * After uploading the JSON key, click **Check Connection** to ensure that Graphite Note can successfully connect to your BigQuery instance.&#x20;

#### 7. Review data

Review the data and make any necessary adjustments:

* **Rename Columns:** Change column names if needed.
* **Change Data Types:** Adjust the data types of your columns as required.
* Click on the "Create" button to finalize and create your dataset.

#### Next Steps

Now that your data is imported and prepared, you can proceed to create a model without writing any code. Simply go to the [Models](https://app.gitbook.com/o/tMDHUVlAYCj1y8ercRu6/s/gnR78y9L7FDWeb4jdvdW/models/introduction) and follow the steps to build and deploy your model using Graphite Note's intuitive interface.&#x20;
