R/ml_feature_sql_transformer_utils.R

Defines functions ft_extract_sql

ft_extract_sql <- function(x) {
  get_base_name <- function(o) {
    if (!inherits(o$x, "ident")) {
      get_base_name(o$x)
    } else {
      o$x
    }
  }
  pattern <- paste0("\\b", get_base_name(x$ops), "\\b")

  gsub(pattern, "__THIS__", dbplyr::sql_render(x))
}

Try the sparklyr package in your browser

Any scripts or data that you put into this service are public.

sparklyr documentation built on Jan. 8, 2022, 5:06 p.m.