@@ -41,18 +41,18 @@ option ruby_package = "Google::Cloud::Bigtable::Admin::V2";
4141// * Natural sort: Does the encoded value sort consistently with the original
4242// typed value? Note that Bigtable will always sort data based on the raw
4343// encoded value, *not* the decoded type.
44- // - Example: STRING values sort in the same order as their UTF-8 encodings.
44+ // - Example: BYTES values sort in the same order as their raw encodings.
4545// - Counterexample: Encoding INT64 to a fixed-width STRING does *not*
4646// preserve sort order when dealing with negative numbers.
4747// INT64(1) > INT64(-1), but STRING("-00001") > STRING("00001).
48- // - The overall encoding chain sorts naturally if *every* link does.
48+ // - The overall encoding chain has this property if *every* link does.
4949// * Self-delimiting: If we concatenate two encoded values, can we always tell
5050// where the first one ends and the second one begins?
5151// - Example: If we encode INT64s to fixed-width STRINGs, the first value
5252// will always contain exactly N digits, possibly preceded by a sign.
5353// - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have
5454// no way to tell where the first one ends.
55- // - The overall encoding chain is self-delimiting if *any* link is .
55+ // - The overall encoding chain has this property if *any* link does .
5656// * Compatibility: Which other systems have matching encoding schemes? For
5757// example, does this encoding have a GoogleSQL equivalent? HBase? Java?
5858message Type {
@@ -78,6 +78,31 @@ message Type {
7878 Encoding encoding = 1 ;
7979 }
8080
81+ // String
82+ // Values of type `String` are stored in `Value.string_value`.
83+ message String {
84+ // Rules used to convert to/from lower level types.
85+ message Encoding {
86+ // UTF-8 encoding
87+ // * Natural sort? No (ASCII characters only)
88+ // * Self-delimiting? No
89+ // * Compatibility?
90+ // - BigQuery Federation `TEXT` encoding
91+ // - HBase `Bytes.toBytes`
92+ // - Java `String#getBytes(StandardCharsets.UTF_8)`
93+ message Utf8Raw {}
94+
95+ // Which encoding to use.
96+ oneof encoding {
97+ // Use `Utf8Raw` encoding.
98+ Utf8Raw utf8_raw = 1 ;
99+ }
100+ }
101+
102+ // The encoding to use when converting to/from lower level types.
103+ Encoding encoding = 1 ;
104+ }
105+
81106 // Int64
82107 // Values of type `Int64` are stored in `Value.int_value`.
83108 message Int64 {
@@ -140,6 +165,9 @@ message Type {
140165 // Bytes
141166 Bytes bytes_type = 1 ;
142167
168+ // String
169+ String string_type = 2 ;
170+
143171 // Int64
144172 Int64 int64_type = 5 ;
145173
0 commit comments