Version 1.3.0 or Newer

Alation Cloud Service Applies to Alation Cloud Service instances of Alation

Customer Managed Applies to customer-managed instances of Alation

Important

This section is applicable for Alation Version 2023.3.4 or higher and Google BigQuery OCF connector version 1.3.0 or higher.

Query log ingestion (QLI) extracts and ingests the query history of a database and powers the lineage, popularity, top user, and join and filter information in the catalog. Explore examples of ingested queries on schema and table catalog pages.

The steps involved in configuring and running QLI are:

You can configure query log ingestion on the Query Log Ingestion tab of the Settings page. You can choose to configure QLI in one of the following ways:

  • View-Based

  • Custom Query-Based

Test the Access and Find the Query History Size

Before you perform the QLI, you must validate that the service account has access to the QLI view and gauge the approximate size of the query history metadata. The size is estimated based on the average query volume of the last seven days. For information on the permissions required, see Grant Permissions for Access Check in Prerequisites.

To test the access and find out the approximate size of the query history metadata, perform these steps:

  1. On the Settings page of your Google BigQuery data source, go to the Query Log Ingestion tab.

  2. Under the Test access and query history size section, click Test.

    A dialog box appears displaying the access validation result and upon successful validation, the size of the query history is displayed. The size is estimated based on the query volume of the last 7 days.

    Note

    If the average query size for the last seven days exceeds 500k, a warning message indicates the same. In such cases, Alation recommends that you schedule the QLI jobs to run daily.

Preview Results

Before performing the QLI, you can preview the queries that are ingested.

  1. On the Settings page of your Google BigQuery data source, click go to the Query Log Ingestion tab.

  2. Under the Preview Results section, enter the date range for which you want to generate the preview of the query history.

  3. Click Preview.

  4. Click View Results to view the generated preview.

    The Preview dialog appears displaying the total number of query statements per user under the User Queries tab and a detailed query statement under the Statements tab. Click Download to download the detailed query statement as a JSON file.

Run QLI

You can either run QLI manually on demand or configure it to run automatically on a schedule.

Run QLI Manually

To perform QLI manually on demand:

  1. On the Settings page of your Google BigQuery data source, go to the Query Log Ingestion tab.

  2. Under the Run QLI section, disable the Enable QLI Schedule toggle.

  3. Specify the desired date range using the Date Range calendar widgets. You will need to specify the start date and the end date separately.

  4. Click Import.

    A query log ingestion job is initiated.

Schedule QLI

  1. On the Settings page of your Google BigQuery data source, go to the Query Log Ingestion tab.

  2. Under the Run QLI section, enable the Enable QLI Schedule toggle.

  3. Specify values for the job recurrence and time. The values are set in your local time.

    ../../../../_images/Snowflake_OCF_New_ScheduleQLI.png

Note

Here are some of the recommended schedules:

  • Schedule QLI to run for every 12 hours at the 30th minute of the hour

  • Schedule QLI to run for every 2 days at 11:30 PM

  • Schedule QLI to run every week on the Sunday and Wednesday of the week

  • Schedule QLI to run for every 3 months on the 15th day of the month

  1. Click Import.

The next QLI runs on the set schedule.

View the Job Status

To view the QLI job status after you run the QLI manually or after Alation triggers the QLI as per the schedule, go to Query Log Ingestion > QLI Job Status.

../../../../_images/Snowflakes_OCF_New_QLIJobHistory.png

The Query log ingestion job status table logs the following status:

  • Succeeded - Indicates that the query ingestion was successful.

  • Partial Success - Indicates that the query ingestion was successful with warnings. If Alation fails to ingest some of the objects during the QLI, it skips them and proceeds with the query ingestion, resulting in partial success. Similarly, if all the queries are ingested by a single user, QLI results in a partial success.

  • Failed - Indicates that the query ingestion failed with errors.

Click the View Details link to view a detailed report of query ingestion. Click the View Details link to view a detailed report of metadata extraction. If there are errors, the Job errors table displays the error category, error message, and a hint (ways to resolve the issue). Follow the instructions under the Hints column to resolve the error.