Create SedonaDB logical expressions

sd_expr_column(column_name, qualifier = NULL, factory = sd_expr_factory())

sd_expr_literal(x, type = NULL, factory = sd_expr_factory())

sd_expr_binary(op, lhs, rhs, factory = sd_expr_factory())

sd_expr_negative(expr, factory = sd_expr_factory())

sd_expr_is_null(expr, factory = sd_expr_factory())

sd_expr_is_not_null(expr, factory = sd_expr_factory())

sd_expr_not(expr, factory = sd_expr_factory())

sd_expr_any_function(
  function_name,
  args,
  ...,
  na.rm = NULL,
  factory = sd_expr_factory()
)

sd_expr_scalar_function(function_name, args, factory = sd_expr_factory())

sd_expr_aggregate_function(
  function_name,
  args,
  ...,
  na.rm = FALSE,
  distinct = FALSE,
  factory = sd_expr_factory()
)

sd_expr_cast(expr, type, factory = sd_expr_factory())

sd_expr_alias(expr, alias, factory = sd_expr_factory())

sd_expr_parse_binary(expr)

as_sd_expr(x, factory = sd_expr_factory())

is_sd_expr(x)

sd_expr_factory(ctx = NULL)

Arguments

column_name

A column name

qualifier

An optional qualifier (e.g., table reference) that may be used to disambiguate a specific reference

factory

A sd_expr_factory(). This factory wraps a SedonaDB context and is used to resolve scalar functions and/or retrieve options.

x

An object to convert to a SedonaDB literal (constant).

type

A destination type into which expr should be cast.

op

Operator name for a binary expression. In general these follow R function names (e.g., >, <, +, -).

lhs, rhs

Arguments to a binary expression

expr

A SedonaDBExpr or object coercible to one with as_sd_expr().

function_name

The name of the function to call. This name is resolved from the context associated with factory.

args

A list of SedonaDBExpr or object coercible to one with as_sd_expr().

...

Reserved for future use

na.rm

For aggregate expressions, should nulls be ignored? The R idiom is to respect null; however, the SQL idiom is to drop them. The default value follows the R idiom (na.rm = FALSE).

distinct

For aggregate expressions, use only distinct values.

alias

An alias to apply to expr.

ctx

A SedonaDB context or NULL to use the default context.

Value

An object of class SedonaDBExpr

Examples

sd_expr_column("foofy")
#> <SedonaDBExpr>
#> foofy
sd_expr_literal(1L)
#> <SedonaDBExpr>
#> Int32(1)
sd_expr_scalar_function("abs", list(1L))
#> <SedonaDBExpr>
#> abs(Int32(1))
sd_expr_cast(1L, nanoarrow::na_int64())
#> <SedonaDBExpr>
#> CAST(Int32(1) AS Int64)
sd_expr_alias(1L, "foofy")
#> <SedonaDBExpr>
#> Int32(1) AS foofy