Skip to content

Commit cd56517

Browse files
authored
Update read.md
1 parent 0c1bb79 commit cd56517

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/StardustDocs/topics/read.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,19 @@ val df = DataFrame.readCSV(
172172

173173
### Work with specific date-time formats
174174

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.
176176

177177
<table>
178178
<tr><th>date</th></tr>
179179
<tr><td>13/Jan/23 11:49 AM</td></tr>
180180
<tr><td>14/Mar/23 5:35 PM</td></tr>
181181
</table>
182182

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.
184184

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:
186186

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:
188188

189189
<!---FUN readNumbersWithSpecificDateTimePattern-->
190190

@@ -196,7 +196,7 @@ val df = DataFrame.readCSV(
196196
```
197197
<!---END-->
198198

199-
2) By providing a DateTimeFormatter to the parser option:
199+
2) By providing a DateTimeFormatter to the ParserOptions:
200200

201201
<!---FUN readNumbersWithSpecificDateTimeFormatter-->
202202

@@ -210,6 +210,8 @@ val df = DataFrame.readCSV(
210210
<!---END-->
211211
These two approaches are essentially the same, just specified in different ways.
212212

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+
213215
## Read from JSON
214216

215217
To read a JSON file, use the `.readJSON()` function. JSON files can be read from a file or a URL.

0 commit comments

Comments
 (0)