# gcp_bigquery_select

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: gcp_bigquery_select
latest-connect-version: 4.117.0
latest-operator-version: v26.2.6
latest-console-tag: v3.14.0
latest-redpanda-tag: v26.2.6
docname: inputs/gcp_bigquery_select
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: inputs/gcp_bigquery_select.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/inputs/gcp_bigquery_select.adoc
description: Executes a SELECT query against BigQuery and creates a message for each row received.
page-git-created-date: "2024-05-24"
page-git-modified-date: "2026-10-29"
page-generated-sources:
  - include: connect:components:partial$descriptions/inputs/gcp_bigquery_select.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$availability/inputs/gcp_bigquery_select.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$examples/inputs/gcp_bigquery_select.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$fields/inputs/gcp_bigquery_select.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
page-generated-content: partial
---

<!-- Source: https://docs.redpanda.com/connect/components/inputs/gcp_bigquery_select.md -->

Executes a `SELECT` query against BigQuery and creates a message for each row received.

Introduced in version 3.63.0.

Once the rows from the query are exhausted, this input shuts down, allowing the pipeline to gracefully terminate (or the next input in a [sequence](https://docs.redpanda.com/connect/components/inputs/sequence/) to execute).

```yml
input:
  label: ""
  gcp_bigquery_select:
    project: "" # No default (required)
    credentials_json: ""
    table: "" # No default (required)
    columns: [] # No default (required)
    where: "" # No default (optional)
    auto_replay_nacks: true
    job_labels: {}
    priority: ""
    args_mapping: "" # No default (optional)
    prefix: "" # No default (optional)
    suffix: "" # No default (optional)
```

## [](#examples)Examples

### [](#word-counts)Word counts

Here we query the public corpus of Shakespeare’s works to generate a stream of the top 10 words that are 3 or more characters long:

```yaml
input:
  gcp_bigquery_select:
    project: sample-project
    table: bigquery-public-data.samples.shakespeare
    columns:
      - word
      - sum(word_count) as total_count
    where: length(word) >= ?
    suffix: |
      GROUP BY word
      ORDER BY total_count DESC
      LIMIT 10
    args_mapping: |
      root = [ 3 ]
```

## [](#fields)Fields

### [](#args_mapping)`args_mapping`

An optional [Bloblang mapping](https://docs.redpanda.com/connect/guides/bloblang/about/) that evaluates to an array of values for the `?` placeholders in the `where` field, in order. Each value is sent to BigQuery as a positional query parameter.

**Type**: `string`

```yaml
# Examples:
args_mapping: root = [ "article", now().ts_format("2006-01-02") ]
```

### [](#auto_replay_nacks)`auto_replay_nacks`

Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure.

Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation.

Requires version 4.27.0 or later.

**Type**: `bool`

**Default**: `true`

### [](#columns)`columns[]`

A list of columns to query.

**Type**: `array<string>`

### [](#credentials_json)`credentials_json`

The Google Service Account credentials in JSON format (optional). Provide the contents of the credentials file as plain JSON, not Base64-encoded. Use this field to authenticate with Google Cloud services. If this field is empty, the component uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). For more information about creating service account credentials, see [Google’s service account documentation](https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account).

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

Requires version 4.33.0 or later.

**Type**: `string`

**Default**: `""`

### [](#job_labels)`job_labels`

A map of labels to add to the query job.

**Type**: `object<string>`

**Default**: `{}`

### [](#prefix)`prefix`

Optional GoogleSQL text to add before the `SELECT` keyword of the generated query, for example a `WITH` clause.

**Type**: `string`

### [](#priority)`priority`

The priority with which to schedule the query.

Requires version 4.7.0 or later.

**Type**: `string`

**Default**: `""`

### [](#project)`project`

The GCP project where the query job runs.

**Type**: `string`

### [](#suffix)`suffix`

Optional GoogleSQL text to append after the generated query, for example `GROUP BY`, `ORDER BY`, or `LIMIT` clauses.

**Type**: `string`

### [](#table)`table`

The fully-qualified name of the BigQuery table to query.

**Type**: `string`

```yaml
# Examples:
table: bigquery-public-data.samples.shakespeare
```

### [](#where)`where`

An optional `WHERE` clause to add to the query. The `args_mapping` field populates the placeholder arguments. Placeholders must always be question marks (`?`).

**Type**: `string`

```yaml
# Examples:
where: type = ? and created_at > ?

# ---

where: user_id = ?
```