Repository: calcite Updated Branches: refs/heads/master 7a00d4cca -> 09df15fed
[CALCITE-1192] Expanded documentation on TypedValue/Rep This is hopefully helpful to understand, at a high-level, the interlay between TypedValue and Rep, specific to the serialization mechanism being used. Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/09df15fe Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/09df15fe Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/09df15fe Branch: refs/heads/master Commit: 09df15fed8746ee63a10cce80af54966838f26bc Parents: 7a00d4c Author: Josh Elser <[email protected]> Authored: Sun Apr 17 16:47:27 2016 -0400 Committer: Josh Elser <[email protected]> Committed: Sun Apr 17 16:50:10 2016 -0400 ---------------------------------------------------------------------- avatica/site/_docs/json_reference.md | 36 +++++++++++++++++++++++++++ avatica/site/_docs/protobuf_reference.md | 35 ++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite/blob/09df15fe/avatica/site/_docs/json_reference.md ---------------------------------------------------------------------- diff --git a/avatica/site/_docs/json_reference.md b/avatica/site/_docs/json_reference.md index 30efddf..a512b84 100644 --- a/avatica/site/_docs/json_reference.md +++ b/avatica/site/_docs/json_reference.md @@ -1153,3 +1153,39 @@ This object encapsulates the type and value for a column in a row. `type` A name referring to the type of the object stored in `value`. `value` A JSON representation of a JDBC type. + +The following chart documents how each <a href="#rep">Rep</a> value is serialized +into a JSON value. Consult the [JSON documentation](http://json-spec.readthedocs.org/en/latest/reference.html) +for more information on valid attributes in JSON. + +| <a href="#rep">Rep</a> Value | Serialized | Description | +| PRIMITIVE_BOOLEAN | boolean || +| BOOLEAN | boolean || +| PRIMITIVE_BYTE | number | The numeric value of the `byte`. | +| BYTE | number || +| PRIMITIVE_CHAR | string || +| CHARACTER | string || +| PRIMITIVE_SHORT | number || +| SHORT | number || +| PRIMITIVE_INT | number || +| INTEGER | number || +| PRIMITIVE_LONG | number || +| LONG | number || +| PRIMITIVE_FLOAT | number || +| FLOAT | number || +| PRIMITIVE_DOUBLE | number || +| DOUBLE | number || +| BIG_INTEGER | number | Implicitly handled by Jackson. | +| BIG_DECIMAL | number | Implicitly handled by Jackson. | +| JAVA_SQL_TIME | number | As an integer, millis since midnight. | +| JAVA_SQL_DATE | number | As an integer, days since the epoch. | +| JAVA_SQL_TIMESTAMP | number | As a long, millis since the epoch. | +| JAVA_UTIL_DATE | number | As a long, millis since the epoch. | +| BYTE_STRING | string | A Base64-encoded string. | +| STRING | string | | +| NUMBER | number | A general number, unknown what concrete type. | +| OBJECT | null | Implicitly converted by Jackson. | +| NULL | null | Implicitly converted by Jackson. | +| ARRAY | N/A | Implicitly handled by Jackson. | +| STRUCT | N/A | Implicitly handled by Jackson. | +| MULTISET | N/A | Implicitly handled by Jackson. | http://git-wip-us.apache.org/repos/asf/calcite/blob/09df15fe/avatica/site/_docs/protobuf_reference.md ---------------------------------------------------------------------- diff --git a/avatica/site/_docs/protobuf_reference.md b/avatica/site/_docs/protobuf_reference.md index 9a76c03..304bc60 100644 --- a/avatica/site/_docs/protobuf_reference.md +++ b/avatica/site/_docs/protobuf_reference.md @@ -1229,6 +1229,41 @@ message TypedValue { `null` A boolean which denotes if the value was null. +The following chart documents how each <a href="#rep">Rep</a> value corresponds +to the attributes in this message: + +| <a href="#rep">Rep</a> Value | <a href="#typedvalue">TypedValue</a> attribute | Description | +| PRIMITIVE_BOOLEAN | `bool_value` || +| BOOLEAN | `bool_value` || +| PRIMITIVE_BYTE | `number_value` | The numeric value of the `byte`. | +| BYTE | `number_value` || +| PRIMITIVE_CHAR | `string_value` || +| CHARACTER | `string_value` || +| PRIMITIVE_SHORT | `number_value` || +| SHORT | `number_value` || +| PRIMITIVE_INT | `number_value` || +| INTEGER | `number_value` || +| PRIMITIVE_LONG | `number_value` || +| LONG | `number_value` || +| PRIMITIVE_FLOAT | `number_value` || +| FLOAT | `number_value` | IEEE 754 floating-point "single format" bit layout. | +| PRIMITIVE_DOUBLE | `number_value` || +| DOUBLE | `number_value` || +| BIG_INTEGER | `bytes_value` | The two's-complement representation of the BigInteger. See `BigInteger#toByteArray().` | +| BIG_DECIMAL | `string_value` | A string-ified representation of the value. See `BigDecimal#toString()`. | +| JAVA_SQL_TIME | `number_value` || +| JAVA_SQL_DATE | `number_value` || +| JAVA_SQL_TIMESTAMP | `number_value` || +| JAVA_UTIL_DATE | `number_value` || +| BYTE_STRING | `bytes_value` || +| STRING | `string_value` | This must be a UTF-8 string. | +| NUMBER | `number_value` | A general number, unknown what concrete type. | +| OBJECT | `null` | The only general Object we can serialize is "null". Non-null OBJECT's will throw an error. | +| NULL | `null` || +| ARRAY | N/A | Unhandled. | +| STRUCT | N/A | Unhandled. | +| MULTISET | N/A | Unhandled. | + ### UpdateBatch This is a message which serves as a wrapper around a collection of <a href="#typedvalue">TypedValue</a>'s.
