Class: Google::Cloud::Bigquery::Table::AsyncInserter::Result
- Inherits:
 - 
      Object
      
        
- Object
 - Google::Cloud::Bigquery::Table::AsyncInserter::Result
 
 
- Defined in:
 - lib/google/cloud/bigquery/table/async_inserter.rb
 
Overview
AsyncInserter::Result
Represents the result from BigQuery, including any error encountered, when data is asynchronously inserted into a table for near-immediate querying. See Dataset#insert_async and Google::Cloud::Bigquery::Table#insert_async.
Instance Attribute Summary collapse
- 
  
    
      #error  ⇒ Error? 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The error from the insert operation if any error was encountered, otherwise
nil. - 
  
    
      #insert_response  ⇒ Google::Cloud::Bigquery::InsertResponse? 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The response from the insert operation if no error was encountered, or
nilif the insert operation encountered an error. 
Instance Method Summary collapse
- 
  
    
      #error?  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    
Checks if an error is present, meaning that the insert operation encountered an error.
 - 
  
    
      #error_count  ⇒ Integer? 
    
    
  
  
  
  
  
  
  
  
  
    
The count of errors for rows that were not inserted.
 - 
  
    
      #error_rows  ⇒ Array<Hash>? 
    
    
  
  
  
  
  
  
  
  
  
    
The rows that were not inserted.
 - 
  
    
      #errors_for(row)  ⇒ Array<Hash>? 
    
    
  
  
  
  
  
  
  
  
  
    
Returns the error hashes for a row that was not inserted.
 - 
  
    
      #index_for(row)  ⇒ Integer? 
    
    
  
  
  
  
  
  
  
  
  
    
Returns the index for a row that was not inserted.
 - 
  
    
      #insert_count  ⇒ Integer? 
    
    
  
  
  
  
  
  
  
  
  
    
The count of rows in the response, minus the count of errors for rows that were not inserted.
 - 
  
    
      #insert_error_for(row)  ⇒ InsertError? 
    
    
  
  
  
  
  
  
  
  
  
    
Returns the error object for a row that was not inserted.
 - 
  
    
      #insert_errors  ⇒ Array<InsertError>? 
    
    
  
  
  
  
  
  
  
  
  
    
The error objects for rows that were not inserted.
 - 
  
    
      #success?  ⇒ Boolean? 
    
    
  
  
  
  
  
  
  
  
  
    
Checks if the error count for row-level errors is zero, meaning that all of the rows were inserted.
 
Instance Attribute Details
#error ⇒ Error? (readonly)
The error from the insert operation
if any error was encountered, otherwise nil.
      351 352 353  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 351 def error @error end  | 
  
#insert_response ⇒ Google::Cloud::Bigquery::InsertResponse? (readonly)
The response from the insert operation if no
error was encountered, or nil if the insert operation
encountered an error.
      351 352 353  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 351 def insert_response @insert_response end  | 
  
Instance Method Details
#error? ⇒ Boolean
Checks if an error is present, meaning that the insert operation encountered an error. Use #error to access the error. For row-level errors, see #success? and #insert_errors.
      368 369 370  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 368 def error? !error.nil? end  | 
  
#error_count ⇒ Integer?
The count of errors for rows that were not inserted.
      405 406 407 408  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 405 def error_count return nil if error? insert_response.error_count end  | 
  
#error_rows ⇒ Array<Hash>?
The rows that were not inserted.
      427 428 429 430  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 427 def error_rows return nil if error? insert_response.error_rows end  | 
  
#errors_for(row) ⇒ Array<Hash>?
Returns the error hashes for a row that was not inserted. Each
error hash contains the following keys: reason, location,
debugInfo, and message.
      457 458 459 460  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 457 def errors_for row return nil if error? insert_response.errors_for row end  | 
  
#index_for(row) ⇒ Integer?
Returns the index for a row that was not inserted.
      471 472 473 474  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 471 def index_for row return nil if error? insert_response.index_for row end  | 
  
#insert_count ⇒ Integer?
The count of rows in the response, minus the count of errors for rows that were not inserted.
      394 395 396 397  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 394 def insert_count return nil if error? insert_response.insert_count end  | 
  
#insert_error_for(row) ⇒ InsertError?
Returns the error object for a row that was not inserted.
      441 442 443 444  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 441 def insert_error_for row return nil if error? insert_response.insert_error_for row end  | 
  
#insert_errors ⇒ Array<InsertError>?
The error objects for rows that were not inserted.
      416 417 418 419  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 416 def insert_errors return nil if error? insert_response.insert_errors end  | 
  
#success? ⇒ Boolean?
Checks if the error count for row-level errors is zero, meaning that all of the rows were inserted. Use #insert_errors to access the row-level errors. To check for and access any operation-level error, use #error? and #error.
      382 383 384 385  | 
    
      # File 'lib/google/cloud/bigquery/table/async_inserter.rb', line 382 def success? return nil if error? insert_response.success? end  |