Skip to main content
Skip to main content

BigQuery Catalog

BigQuery Catalog

BigQuery Catalog is compatible with the Trino Connector framework, using the BigQuery Connector to access BigQuery tables.

This feature is supported starting from Doris version 3.0.1.

Note

This is an experimental feature.

Instructions for Use​

  1. Before accessing BigQuery tables using the Trino Catalog, you must first compile the Trino BigQuery plugin and place it in the specified directory. Refer to the following steps for detailed instructions.
  2. The current Doris is compatible with the Trino 435 version plugin. If you use a Trino plugin lower or higher than version 435, compatibility issues may arise.

Compiling the BigQuery Connector Plugin​

JDK version 17 is required.

$ git clone https://github.com/apache/Doris-thirdparty.git
$ cd Doris-thirdparty
$ git checkout trino-435
$ cd plugin/trino-bigquery
$ mvn clean install -DskipTest

After compilation, you will find the trino-bigquery-435/ directory under trino/plugin/trino-bigquery/target/.

You can also directly download our precompiled trino-bigquery-435-20240724.tar.gz and extract it.

Deploying the BigQuery Connector​

Place the trino-bigquery-435/ directory in the connectors/ directory of all FE and BE deployment paths (create manually if not present).

β”œβ”€β”€ bin
β”œβ”€β”€ conf
β”œβ”€β”€ connectors
β”‚ β”œβ”€β”€ trino-bigquery-435
...

After deployment, it is recommended to restart the FE and BE nodes to ensure the Connector is correctly loaded.

Preparing Google Cloud ADC Authentication​

  1. Install gcloud CLI: https://cloud.google.com/sdk/docs/install
  2. Run gcloud init --console-only --skip-diagnostics
  3. Run gcloud auth login
  4. Run gcloud auth application-default login

This step generates the ADC authentication file, and the generated JSON file is by default placed in ~/.config/gcloud/application_default_credentials.json.

Create BigQuery Catalog​

create catalog bigquery_catalog properties (
"type"="trino-connector",
"trino.connector.name"="bigquery",
"trino.bigquery.project-id"="your-bigquery-project-id",
"trino.bigquery.credentials-file"="/path/to/application_default_credentials.json",
);

Where: Properties prefixed with trino. are native Trino properties. For more information about BigQuery properties, refer to the Trino documentation.

Column Type Mapping​

BigQueryTrinoDoris
BOOLEANBOOLEANBOOLEAN
INT64BIGINTBIGINT
FLOAT64DOUBLEDOUBLE
NUMERICDECIMAL(p,s)DECIMAL(p,s)
BIGNUMERICDECIMAL(P,S)DECIMAL(p,s)
STRINGVARCHARSTRING
BYTESVARBINARYSTRING
DATEDATEDATE
DATETIMETIMESTAMP(6)DATETIME
TIMETIME(6)STRING
TIMESTAMPTIMESTAMP(6) WITH TIME ZONEDATETIME
GEOGRAPHYVARCHARSTRING
ARRAYARRAYARRAY
MAPMAPMAP
RECORDROWSTRUCT