Class: Google::Cloud::Bigtable::Admin::V2::Type
- Inherits:
-
Object
- Object
- Google::Cloud::Bigtable::Admin::V2::Type
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/bigtable/admin/v2/types.rb
Overview
Type
represents the type of data that is written to, read from, or stored
in Bigtable. It is heavily based on the GoogleSQL standard to help maintain
familiarity and consistency across products and features.
For compatibility with Bigtable's existing untyped APIs, each Type
includes
an Encoding
which describes how to convert to/from the underlying data.
This might involve composing a series of steps into an "encoding chain," for
example to convert from INT64 -> STRING -> raw bytes. In most cases, a "link"
in the encoding chain will be based an on existing GoogleSQL conversion
function like CAST
.
Each link in the encoding chain also defines the following properties:
- Natural sort: Does the encoded value sort consistently with the original
typed value? Note that Bigtable will always sort data based on the raw
encoded value, not the decoded type.
- Example: STRING values sort in the same order as their UTF-8 encodings.
- Counterexample: Encoding INT64 to a fixed-width STRING does not preserve sort order when dealing with negative numbers. INT64(1) > INT64(-1), but STRING("-00001") > STRING("00001).
- The overall encoding chain sorts naturally if every link does.
- Self-delimiting: If we concatenate two encoded values, can we always tell
where the first one ends and the second one begins?
- Example: If we encode INT64s to fixed-width STRINGs, the first value will always contain exactly N digits, possibly preceded by a sign.
- Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have no way to tell where the first one ends.
- The overall encoding chain is self-delimiting if any link is.
- Compatibility: Which other systems have matching encoding schemes? For example, does this encoding have a GoogleSQL equivalent? HBase? Java?
Defined Under Namespace
Classes: Aggregate, Bytes, Int64
Instance Attribute Summary collapse
-
#aggregate_type ⇒ ::Google::Cloud::Bigtable::Admin::V2::Type::Aggregate
Aggregate.
-
#bytes_type ⇒ ::Google::Cloud::Bigtable::Admin::V2::Type::Bytes
Bytes.
-
#int64_type ⇒ ::Google::Cloud::Bigtable::Admin::V2::Type::Int64
Int64.
Instance Attribute Details
#aggregate_type ⇒ ::Google::Cloud::Bigtable::Admin::V2::Type::Aggregate
Returns Aggregate.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'proto_docs/google/bigtable/admin/v2/types.rb', line 63 class Type include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Bytes # Values of type `Bytes` are stored in `Value.bytes_value`. # @!attribute [rw] encoding # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes::Encoding] # The encoding to use when converting to/from lower level types. class Bytes include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Rules used to convert to/from lower level types. # @!attribute [rw] raw # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes::Encoding::Raw] # Use `Raw` encoding. class Encoding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Leaves the value "as-is" # * Natural sort? Yes # * Self-delimiting? No # * Compatibility? N/A class Raw include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end # Int64 # Values of type `Int64` are stored in `Value.int_value`. # @!attribute [rw] encoding # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Int64::Encoding] # The encoding to use when converting to/from lower level types. class Int64 include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Rules used to convert to/from lower level types. # @!attribute [rw] big_endian_bytes # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Int64::Encoding::BigEndianBytes] # Use `BigEndianBytes` encoding. class Encoding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Encodes the value as an 8-byte big endian twos complement `Bytes` # value. # * Natural sort? No (positive values only) # * Self-delimiting? Yes # * Compatibility? # - BigQuery Federation `BINARY` encoding # - HBase `Bytes.toBytes` # - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` # @!attribute [rw] bytes_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes] # The underlying `Bytes` type, which may be able to encode further. class BigEndianBytes include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end # A value that combines incremental updates into a summarized value. # # Data is never directly written or read using type `Aggregate`. Writes will # provide either the `input_type` or `state_type`, and reads will always # return the `state_type` . # @!attribute [rw] input_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type] # Type of the inputs that are accumulated by this `Aggregate`, which must # specify a full encoding. # Use `AddInput` mutations to accumulate new inputs. # @!attribute [r] state_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type] # Output only. Type that holds the internal accumulator state for the # `Aggregate`. This is a function of the `input_type` and `aggregator` # chosen, and will always specify a full encoding. # @!attribute [rw] sum # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Aggregate::Sum] # Sum aggregator. class Aggregate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Computes the sum of the input values. # Allowed input: `Int64` # State: same as input class Sum include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |
#bytes_type ⇒ ::Google::Cloud::Bigtable::Admin::V2::Type::Bytes
Returns Bytes.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'proto_docs/google/bigtable/admin/v2/types.rb', line 63 class Type include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Bytes # Values of type `Bytes` are stored in `Value.bytes_value`. # @!attribute [rw] encoding # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes::Encoding] # The encoding to use when converting to/from lower level types. class Bytes include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Rules used to convert to/from lower level types. # @!attribute [rw] raw # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes::Encoding::Raw] # Use `Raw` encoding. class Encoding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Leaves the value "as-is" # * Natural sort? Yes # * Self-delimiting? No # * Compatibility? N/A class Raw include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end # Int64 # Values of type `Int64` are stored in `Value.int_value`. # @!attribute [rw] encoding # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Int64::Encoding] # The encoding to use when converting to/from lower level types. class Int64 include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Rules used to convert to/from lower level types. # @!attribute [rw] big_endian_bytes # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Int64::Encoding::BigEndianBytes] # Use `BigEndianBytes` encoding. class Encoding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Encodes the value as an 8-byte big endian twos complement `Bytes` # value. # * Natural sort? No (positive values only) # * Self-delimiting? Yes # * Compatibility? # - BigQuery Federation `BINARY` encoding # - HBase `Bytes.toBytes` # - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` # @!attribute [rw] bytes_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes] # The underlying `Bytes` type, which may be able to encode further. class BigEndianBytes include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end # A value that combines incremental updates into a summarized value. # # Data is never directly written or read using type `Aggregate`. Writes will # provide either the `input_type` or `state_type`, and reads will always # return the `state_type` . # @!attribute [rw] input_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type] # Type of the inputs that are accumulated by this `Aggregate`, which must # specify a full encoding. # Use `AddInput` mutations to accumulate new inputs. # @!attribute [r] state_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type] # Output only. Type that holds the internal accumulator state for the # `Aggregate`. This is a function of the `input_type` and `aggregator` # chosen, and will always specify a full encoding. # @!attribute [rw] sum # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Aggregate::Sum] # Sum aggregator. class Aggregate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Computes the sum of the input values. # Allowed input: `Int64` # State: same as input class Sum include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |
#int64_type ⇒ ::Google::Cloud::Bigtable::Admin::V2::Type::Int64
Returns Int64.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'proto_docs/google/bigtable/admin/v2/types.rb', line 63 class Type include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Bytes # Values of type `Bytes` are stored in `Value.bytes_value`. # @!attribute [rw] encoding # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes::Encoding] # The encoding to use when converting to/from lower level types. class Bytes include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Rules used to convert to/from lower level types. # @!attribute [rw] raw # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes::Encoding::Raw] # Use `Raw` encoding. class Encoding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Leaves the value "as-is" # * Natural sort? Yes # * Self-delimiting? No # * Compatibility? N/A class Raw include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end # Int64 # Values of type `Int64` are stored in `Value.int_value`. # @!attribute [rw] encoding # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Int64::Encoding] # The encoding to use when converting to/from lower level types. class Int64 include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Rules used to convert to/from lower level types. # @!attribute [rw] big_endian_bytes # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Int64::Encoding::BigEndianBytes] # Use `BigEndianBytes` encoding. class Encoding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Encodes the value as an 8-byte big endian twos complement `Bytes` # value. # * Natural sort? No (positive values only) # * Self-delimiting? Yes # * Compatibility? # - BigQuery Federation `BINARY` encoding # - HBase `Bytes.toBytes` # - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` # @!attribute [rw] bytes_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Bytes] # The underlying `Bytes` type, which may be able to encode further. class BigEndianBytes include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end # A value that combines incremental updates into a summarized value. # # Data is never directly written or read using type `Aggregate`. Writes will # provide either the `input_type` or `state_type`, and reads will always # return the `state_type` . # @!attribute [rw] input_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type] # Type of the inputs that are accumulated by this `Aggregate`, which must # specify a full encoding. # Use `AddInput` mutations to accumulate new inputs. # @!attribute [r] state_type # @return [::Google::Cloud::Bigtable::Admin::V2::Type] # Output only. Type that holds the internal accumulator state for the # `Aggregate`. This is a function of the `input_type` and `aggregator` # chosen, and will always specify a full encoding. # @!attribute [rw] sum # @return [::Google::Cloud::Bigtable::Admin::V2::Type::Aggregate::Sum] # Sum aggregator. class Aggregate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Computes the sum of the input values. # Allowed input: `Int64` # State: same as input class Sum include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end |