Resolves the reader from format, or from the file extension when format is NULL. The query is executed lazily when results are requested.

sd_read(
  file_or_files,
  options = list(),
  format = NULL,
  partitioning = NULL,
  check_extension = FALSE
)

sd_ctx_read(
  ctx,
  file_or_files,
  options = list(),
  format = NULL,
  partitioning = NULL,
  check_extension = FALSE
)

Arguments

file_or_files

One or more paths or URIs.

options

A named list of scalar reader or object-store options.

format

An optional file format name such as "parquet", "csv", or "json". By default the format is inferred from the path extension.

partitioning

Optional character vector of hive-style partition column names. NULL auto-discovers partitions; character() disables discovery.

check_extension

Whether to check extensions for explicitly selected formats, including compression inference. Directory listings are always filtered to matching files. Defaults to FALSE.

ctx

A SedonaDB context.

Value

A sedonadb_dataframe

Examples

path <- system.file("files/natural-earth_cities_geo.parquet", package = "sedonadb")
sd_read(path) |> head(5) |> sd_preview()
#> <sedonab_dataframe: ?? x 2>
#> ┌──────────────┬───────────────────────────────┐
#> │     name     ┆            geometry           │
#> │     utf8     ┆            geometry           │
#> ╞══════════════╪═══════════════════════════════╡
#> │ Vatican City ┆ POINT(12.4533865 41.9032822)  │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ San Marino   ┆ POINT(12.4417702 43.9360958)  │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Vaduz        ┆ POINT(9.5166695 47.1337238)   │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Lobamba      ┆ POINT(31.1999971 -26.4666675) │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Luxembourg   ┆ POINT(6.1300028 49.6116604)   │
#> └──────────────┴───────────────────────────────┘
#> Preview of up to 6 row(s)