Open SimonGoring opened 4 years ago
It's interesting. I'm looking at clean_query()
and it looks like that's the intent of the first `gsub() command:
clean_query <- function(query) {
res <- gsub("^\\/\\/.+$", "\n", query, perl = TRUE)
res <- gsub("\n", " ", res)
res <- gsub("\"", "'", res)
res
}
I think that the fix is to change the first gsub()
to: gsub("//.*", "\n", query, perl = TRUE)
because it's looking for the beginning, not of the line, but of the entire string. . .
I ran into this issue when I was running a fairly long query. The issue seems to be a result of
clean_query()
collapsing the code onto a single line. As a result, it seems like something like this:Which should be valid, fails, because the query turns into:
Maybe comments need to be stripped?