github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/inputs/gcp_bigquery_select.md (about)

     1  ---
     2  title: gcp_bigquery_select
     3  type: input
     4  status: experimental
     5  categories: ["Services","GCP"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/input/gcp_bigquery_select.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  :::caution EXPERIMENTAL
    19  This component is experimental and therefore subject to change or removal outside of major version releases.
    20  :::
    21  Executes a `SELECT` query against BigQuery and creates a message for each row received.
    22  
    23  Introduced in version 3.63.0.
    24  
    25  ```yaml
    26  # Config fields, showing default values
    27  input:
    28    label: ""
    29    gcp_bigquery_select:
    30      project: ""
    31      table: ""
    32      columns: []
    33      where: ""
    34      job_labels: {}
    35      args_mapping: ""
    36      prefix: ""
    37      suffix: ""
    38  ```
    39  
    40  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](/docs/components/inputs/sequence) to execute).
    41  
    42  ## Examples
    43  
    44  <Tabs defaultValue="Word counts" values={[
    45  { label: 'Word counts', value: 'Word counts', },
    46  ]}>
    47  
    48  <TabItem value="Word counts">
    49  
    50  
    51  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:
    52  
    53  ```yaml
    54  input:
    55    gcp_bigquery_select:
    56      project: sample-project
    57      table: bigquery-public-data.samples.shakespeare
    58      columns:
    59        - word
    60        - sum(word_count) as total_count
    61      where: length(word) >= ?
    62      suffix: |
    63        GROUP BY word
    64        ORDER BY total_count DESC
    65        LIMIT 10
    66      args_mapping: |
    67        root = [ 3 ]
    68  ```
    69  
    70  </TabItem>
    71  </Tabs>
    72  
    73  ## Fields
    74  
    75  ### `project`
    76  
    77  GCP project where the query job will execute.
    78  
    79  
    80  Type: `string`  
    81  
    82  ### `table`
    83  
    84  Fully-qualified BigQuery table name to query.
    85  
    86  
    87  Type: `string`  
    88  
    89  ```yaml
    90  # Examples
    91  
    92  table: bigquery-public-data.samples.shakespeare
    93  ```
    94  
    95  ### `columns`
    96  
    97  A list of columns to query.
    98  
    99  
   100  Type: `array`  
   101  
   102  ### `where`
   103  
   104  An optional where clause to add. Placeholder arguments are populated with the `args_mapping` field. Placeholders should always be question marks (`?`).
   105  
   106  
   107  Type: `string`  
   108  
   109  ```yaml
   110  # Examples
   111  
   112  where: type = ? and created_at > ?
   113  
   114  where: user_id = ?
   115  ```
   116  
   117  ### `job_labels`
   118  
   119  A list of labels to add to the query job.
   120  
   121  
   122  Type: `object`  
   123  Default: `{}`  
   124  
   125  ### `args_mapping`
   126  
   127  An optional [Bloblang mapping](/docs/guides/bloblang/about) which should evaluate to an array of values matching in size to the number of placeholder arguments in the field `where`.
   128  
   129  
   130  Type: `string`  
   131  
   132  ```yaml
   133  # Examples
   134  
   135  args_mapping: root = [ "article", now().format_timestamp("2006-01-02") ]
   136  ```
   137  
   138  ### `prefix`
   139  
   140  An optional prefix to prepend to the select query (before SELECT).
   141  
   142  
   143  Type: `string`  
   144  
   145  ### `suffix`
   146  
   147  An optional suffix to append to the select query.
   148  
   149  
   150  Type: `string`  
   151  
   152