Skip to content

Commit 855a58c

Browse files
authored
Variant: Remove JSON conversion table (#485)
1 parent 25f05e7 commit 855a58c

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

VariantEncoding.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -473,32 +473,3 @@ A single Variant object may have poor read performance when only a small subset
473473
A better approach is to create separate columns for individual fields, referred to as shredding or subcolumnarization.
474474
[VariantShredding.md](VariantShredding.md) describes the Variant shredding specification in Parquet.
475475

476-
## Conversion to JSON
477-
478-
Values stored in the Variant encoding are a superset of JSON values.
479-
For example, a Variant value can be a date that has no equivalent type in JSON.
480-
To maximize compatibility with readers that can process JSON but not Variant, the following conversions should be used when producing JSON from a Variant:
481-
482-
| Variant type | JSON type | Representation requirements | Example |
483-
|------------------|-----------|----------------------------------------------------------|------------------------------------------|
484-
| Null type | null | `null` | `null` |
485-
| Boolean | boolean | `true` or `false` | `true` |
486-
| Exact Numeric | number | Digits in fraction must match scale, no exponent | `34`, `34.00` |
487-
| Float | number | Fraction must be present | `14.20` |
488-
| Double | number | Fraction must be present | `1.0` |
489-
| Date | string | ISO-8601 formatted date | `"2017-11-16"` |
490-
| Time | string | ISO-8601 formatted UTC time | `"22:31:08.000001"` |
491-
| Timestamp (6) | string | ISO-8601 formatted UTC timestamp including +00:00 offset | `"2017-11-16T22:31:08.000001+00:00"` |
492-
| Timestamp (9) | string | ISO-8601 formatted UTC timestamp including +00:00 offset | `"2017-11-16T22:31:08.000000001+00:00"` |
493-
| TimestampNTZ (6) | string | ISO-8601 formatted UTC timestamp with no offset or zone | `"2017-11-16T22:31:08.000001"` |
494-
| TimestampNTZ (9) | string | ISO-8601 formatted UTC timestamp with no offset or zone | `"2017-11-16T22:31:08.000000001"` |
495-
| Binary | string | Base64 encoded binary | `"dmFyaWFudAo="` |
496-
| String | string | | `"variant"` |
497-
| UUID | string | | `"f79c3e09-677c-4bbd-a479-3f349cb785e7"` |
498-
| Array | array | | `[34, "abc", "2017-11-16]` |
499-
| Object | object | | `{"id": 34, "data": "abc"}` |
500-
501-
Notes:
502-
503-
* For timestamp and timestampntz, values must use microsecond precision and trailing 0s are required
504-
* For float and double, infinities and not a number values are encoded as strings: `"Infinity"`, `"-Infinity"`, and `"NaN"`

0 commit comments

Comments
 (0)