inspectDescrAndJoinPlan: check that a join plan is consistent with table descriptions

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
2
inspectDescrAndJoinPlan(tDesc, columnJoinPlan, ...,
  checkColClasses = FALSE)

Arguments

tDesc

description of tables, from tableDescription (and likely altered by user).

columnJoinPlan

columns to join, from buildJoinPlan (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.

checkColClasses

logical if true check for exact class name matches

Value

NULL if okay, else a string

See Also

tableDescription, buildJoinPlan, makeJoinDiagramSpec, executeLeftJoinPlan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# example data
d1 <- data.frame(id= 1:3,
                 weight= c(200, 140, 98),
                 height= c(60, 24, 12))
d2 <- data.frame(pid= 2:3,
                 weight= c(130, 110),
                 width= 1)
# get the initial description of table defs
tDesc <- rbind(tableDescription('d1', d1),
               tableDescription('d2', d2))
# declare keys (and give them consistent names)
tDesc$keys[[1]] <- list(PrimaryKey= 'id')
tDesc$keys[[2]] <- list(PrimaryKey= 'pid')
# build the join plan
columnJoinPlan <- buildJoinPlan(tDesc)
# confirm the plan
inspectDescrAndJoinPlan(tDesc, columnJoinPlan,
                        checkColClasses= TRUE)
# damage the plan
columnJoinPlan$sourceColumn[columnJoinPlan$sourceColumn=='width'] <- 'wd'
# find a problem
inspectDescrAndJoinPlan(tDesc, columnJoinPlan,
                        checkColClasses= TRUE)

replyr documentation built on Nov. 1, 2019, 7:49 p.m.