You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/9.0/reader/record-type-inference.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,10 @@ id,name,active,amount
20
20
21
21
schema inference can determine that:
22
22
23
-
*`id` is numeric;
24
-
*`name` is a string;
25
-
*`active` is boolean;
26
-
*`amount` is numeric.
23
+
-`id` is numeric;
24
+
-`name` is a string;
25
+
-`active` is boolean;
26
+
-`amount` is numeric.
27
27
28
28
The feature is available through `Reader::inferSchema()` and `Reader::inferRecords()`.
29
29
@@ -262,9 +262,9 @@ In both cases, schema inference is performed from a sample of the CSV and the re
262
262
263
263
A Tabular data provides three ways to iterate over its records:
264
264
265
-
*`getRecords()` reads the values as they appear in the CSV;
266
-
*`getRecordsAsObject()` converts each record into a specific object;
267
-
*`inferRecords()` infers the types of the columns and parses the records accordingly.
265
+
-`getRecords()` reads the values as they appear in the CSV;
266
+
-`getRecordsAsObject()` converts each record into a specific object;
267
+
-`inferRecords()` infers the types of the columns and parses the records accordingly.
268
268
269
269
The differences become clearer when the same data is read using each method.
270
270
@@ -428,8 +428,8 @@ typed records
428
428
429
429
In short:
430
430
431
-
***`inferSchema()`** tells you *what the CSV is understood to contain*.
432
-
***`inferRecords()`** gives you the records *according to that understanding*.
431
+
-**`inferSchema()`** tells you *what the CSV is understood to contain*.
432
+
-**`inferRecords()`** gives you the records *according to that understanding*.
433
433
434
434
### `inferRecords()` with a custom inspector
435
435
@@ -543,4 +543,3 @@ Use **`getRecordsAsObject()`** when you have a known object model and want the C
543
543
In summary:
544
544
545
545
> **`getRecords()` preserves the input, `inferRecords()` interprets the input, and `getRecordsAsObject()` validates the input against an explicit object model.**
0 commit comments