The query will only be executed when requested.

sd_sql(sql, ..., params = NULL)

sd_ctx_sql(ctx, sql, ..., params = NULL)

Arguments

sql

A SQL string to execute

...

These dots are for future extensions and currently must be empty.

params

A list of parameters to fill placeholders in the query.

ctx

A SedonaDB context.

Value

A sedonadb_dataframe

Examples

sd_sql("SELECT ST_Point(0, 1) as geom")
#> <sedonab_dataframe: ?? x 1>
#> ┌────────────┐
#> │    geom    │
#> │  geometry  │
#> ╞════════════╡
#> │ POINT(0 1) │
#> └────────────┘
#> Preview of up to 6 row(s)
sd_sql("SELECT ST_Point($1, $2) as geom", params = list(1, 2))
#> <sedonab_dataframe: ?? x 1>
#> ┌────────────┐
#> │    geom    │
#> │  geometry  │
#> ╞════════════╡
#> │ POINT(1 2) │
#> └────────────┘
#> Preview of up to 6 row(s)
sd_sql("SELECT ST_Point($x, $y) as geom", params = list(x = 1, y = 2))
#> <sedonab_dataframe: ?? x 1>
#> ┌────────────┐
#> │    geom    │
#> │  geometry  │
#> ╞════════════╡
#> │ POINT(1 2) │
#> └────────────┘
#> Preview of up to 6 row(s)