jonkeane commented on code in PR #51392:
URL: https://github.com/apache/arrow/pull/51392#discussion_r4071322961
##########
r/vignettes/dataset.Rmd:
##########
@@ -308,6 +308,23 @@ in order to declare the types of the virtual columns that
define the partitions.
This would be useful, in the NYC taxi data example, if you wanted to keep
`month` as a string instead of an integer.
+### Record which file each row came from
+
+Partitioning only recovers information encoded in directory names. If you need
+the full path of the file each row was read from, use `add_filename()` inside a
+query on the Dataset:
+
+```r
+ds |>
+ mutate(file = add_filename()) |>
+ collect()
+```
+
+This is handy when you have opened a single partition directory directly (for
+example, `open_dataset("nyc-taxi/year=2015")`), since in that case the
partition
+columns above that directory (here, `year`) are not inferred and you may want
to
+recover them from the path. See `?add_filename` for details and limitations.
Review Comment:
Same thing here? Can we have roxygen "just" link this to the thing?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]