# NOT RUN {
# note: employeeanddate is likely built as a cross-product
# join of an employee table and set of dates of interest
# before getting to the join controller step. We call
# such a table "row control" or "experimental design."
my_db <- dplyr::src_sqlite(":memory:",
create = TRUE)
tDesc <- replyr:::example_employeeAndDate(my_db)
columnJoinPlan <- buildJoinPlan(tDesc, check= FALSE)
# unify keys
columnJoinPlan$resultColumn[columnJoinPlan$resultColumn=='id'] <- 'eid'
# look at plan defects
print(paste('problems:',
inspectDescrAndJoinPlan(tDesc, columnJoinPlan)))
# fix plan
if(requireNamespace('igraph', quietly = TRUE)) {
sorted <- topoSortTables(columnJoinPlan, 'employeeanddate')
print(paste('problems:',
inspectDescrAndJoinPlan(tDesc, sorted$columnJoinPlan)))
# plot(sorted$dependencyGraph)
}
DBI::dbDisconnect(my_db$con)
my_db <- NULL
# }
Run the code above in your browser using DataLab