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/StardustDocs/topics/read.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,19 +172,19 @@ val df = DataFrame.readCSV(
172
172
173
173
### Work with specific date-time formats
174
174
175
-
Sometimes date and date-time columns in your CSV can appear in different formats.
175
+
When parsing date or date-time columns, you might encounter formats different from the default ISO_LOCAL_DATE_TIME.
176
176
177
177
<table>
178
178
<tr><th>date</th></tr>
179
179
<tr><td>13/Jan/23 11:49 AM</td></tr>
180
180
<tr><td>14/Mar/23 5:35 PM</td></tr>
181
181
</table>
182
182
183
-
Here, the date is represented by the format "dd/MMM/yy h:mm a". However, by default, the ISO_LOCAL_DATE_TIME format is used, so the column is not recognized as date-time but instead as a simple String.
183
+
Because the format here "dd/MMM/yy h:mm a" differs from the default (ISO_LOCAL_DATE_TIME), columns like this may be recognized as simple String values rather than actual date-time columns.
184
184
185
-
You can fix this in two ways:
185
+
You can fix this whenever you parse a string-based column (e.g., using readCsv, readTsv, or StringCol.convertTo<>()) by providing a custom date-time pattern. There are two ways to do this:
186
186
187
-
1) By providing the date-time pattern as raw string to the parser option:
187
+
1) By providing the date-time pattern as raw string to the ParserOptions:
These two approaches are essentially the same, just specified in different ways.
212
212
213
+
> Note: Although these examples focus on reading CSV files, the parse operation can handle any String columns (for instance, readCsv, readTsv, StringCol.convertTo<>(), etc.) and accept a ParserOptions argument to configure locale, null-strings, date-time patterns, and more. For more details on the parse operation, see [`Parse Operation`](parse.md).
214
+
213
215
## Read from JSON
214
216
215
217
To read a JSON file, use the `.readJSON()` function. JSON files can be read from a file or a URL.
0 commit comments