dbplyr Questions

2

Solved

Suppose I have a connection to an external database called con. I would like to use dplyr to reproduce this query SELECT var1, var2, var3 from myTable LIMIT 10 I have tried qry <- tbl(con, ...
Motherinlaw asked 27/10, 2017 at 2:29

1

Solved

I'm trying to connect to Amazon Athena via JDBC and pool: What has worked so far: library(RJDBC) library(DBI) library(pool) library(dplyr) library(dbplyr) drv <- RJDBC::JDBC('com.amazonaws.at...
Syphilis asked 18/6, 2018 at 19:48

1

Solved

I want to add a column to my table using ALTER TABLE and UPDATE statements not to recreate the full table. When using a subquery in my UPDATE statement I don't get the output I expect. build repr...
Galactose asked 18/6, 2018 at 14:48

1

Solved

Here is mtcars data in the MonetDBLite database file. library(MonetDBLite) library(tidyverse) library(DBI) dbdir <- getwd() con <- dbConnect(MonetDBLite::MonetDBLite(), dbdir) dbWriteTable...
Trudytrue asked 8/6, 2018 at 18:59

1

Solved

I have very simple problem that produces error. Example will clear this one. library(odbc) library(DBI) library(dplyr) library(dbplyr) con <- dbConnect(odbc(), "myDSN") tbl_test <- tibble(...
Lutist asked 1/4, 2018 at 11:35

3

I'm using dplyr (0.7.0), dbplyr (1.0.0), DBI 0.6-1, and odbc (1.0.1.9000). I would like to do something like the following: db1 <- DBI::dbConnect( odbc::odbc(), Driver = "SQL Server", Server...
Octagonal asked 22/6, 2017 at 15:26

1

I have extracted data to a temporary table in SQL Server using DBI::dbGetQuery. Even though, in the real query (not the play query below), I select convert(date, date_value) as date_value, the d...
Moffett asked 7/2, 2018 at 0:21

1

The function dbplyr::in_schema() can not connect to tables with uppercase letters. When I create a table in PostgreSQL. CREATE TABLE public."OCLOC" ( cod_ocloc double precision NOT NULL, lab_o...
Pavel asked 20/7, 2017 at 23:14

1

Solved

Say you have your tables stores in an SQL server DB, and you want to perform multi table actions, i.e. join several tables from that same database. Following code can interact and receive data fro...
Harrow asked 24/1, 2018 at 7:42

1

Solved

Let's take a look at the example in ?sql_variant: We define a new translator function for aggregated functions, expanded from the default one: postgres_agg <- sql_translator(.parent = base_agg...
Elementary asked 16/9, 2017 at 10:52

2

Solved

Is there a way to directly get the field names from a tbl_dbi object (db_mtcars below)? library(RSQLite) library(dbplyr) library(dplyr) con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWr...
Titania asked 15/11, 2017 at 19:15

2

Solved

I'm creating a database using R package dbplyr, using RSQLite, but my database is zero-bytes in size on disk despite my writing (and reading back) a table. Here is my script: library("RSQLite") li...
Interoceptor asked 31/10, 2017 at 11:13

1

Solved

Sparklyr fails when using a case_when with external variables. Working Example: test <- copy_to(sc, tibble(column = c(1,2,3,4))) test %>% mutate(group = case_when( column %in% c(1,2) ~ 'g...
Cudlip asked 10/10, 2017 at 23:19

1

Solved

My question is how can I use dplyr functions, such as tbl, on SQL Server tables that do not use the default "dbo" schema? For more context, I am trying to apply the R database example given here t...
Geoid asked 11/7, 2017 at 10:46

1

Solved

I am trying to add a vector which I generated in R to a sqlite table as a new column. For this I wanted to use dplyr (I installed the most recent dev. version along with the dbplyr package accordin...
Merits asked 14/5, 2017 at 19:24

0

Normally we do not find any trouble in using the below connection method and run queries from redshift require("RPostgreSQL") drv <- dbDriver("PostgreSQL") conn <- dbConnect(drv, dbname = "r...
Intellection asked 30/12, 2016 at 2:5

© 2022 - 2024 — McMap. All rights reserved.