Skip to contents

This function only exists inside arrow dplyr queries, and it only is valid when quering on a FileSystemDataset.

Usage

add_filename()

Value

A FieldRef

Expression that refers to the filename augmented column.

Details

To use filenames generated by this function in subsequent pipeline steps, you must either call compute() or collect() first. See Examples.

Examples

if (FALSE) {
open_dataset("nyc-taxi") %>% mutate(
  file =
    add_filename()
)

# To use a verb like mutate() with add_filename() we need to first call
# compute()
open_dataset("nyc-taxi") %>%
  mutate(file = add_filename()) %>%
  compute() %>%
  mutate(filename_length = nchar(file))
}