Reference documentation and code samples for the Cloud Bigtable API class Google::Cloud::Bigtable::ColumnRange.
ColumnRange
Specifies a contiguous range of column qualifiers.
- Start qualifier bound : The qualifier at which to start the range. If neither field is set, interpreted as the empty string, inclusive.
- End qualifier bound: The qualifier at which to end the range. If neither field is set, interpreted as the infinite string qualifier, exclusive.
Inherits
- Object
Example
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new table = bigtable.table "my-instance", "my-table" # Range that includes all qualifiers including "user-001" up until "user-010" table.new_column_range("cf").from("user-001").to("user-010") # Range that includes all qualifiers including "user-001" up to and including "user-005" table.new_column_range("cf").from("user-001").to("user-005", inclusive: true) # Range that includes all qualifiers until end of the row key "user-001". table.new_column_range("cf").to("user-010") # exclusive # Range with unbounded start and the inclusive end "user-100" table.new_column_range("cf").to("user-100", inclusive: true) # Range that includes all qualifiers including "user-001" up to and including "user-100" table.new_column_range("cf").between("user-001", "user-100")
Methods
#between
def between(from_qualifier, to_qualifier) -> Google::Cloud::Bigtable::ColumnRange
Sets the column range with the inclusive upper and lower bound.
- from_qualifier (String) — Inclusive from qualifier. Required.
- to_qualifier (String) — Inclusive to qualifier. Required.
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new table = bigtable.table "my-instance", "my-table" table.new_column_range("cf").between("qualifier-1", "qualifier-10")
#family
def family() -> String
Gets the column family name.
- (String)
#family=
def family=(name)
Sets the column family name.
- name (String) — Column family name
#from
def from(qualifier, inclusive: true) -> Google::Cloud::Bigtable::ColumnRange
Sets the column range with the lower bound.
- qualifier (String) — Column qualifier name. Required
- inclusive (String) (defaults to: true) — Lower bound flag. Inclusive/Exclusive. Default is an inclusive lower bound.
Inclusive lower bound.
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new table = bigtable.table "my-instance", "my-table" table.new_column_range("cf").from("qualifier-1")
Exclusive lower bound.
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new table = bigtable.table "my-instance", "my-table" table.new_column_range("cf").from("qualifier-1", inclusive: false)
#initialize
def initialize(family) -> ColumnRange
Create qualifier range instance.
- family (String) — Column family name.
- (ColumnRange) — a new instance of ColumnRange
#of
def of(from_qualifier, to_qualifier) -> Google::Cloud::Bigtable::ColumnRange
Sets the column range with the inclusive upper and the exclusive lower bound.
- from_qualifier (String) — Inclusive from qualifier
- to_qualifier (String) — Exclusive to qualifier
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new table = bigtable.table "my-instance", "my-table" table.new_column_range("cf").of("qualifier-1", "qualifier-10")
#to
def to(qualifier, inclusive: false) -> Google::Cloud::Bigtable::ColumnRange
Sets the column range with the upper bound.
- qualifier (String) — Column qualifier name. Required.
- inclusive (String) (defaults to: false) — Upper bound flag. Inclusive/Exclusive. Default is an inclusive upper bound.
Inclusive upper bound.
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new table = bigtable.table "my-instance", "my-table" table.new_column_range("cf").to("qualifier-10", inclusive: true)
Exclusive upper bound.
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new table = bigtable.table "my-instance", "my-table" table.new_column_range("cf").to("qualifier-10")