ByteChef LogoByteChef

Google BigQuery

Google BigQuery is the autonomous data to AI platform, automating the entire data life cycle, from ingestion to AI-driven insights, so you can go from data to AI to action faster.

Categories: Artificial Intelligence

Type: googleBigQuery/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Connection Setup

Create OAuth 2.0 Application

Creation of OAuth 2.0 application is documented here.

Enable BigQuery API

  1. In the Google Cloud Console, select your project.
  2. Click on APIs & Services.
  3. Enter bigquery into search bar and press enter.
  4. Click on BigQuery API.
  5. Click on Enable.

Actions

Query

Name: query

Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.

Properties

NameLabelTypeDescriptionRequired
projectIdProject IDSTRINGProject ID of the query request.true
queryQuerySTRINGRequired. A query string to execute, using Google Standard SQL or legacy SQL syntax. Example: "SELECT COUNT(f1) FROM myProjectId.myDatasetId.myTableId".true
maxResultsMax ResultsINTEGERThe maximum number of rows of data to return per page of results.false
timeoutMsTimeoutINTEGERSpecifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. By default, this limit is 10 seconds (10,000 milliseconds).false
dryRunDry RunBOOLEAN
Options true, false
If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed.false
createSessionCreate SessionBOOLEAN
Options true, false
If true, creates a new session using a randomly generated sessionId. If false, runs query with an existing sessionId passed in ConnectionProperty.false

Example JSON Structure

{
  "label" : "Query",
  "name" : "query",
  "parameters" : {
    "projectId" : "",
    "query" : "",
    "maxResults" : 1,
    "timeoutMs" : 1,
    "dryRun" : false,
    "createSession" : false
  },
  "type" : "googleBigQuery/v1/query"
}

Output

Type: OBJECT

Properties

NameTypeDescription
kindSTRINGThe resource type.
schemaOBJECT
Properties {[{STRING(name), STRING(type), STRING(mode), [](fields), STRING(description), {[STRING](names)}(policyTags), {STRING(name)}(dataPolicies), STRING(maxLength), STRING(precision), STRING(scale), STRING(roundingMode), STRING(collation), STRING(defaultValueExpression), {STRING(type)}(rangeElementType)}](fields)}
The schema of the results. Present only when the query completes successfully.
objectReferenceOBJECT
Properties {STRING(projectId), STRING(jobId), STRING(location)}
Reference to the Job that was created to run the query.
jobCreationReasonOBJECT
Properties {STRING(code)}
The reason why a Job was created.
queryIdSTRINGAuto-generated ID for the query.
locationSTRINGThe geographic location of the query.
totalRowsSTRINGThe total number of rows in the complete query result set, which can be more than the number of rows in this single page of results.
pageTokenSTRINGA token used for paging results.
rowsARRAY
Items [{}]
An object with as many results as can be contained within the maximum permitted reply size.
totalBytesProcessedSTRINGThe total number of bytes processed for this query.
jobCompleteBOOLEAN
Options true, false
Whether the query has completed or not.
errorsARRAY
Items [{STRING(reason), STRING(location), STRING(debugInfo), STRING(message)}, BOOLEAN(cacheHit), STRING\(numDmlAffectedRows), {STRING(sessionId)}(sessionInfo), {STRING\(insertedRowCount), STRING\(deletedRowCount), STRING\(updatedRowCount)}\(dmlStats), STRING(totalBytesBilled), STRING\(totalSlotMs), STRING(creationTime), STRING\(startTime), STRING($endTime)]
The first errors or warnings encountered during the running of the job.

Output Example

{
  "kind" : "",
  "schema" : {
    "fields" : [ {
      "name" : "",
      "type" : "",
      "mode" : "",
      "fields" : [ ],
      "description" : "",
      "policyTags" : {
        "names" : [ "" ]
      },
      "dataPolicies" : {
        "name" : ""
      },
      "maxLength" : "",
      "precision" : "",
      "scale" : "",
      "roundingMode" : "",
      "collation" : "",
      "defaultValueExpression" : "",
      "rangeElementType" : {
        "type" : ""
      }
    } ]
  },
  "objectReference" : {
    "projectId" : "",
    "jobId" : "",
    "location" : ""
  },
  "jobCreationReason" : {
    "code" : ""
  },
  "queryId" : "",
  "location" : "",
  "totalRows" : "",
  "pageToken" : "",
  "rows" : [ { } ],
  "totalBytesProcessed" : "",
  "jobComplete" : false,
  "errors" : [ {
    "reason" : "",
    "location" : "",
    "debugInfo" : "",
    "message" : ""
  }, false, "", {
    "sessionId" : ""
  }, {
    "insertedRowCount" : "",
    "deletedRowCount" : "",
    "updatedRowCount" : ""
  }, "", "", "", "", "" ]
}

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.


Additional Instructions

Troubleshooting

Access Blocked: Verification Process Not Completed

Documentation for how to add a test user can be found here

How is this guide?

Last updated on

On this page