Class: AnalyticsOps::BigQuery::Result
- Inherits:
-
Object
- Object
- AnalyticsOps::BigQuery::Result
- Defined in:
- lib/analytics_ops/bigquery/definition.rb,
sig/analytics_ops.rbs
Overview
Immutable, bounded result returned by the optional BigQuery adapter.
Constant Summary collapse
- NAME =
/\A[A-Za-z][A-Za-z0-9_]{0,71}\z/- HEADER =
/\A[A-Za-z_][A-Za-z0-9_]{0,127}\z/- MAX_ROWS =
10_000- MAX_CELL_BYTES =
1_048_576
Instance Attribute Summary collapse
-
#bytes_processed ⇒ Integer
readonly
Returns the value of attribute bytes_processed.
-
#headers ⇒ Array[String]
readonly
Returns the value of attribute headers.
-
#maximum_bytes_billed ⇒ Integer
readonly
Returns the value of attribute maximum_bytes_billed.
-
#name ⇒ String
readonly
Returns the value of attribute name.
-
#rows ⇒ Array[record]
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize(name:, headers:, rows:, bytes_processed:, maximum_bytes_billed:) ⇒ Result
constructor
A new instance of Result.
- #to_h ⇒ record
Constructor Details
#initialize(name:, headers:, rows:, bytes_processed:, maximum_bytes_billed:) ⇒ Result
Returns a new instance of Result.
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/analytics_ops/bigquery/definition.rb', line 89 def initialize(name:, headers:, rows:, bytes_processed:, maximum_bytes_billed:) validate_name!(name) validate_headers!(headers) normalized_rows = validate_rows(rows, headers) validate_byte_counts!(bytes_processed, maximum_bytes_billed) @name = name.dup.freeze @headers = Canonical.immutable(headers) @rows = Canonical.immutable(normalized_rows) @bytes_processed = bytes_processed @maximum_bytes_billed = maximum_bytes_billed freeze end |
Instance Attribute Details
#bytes_processed ⇒ Integer (readonly)
Returns the value of attribute bytes_processed.
87 88 89 |
# File 'lib/analytics_ops/bigquery/definition.rb', line 87 def bytes_processed @bytes_processed end |
#headers ⇒ Array[String] (readonly)
Returns the value of attribute headers.
87 88 89 |
# File 'lib/analytics_ops/bigquery/definition.rb', line 87 def headers @headers end |
#maximum_bytes_billed ⇒ Integer (readonly)
Returns the value of attribute maximum_bytes_billed.
87 88 89 |
# File 'lib/analytics_ops/bigquery/definition.rb', line 87 def maximum_bytes_billed @maximum_bytes_billed end |
#name ⇒ String (readonly)
Returns the value of attribute name.
87 88 89 |
# File 'lib/analytics_ops/bigquery/definition.rb', line 87 def name @name end |
#rows ⇒ Array[record] (readonly)
Returns the value of attribute rows.
87 88 89 |
# File 'lib/analytics_ops/bigquery/definition.rb', line 87 def rows @rows end |
Instance Method Details
#to_h ⇒ record
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/analytics_ops/bigquery/definition.rb', line 103 def to_h { "experimental" => true, "name" => name, "headers" => headers, "rows" => rows, "row_count" => rows.length, "bytes_processed" => bytes_processed, "maximum_bytes_billed" => maximum_bytes_billed } end |