@@ -11,10 +11,10 @@ branch_install()
1111
1212header <- paste0(" # Generated by 60-touchstone-gen.R, " , " do not edit by hand\n\n " )
1313
14- body <- function (sf , test ) paste0 (' benchmark_run(
15- expr_before_benchmark = {
14+ body <- function (sf , test , n ) glue :: glue (' benchmark_run(
15+ expr_before_benchmark = {{
1616 library(duckplyr)
17- data <- qs::qread("tools/tpch/' , sf , ' .qs")
17+ data <- qs::qread("tools/tpch/{sf} .qs")
1818 .mapply(assign, list(names(data), data), list(pos = .GlobalEnv))
1919
2020 customer <- as_duckplyr_df(customer)
@@ -25,24 +25,22 @@ body <- function(sf, test) paste0('benchmark_run(
2525 partsupp <- as_duckplyr_df(partsupp)
2626 region <- as_duckplyr_df(region)
2727 supplier <- as_duckplyr_df(supplier)
28- },
29- `' , sf , ' _tpch_' , test , ' ` = collect(duckplyr:::tpch_' , test , ' ()),
30- n = 30
28+ }} ,
29+ `{sf} _tpch_{ test} ` = collect(duckplyr:::tpch_' , test , ' ()),
30+ n = {n}
3131)\n\n ' )
3232
3333footer <- ' benchmark_analyze()'
3434
3535bodies <-
3636 crossing(
37- sf = c(" 001" , " 010" ),
38- test = c(" 01" , " 02" , " 03" ),
39- # sf = c("001", "010", "100"),
40- # test = c("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22"),
37+ tibble(n = c(3 , 10 , 30 ), sf = c(" 100" , " 010" , " 001" )),
38+ test = c(" 01" , " 02" , " 03" , " 04" , " 05" , " 06" , " 07" , " 08" , " 09" , " 10" , " 11" , " 12" , " 13" , " 14" , " 15" , " 16" , " 17" , " 18" , " 19" , " 20" , " 21" , " 22" ),
4139 ) | >
4240 rowwise() | >
43- mutate(code = body(sf , test )) | >
41+ mutate(code = body(sf , test , n )) | >
4442 ungroup() | >
45- summarize(code = paste(code , collapse = " " )) | >
43+ summarize(code = paste(code , collapse = " \n " )) | >
4644 pull(code )
4745
4846code <- paste0(
0 commit comments