Does Drill's REST API support session settings?
Created by: detroyejr
I'm running into an issue where session settings don't see to stick when they're submitted through sergeant. The problem seems to be with the REST api itself, not with sergeant.
Here's an example:
# Packages
library(sergeant)
#> Loading required package: DBI
#> Loading required package: dplyr
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
#> Loading required package: dbplyr
#>
#> Attaching package: 'dbplyr'
#> The following objects are masked from 'package:dplyr':
#>
#> ident, sql
# Connect to Drill.
con <- drill_connection()
# Alternatively with drill_use.
drill_use(con, "dfs.tmp")
#> Parsed with column specification:
#> cols(
#> summary = col_character(),
#> ok = col_character()
#> )
#> Default schema changed to [dfs.tmp]true
drill_query(con, "CREATE TABLE employee as SELECT * FROM cp.`employee.json`")
#> Query ==> CREATE TABLE employee as SELECT * FROM cp.`employee.json`
#> VALIDATION ERROR: Root schema is immutable. Creating or dropping tables/views is not allowed in root schema.Select a schema using 'USE schema' command.
#>
#>
#> [Error Id: d4d341b3-07da-4562-813e-67f0ef89c028 on DESKTOP-73M5KKL.mshome.net:31010]
devtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R version 3.4.3 (2017-11-30)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United States.1252
#> tz America/New_York
#> date 2018-03-01
#> Packages -----------------------------------------------------------------
#> package * version date source
#> assertthat 0.2.0 2017-04-11 CRAN (R 3.4.3)
#> backports 1.1.2 2017-12-13 CRAN (R 3.4.3)
#> base * 3.4.3 2017-12-06 local
#> bindr 0.1 2016-11-13 CRAN (R 3.4.3)
#> bindrcpp 0.2 2017-06-17 CRAN (R 3.4.3)
#> colorspace 1.3-2 2016-12-14 CRAN (R 3.4.3)
#> compiler 3.4.3 2017-12-06 local
#> curl 3.1 2017-12-12 CRAN (R 3.4.3)
#> datasets * 3.4.3 2017-12-06 local
#> DBI * 0.7 2017-06-18 CRAN (R 3.4.3)
#> dbplyr * 1.2.1 2018-02-19 CRAN (R 3.4.3)
#> devtools 1.13.5 2018-02-18 CRAN (R 3.4.3)
#> digest 0.6.15 2018-01-28 CRAN (R 3.4.3)
#> dplyr * 0.7.4 2017-09-28 CRAN (R 3.4.3)
#> evaluate 0.10.1 2017-06-24 CRAN (R 3.4.3)
#> glue 1.2.0 2017-10-29 CRAN (R 3.4.3)
#> graphics * 3.4.3 2017-12-06 local
#> grDevices * 3.4.3 2017-12-06 local
#> hms 0.4.1 2018-01-24 CRAN (R 3.4.3)
#> htmltools 0.3.6 2017-04-28 CRAN (R 3.4.3)
#> httr 1.3.1 2017-08-20 CRAN (R 3.4.3)
#> jsonlite 1.5 2017-06-01 CRAN (R 3.4.3)
#> knitr 1.20 2018-02-20 CRAN (R 3.4.3)
#> magrittr 1.5 2014-11-22 CRAN (R 3.4.3)
#> memoise 1.1.0 2017-04-21 CRAN (R 3.4.3)
#> methods * 3.4.3 2017-12-06 local
#> munsell 0.4.3 2016-02-13 CRAN (R 3.4.3)
#> pillar 1.1.0 2018-01-14 CRAN (R 3.4.3)
#> pkgconfig 2.0.1 2017-03-21 CRAN (R 3.4.3)
#> plyr 1.8.4 2016-06-08 CRAN (R 3.4.3)
#> purrr 0.2.4 2017-10-18 CRAN (R 3.4.3)
#> R6 2.2.2 2017-06-17 CRAN (R 3.4.3)
#> Rcpp 0.12.15 2018-01-20 CRAN (R 3.4.3)
#> readr 1.1.1 2017-05-16 CRAN (R 3.4.3)
#> rlang 0.2.0 2018-02-20 CRAN (R 3.4.3)
#> rmarkdown 1.8 2017-11-17 CRAN (R 3.4.3)
#> rprojroot 1.3-2 2018-01-03 CRAN (R 3.4.3)
#> scales 0.5.0 2017-08-24 CRAN (R 3.4.3)
#> sergeant * 0.5.2 2017-07-17 CRAN (R 3.4.3)
#> stats * 3.4.3 2017-12-06 local
#> stringi 1.1.6 2017-11-17 CRAN (R 3.4.2)
#> stringr 1.3.0 2018-02-19 CRAN (R 3.4.3)
#> tibble 1.4.2 2018-01-22 CRAN (R 3.4.3)
#> tools 3.4.3 2017-12-06 local
#> utils * 3.4.3 2017-12-06 local
#> withr 2.1.1 2017-12-19 CRAN (R 3.4.3)
#> yaml 2.1.16 2017-12-12 CRAN (R 3.4.3)
One workaround is to reference cp.tmp.employee
directly when creating the table, but this makes drill_use
not very useful.
Created on 2018-03-01 by the reprex package (v0.2.0).