We have concluded that all parsers require only the following scalar types:
- Null
- Boolean
- Bytes
- String (UTF-8 decoded)
- Int64 (for precise and efficient comparisons for integers up to int64)
- Float64 (for efficient comparisons for floats up to int64)
- Decimals or Uint64s outside of the range of Float64 or Int64 respectively are supported as a String (TODO: What is that exact string format).
- Times and Duration are supported via Int64 (nanoseconds since January 1, 1970 UTC) or a fallback to String (ISO 8601).
We did a survey and found that the following common scalar types, which we have mapped to the supported scalar types:
Surveyed | Supported |
---|---|
Null | Null |
Bool | Bool |
String | String |
Bytes | Bytes |
Int64 | Int64 |
Float64 | Float64 |
Decimal | String (TODO: What is that exact string format) |
Uint64 | Int64 (if in range) or fallback to String (if out of int64 range, same as decimal) |
Date | String: yyyy-mm-dd (ISO 8601) |
Time | Int64 (nanoseconds since January 1, 1970 UTC) or fallback to String (ISO 8601) |
Duration | Int64 (nanoseconds) |
UUID | Bytes (16 bytes) |
Enum | String (the string representation of the Enum) or fallback to Int64 |