Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ The row order in this table is important. Type lookup stops after the first matc
}
```

If the `"properties"` key is missing, the type for the entire object will be `STRING` instead of `RECORD`.
If the `"properties"` key is missing, the type for the entire object will be `JSON` instead of `RECORD`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote "properties" (in quotes) because that's how was written before this PR. And I extended that pattern elsewhere in this PR for consistency.

I'd happily change it simply properties (no quotes) if you prefer.


Objects can be nullable. Nested fields can also be nullable (same rules as for everything else).

Expand All @@ -961,9 +961,7 @@ Objects can be nullable. Nested fields can also be nullable (same rules as for e
}
```

If the `"items"` key is missing, the type for the entire array will be `STRING` instead of `REPEATED`.

Arrays can be nullable. Nested fields can also be nullable (same rules as for everything else).
The type of the repeated value is determined by the `"items"` key of the schema. If the `"items"` key is missing, then the repeated type is `JSON`.

</td>
<td>
Expand Down Expand Up @@ -1120,18 +1118,36 @@ OR

```json
{
"enum": [A1, A2, ...]
"enum": [S1, S2, ...]
}
```

- Any of `Ax`, `Ax` has a type other than integer or number.
- All `Sx` are strings

</td>
<td>

`STRING`

_Values will be quoted as in JSON._
</td>
</tr>
<tr>
<td >

```json
{
"enum": [A1, A2, ...]
}
```

- `Ax` are a mix of different types

</td>
<td>

`JSON`

_String values will be quoted as in JSON._

</td>
</tr>
Expand All @@ -1141,9 +1157,7 @@ If nothing matches above, this is a catch-all.
</td>
<td>

`STRING`

_Values will be quoted as in JSON._
`JSON`

</td>
</tr>
Expand Down Expand Up @@ -1172,6 +1186,52 @@ The row order in this table is important. Type lookup stops after the first matc
<tr>
<td>

```json
{
"type": "object",
"properties": {...}
}
```

The `STRUCT` has nested fields, whose types are determined by the `"properties"` key of the schema.

If the `"properties"` key is missing, the type for the entire object will be `STRING` instead of `STRUCT`, and data will be JSON-serialized in the string column.

Objects can be nullable. Nested fields can also be nullable (same rules as for everything else).

</td>
<td>

`STRUCT`

</td>
</tr>

<tr>
<td>

```json
{
"type": "array",
"items": {...}
}
```

The type of values within the `ARRAY` is determined by the `"items"` key of the schema. If the `"items"` key is missing, then the values within the array will have type `STRING`, and array items will be JSON-serialized.

Arrays can be nullable. Nested fields can also be nullable (same rules as for everything else).

</td>
<td>

`REPEATED`

</td>
</tr>

<tr>
<td>

```json
{
"type": "string",
Expand Down Expand Up @@ -1679,7 +1739,7 @@ _`P` is rounded up to either `9`, `18` or `38`._

`STRING`

_Values will be quoted as in JSON._
_String values will be quoted as in JSON._

</td>
</tr>
Expand Down