Fix literal string arguments in paste()
Closed this issue · 1 comments
ianmcook commented
The following fails because dbplyr does not quote the literal strings in the SQL:
tbl(impala, "flights") %>%
transmute(date = paste0(
as.character(year),
"-",
lpad(as.character(month), 2L, "0"),
"-",
lpad(as.character(day), 2L, "0")
)
)
I believe this is a dbplyr issue, but need to check and create a reproducible example. Note that you can't use SQLite to create an easily reproducible example because SQLite uses an infix operator for concatenation.
The workaround is to wrap the literal strings in parens: ("-")