build_join_plan: Build a join plan.

View source: R/join_controller.R

build_join_planR Documentation

Build a join plan.

Description

Please see vignette('DependencySorting', package = 'rquery') and vignette('joinController', package= 'rquery') for more details.

Usage

build_join_plan(tDesc, ..., check = TRUE)

Arguments

tDesc

description of tables from describe_tables (and likely altered by user). Note: no column names must intersect with names of the form table_CLEANEDTABNAME_present.

...

force later arguments to bind by name.

check

logical, if TRUE check the join plan for consistency.

Value

detailed column join plan (appropriate for editing)

See Also

describe_tables, inspect_join_plan, graph_join_plan, actualize_join_plan

Examples


if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) {
  my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
  d <- data.frame(id=1:3, weight= c(200, 140, 98))
  DBI::dbWriteTable(my_db,"d1", d)
  DBI::dbWriteTable(my_db,"d2", d)
  tDesc <- describe_tables(my_db, c("d1", "d2"))
  tDesc$keys[[1]] <- list(PrimaryKey= 'id')
  tDesc$keys[[2]] <- list(PrimaryKey= 'id')
  print(build_join_plan(tDesc))
  DBI::dbDisconnect(my_db)
}


rquery documentation built on Aug. 20, 2023, 9:06 a.m.