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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

def id
  @id
end

#nameString (readonly)

Human-readable name for the stage.

Returns:

  • (String)

    the current value of name



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

def records_read
  @records_read
end

#records_writtenInteger (readonly)

Number of records written by the stage.

Returns:

  • (Integer)

    the current value of records_written



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

def records_written
  @records_written
end

#statusObject (readonly)

Returns the value of attribute status.



1708
1709
1710
# File 'lib/google/cloud/bigquery/query_job.rb', line 1708

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

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



1699
1700
1701
# File 'lib/google/cloud/bigquery/query_job.rb', line 1699

def write_ratio_max
  @write_ratio_max
end