Writes the data from a data source to a directory of Parquet files. Each resource type is written to one or more files named with the resource type, a partition number and an identifier of the write, for example "Patient.00000-<write id>.parquet".

ds_write_parquet(ds, path, save_mode = SaveMode$ERROR)

Arguments

ds

The DataSource object.

path

The URI of the directory to write the files to.

save_mode

The save mode to use when writing the data.

Value

A list with element file_infos, containing a list of files created. Each file has fhir_resource_type and absolute_url.

Examples

pc <- pathling_connect()
data_source <- pc %>% pathling_read_ndjson(pathling_examples("ndjson"))

# Write the data to a directory of Parquet files.
data_source %>% ds_write_parquet(file.path(tempdir(), "parquet"))
#> $file_infos
#> $file_infos[[1]]
#> $file_infos[[1]]$fhir_resource_type
#> [1] "Condition"
#> 
#> $file_infos[[1]]$absolute_url
#> [1] "/tmp/Rtmpa0FGhu/parquet/Condition.00000-678449af-59c1-41b0-9779-92d327ff9a85.parquet"
#> 
#> 
#> $file_infos[[2]]
#> $file_infos[[2]]$fhir_resource_type
#> [1] "Patient"
#> 
#> $file_infos[[2]]$absolute_url
#> [1] "/tmp/Rtmpa0FGhu/parquet/Patient.00000-e587271b-903a-4b28-8211-516c05c5e15f.parquet"
#> 
#> 
#> 

pathling_disconnect(pc)