Class: Google::Apis::BigqueryV2::QueryResponse

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/bigquery_v2/classes.rb,
lib/google/apis/bigquery_v2/representations.rb,
lib/google/apis/bigquery_v2/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ QueryResponse

Returns a new instance of QueryResponse.



5239
5240
5241
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5239

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cache_hitBoolean Also known as: cache_hit?

Whether the query result was fetched from the query cache. Corresponds to the JSON property cacheHit

Returns:

  • (Boolean)


5167
5168
5169
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5167

def cache_hit
  @cache_hit
end

#errorsArray<Google::Apis::BigqueryV2::ErrorProto>

[Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. Corresponds to the JSON property errors



5176
5177
5178
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5176

def errors
  @errors
end

#job_completeBoolean Also known as: job_complete?

Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available. Corresponds to the JSON property jobComplete

Returns:

  • (Boolean)


5182
5183
5184
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5182

def job_complete
  @job_complete
end

#job_referenceGoogle::Apis::BigqueryV2::JobReference

Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults). Corresponds to the JSON property jobReference



5192
5193
5194
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5192

def job_reference
  @job_reference
end

#kindString

The resource type. Corresponds to the JSON property kind

Returns:

  • (String)


5197
5198
5199
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5197

def kind
  @kind
end

#num_dml_affected_rowsFixnum

[Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. Corresponds to the JSON property numDmlAffectedRows

Returns:

  • (Fixnum)


5203
5204
5205
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5203

def num_dml_affected_rows
  @num_dml_affected_rows
end

#page_tokenString

A token used for paging results. Corresponds to the JSON property pageToken

Returns:

  • (String)


5208
5209
5210
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5208

def page_token
  @page_token
end

#rowsArray<Google::Apis::BigqueryV2::TableRow>

An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. Corresponds to the JSON property rows



5215
5216
5217
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5215

def rows
  @rows
end

#schemaGoogle::Apis::BigqueryV2::TableSchema

The schema of the results. Present only when the query completes successfully. Corresponds to the JSON property schema



5220
5221
5222
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5220

def schema
  @schema
end

#session_info_templateGoogle::Apis::BigqueryV2::SessionInfo

[Output-only] [Preview] Information of the session if this job is part of one. Corresponds to the JSON property sessionInfoTemplate



5225
5226
5227
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5225

def session_info_template
  @session_info_template
end

#total_bytes_processedFixnum

The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were run. Corresponds to the JSON property totalBytesProcessed

Returns:

  • (Fixnum)


5231
5232
5233
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5231

def total_bytes_processed
  @total_bytes_processed
end

#total_rowsFixnum

The 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. Corresponds to the JSON property totalRows

Returns:

  • (Fixnum)


5237
5238
5239
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5237

def total_rows
  @total_rows
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5244

def update!(**args)
  @cache_hit = args[:cache_hit] if args.key?(:cache_hit)
  @errors = args[:errors] if args.key?(:errors)
  @job_complete = args[:job_complete] if args.key?(:job_complete)
  @job_reference = args[:job_reference] if args.key?(:job_reference)
  @kind = args[:kind] if args.key?(:kind)
  @num_dml_affected_rows = args[:num_dml_affected_rows] if args.key?(:num_dml_affected_rows)
  @page_token = args[:page_token] if args.key?(:page_token)
  @rows = args[:rows] if args.key?(:rows)
  @schema = args[:schema] if args.key?(:schema)
  @session_info_template = args[:session_info_template] if args.key?(:session_info_template)
  @total_bytes_processed = args[:total_bytes_processed] if args.key?(:total_bytes_processed)
  @total_rows = args[:total_rows] if args.key?(:total_rows)
end