dbplyr needs to use a session-local temporary table name (only one #) instead of two (##) that creates a global temporary table. See Hadley's comments: https://community.rstudio.com/t/controlling-names-of-temporary-dbplyr-tables/54403/2