Class: Google::Cloud::Bigquery::QueryJob::Stage

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/bigquery/query_job.rb

Overview

Represents a stage in the execution plan for the query.

Examples:

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

Attributes collapse

Instance Attribute Details

#compute_ratio_avgFloat (readonly)

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

Returns:

  • (Float)

    the current value of compute_ratio_avg



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def compute_ratio_avg
  @compute_ratio_avg
end

#compute_ratio_maxFloat (readonly)

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

Returns:

  • (Float)

    the current value of compute_ratio_max



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def compute_ratio_max
  @compute_ratio_max
end

#idInteger (readonly)

Unique ID for the stage within the query plan.

Returns:

  • (Integer)

    the current value of id



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def id
  @id
end

#nameString (readonly)

Human-readable name for the stage.

Returns:

  • (String)

    the current value of name



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def name
  @name
end

#read_ratio_avgFloat (readonly)

Relative amount of time the average shard spent reading input.

Returns:

  • (Float)

    the current value of read_ratio_avg



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def read_ratio_avg
  @read_ratio_avg
end

#read_ratio_maxFloat (readonly)

Relative amount of time the slowest shard spent reading input.

Returns:

  • (Float)

    the current value of read_ratio_max



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def read_ratio_max
  @read_ratio_max
end

#records_readInteger (readonly)

Number of records read into the stage.

Returns:

  • (Integer)

    the current value of records_read



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def records_read
  @records_read
end

#records_writtenInteger (readonly)

Number of records written by the stage.

Returns:

  • (Integer)

    the current value of records_written



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def records_written
  @records_written
end

#statusObject (readonly)

Returns the value of attribute status.



1592
1593
1594
# File 'lib/google/cloud/bigquery/query_job.rb', line 1592

def status
  @status
end

#stepsArray<Step> (readonly)

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

Returns:

  • (Array<Step>)

    the current value of steps



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def steps
  @steps
end

#wait_ratio_avgFloat (readonly)

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

Returns:

  • (Float)

    the current value of wait_ratio_avg



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def wait_ratio_avg
  @wait_ratio_avg
end

#wait_ratio_maxFloat (readonly)

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

Returns:

  • (Float)

    the current value of wait_ratio_max



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def wait_ratio_max
  @wait_ratio_max
end

#write_ratio_avgFloat (readonly)

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

Returns:

  • (Float)

    the current value of write_ratio_avg



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def write_ratio_avg
  @write_ratio_avg
end

#write_ratio_maxFloat (readonly)

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

Returns:

  • (Float)

    the current value of write_ratio_max



1591
1592
1593
# File 'lib/google/cloud/bigquery/query_job.rb', line 1591

def write_ratio_max
  @write_ratio_max
end