@@ -310,8 +310,9 @@ DataFrame.readJson("https://covid.ourworldindata.org/data/owid-covid-data.json")
310310### Column type inference from JSON
311311
312312Type inference for JSON is much simpler than for CSV.
313- JSON string literals are always supposed to have String type. Number literals
314- take different ` Number ` kinds. Boolean literals are converted to ` Boolean ` .
313+ JSON string literals always become a ` String ` .
314+ Number literals are converted to a unified ` Number ` type which will fit all encountered numbers.
315+ Boolean literals are converted to ` Boolean ` .
315316
316317Let's take a look at the following JSON:
317318
@@ -355,12 +356,12 @@ The corresponding [`DataFrame`](DataFrame.md) schema is:
355356``` text
356357A: String
357358B: Int
358- C: Number
359+ C: Double
359360D: Boolean?
360361```
361362
362363Column A has ` String ` type because all values are string literals, no implicit conversion is performed. Column C
363- has ` Number ` type because it's the least common type for ` Int ` and ` Double ` .
364+ has the ` Double ` type because it's the smallest unified number type for ` Int ` and ` Float ` .
364365
365366### JSON parsing options
366367
@@ -370,8 +371,8 @@ By default, if a type clash occurs when reading JSON, a new column group is crea
370371any number of object properties:
371372
372373"value" will be set to the value of the JSON element if it's a primitive, else it will be ` null ` .\
373- "array" will be set to the array of values if the json element is an array, else it will be ` [] ` .\
374- If the json element is an object, then each property will spread out to its own column in the group, else these columns
374+ "array" will be set to the array of values if the JSON element is an array, else it will be ` [] ` .\
375+ If the JSON element is an object, then each property will spread out to its own column in the group, else these columns
375376will be ` null ` .
376377
377378In this case ` typeClashTactic = JSON.TypeClashTactic.ARRAY_AND_VALUE_COLUMNS ` .
0 commit comments