BigQuery API - Class Google::Cloud::Bigquery::QueryJob::Stage (v1.50.0)

Reference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::QueryJob::Stage.

Represents a stage in the execution plan for the query.

Inherits

  • Object

Example

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new

sql = "SELECT word FROM `bigquery-public-data.samples.shakespeare`"
job = bigquery.query_job sql

job.wait_until_done!

stages = job.query_plan
stages.each do |stage|
  puts stage.name
  stage.steps.each do |step|
    puts step.kind
    puts step.substeps.inspect
  end
end

Methods

#compute_ratio_avg

def compute_ratio_avg() -> Float

Relative amount of time the average shard spent on CPU-bound tasks.

Returns
  • (Float) — the current value of compute_ratio_avg

#compute_ratio_max

def compute_ratio_max() -> Float

Relative amount of time the slowest shard spent on CPU-bound tasks.

Returns
  • (Float) — the current value of compute_ratio_max

#id

def id() -> Integer

Unique ID for the stage within the query plan.

Returns
  • (Integer) — the current value of id

#name

def name() -> String

Human-readable name for the stage.

Returns
  • (String) — the current value of name

#read_ratio_avg

def read_ratio_avg() -> Float

Relative amount of time the average shard spent reading input.

Returns
  • (Float) — the current value of read_ratio_avg

#read_ratio_max

def read_ratio_max() -> Float

Relative amount of time the slowest shard spent reading input.

Returns
  • (Float) — the current value of read_ratio_max

#records_read

def records_read() -> Integer

Number of records read into the stage.

Returns
  • (Integer) — the current value of records_read

#records_written

def records_written() -> Integer

Number of records written by the stage.

Returns
  • (Integer) — the current value of records_written

#status

def status()

Returns the value of attribute status.

#steps

def steps() -> Array<Step>

List of operations within the stage in dependency order (approximately chronological).

Returns
  • (Array<Step>) — the current value of steps

#wait_ratio_avg

def wait_ratio_avg() -> Float

Relative amount of time the average shard spent waiting to be scheduled.

Returns
  • (Float) — the current value of wait_ratio_avg

#wait_ratio_max

def wait_ratio_max() -> Float

Relative amount of time the slowest shard spent waiting to be scheduled.

Returns
  • (Float) — the current value of wait_ratio_max

#write_ratio_avg

def write_ratio_avg() -> Float

Relative amount of time the average shard spent on writing output.

Returns
  • (Float) — the current value of write_ratio_avg

#write_ratio_max

def write_ratio_max() -> Float

Relative amount of time the slowest shard spent on writing output.

Returns
  • (Float) — the current value of write_ratio_max