This is useful for creating a view that can be referenced in a SQL statement. Use sd_drop_view() to remove it.

sd_to_view(.data, table_ref, overwrite = FALSE, ctx = NULL)

Arguments

.data

A sedonadb_dataframe or an object that can be coerced to one.

table_ref

The name of the view reference

overwrite

Use TRUE to overwrite a view with the same name (if it exists)

ctx

A SedonaDB context.

Value

.data, invisibly

Examples

sd_sql("SELECT 1 as one") |> sd_to_view("foofy")
sd_sql("SELECT * FROM foofy")
#> <sedonab_dataframe: ?? x 1>
#> ┌───────┐
#> │  one  │
#> │ int64 │
#> ╞═══════╡
#> │     1 │
#> └───────┘
#> Preview of up to 6 row(s)