~hrbrmstr/sergeant

77e7781e2d2f5aeb18a196aaf167d2e7feac2632 — boB Rudis 3 years ago d749a1a
one more travis go
6 files changed, 15 insertions(+), 33 deletions(-)

M .travis.yml
M R/dbi.r
M R/dplyr.r
D man/cmake_server.Rd
M man/src_tbls.Rd
M tests/testthat/test-sergeant.R
M .travis.yml => .travis.yml +5 -5
@@ 13,17 13,17 @@ before_install:
  - "sudo apt-get update -qq"
  - "sudo apt-get install -y zookeeper-server"
  - "curl -o apache-drill-1.10.0.tar.gz http://apache.mirrors.hoobly.com/drill/drill-1.10.0/apache-drill-1.10.0.tar.gz"
  - "sudo mkdir -p /usr/local"
  - "sudo chown 777 /usr/local"
  - "tar -xvzf apache-drill-1.10.0.tar.gz -C /usr/local"
  - "sudo mkdir -p /tmp/local"
  - "sudo chown 777 /tmp/local"
  - "tar -xvzf apache-drill-1.10.0.tar.gz -C /tmp/local"

before_script:
  - "sudo service zookeeper-server init"
  - "sudo service zookeeper-server start"
  - "/usr/local/apache-drill-1.10.0/drillbit.sh start"
  - "/tmp/local/apache-drill-1.10.0/drillbit.sh start"

after_script:
  - "/usr/local/apache-drill-1.10.0/drillbit.sh stop"
  - "/tmp/local/apache-drill-1.10.0/drillbit.sh stop"
  - "sudo service zookeeper-server stop"

r:

M R/dbi.r => R/dbi.r +1 -1
@@ 77,7 77,7 @@ setClass(
  )
)

#' Create the drill server connection string
# Create the drill server connection string
cmake_server <- function(conn) {
  sprintf("%s://%s:%s", ifelse(conn@ssl[1], "https", "http"), conn@host, conn@port)
}

M R/dplyr.r => R/dplyr.r +1 -1
@@ 76,7 76,7 @@ sql_escape_ident.DrillConnection <- function(con, x) {
#' @rdname src_tbls
#' @keywords internal
#' @export
copy_to.src_drill <- function(dest, df) {
copy_to.src_drill <- function(dest, df, name, overwrite, ...) {
  stop("Not implemented.", call.=FALSE)
}


D man/cmake_server.Rd => man/cmake_server.Rd +0 -11
@@ 1,11 0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbi.r
\name{cmake_server}
\alias{cmake_server}
\title{Create the drill server connection string}
\usage{
cmake_server(conn)
}
\description{
Create the drill server connection string
}

M man/src_tbls.Rd => man/src_tbls.Rd +1 -1
@@ 17,7 17,7 @@

\method{sql_escape_ident}{DrillConnection}(con, x)

\method{copy_to}{src_drill}(dest, df)
\method{copy_to}{src_drill}(dest, df, name, overwrite, ...)

\method{db_explain}{DrillConnection}(con, sql, ...)


M tests/testthat/test-sergeant.R => tests/testthat/test-sergeant.R +7 -14
@@ 2,22 2,15 @@ context("basic functionality")
test_that("we can do something", {

  testthat::skip_on_cran()
  testthat::skip_on_travis()
#  testthat::skip_on_travis()

  ds <- src_drill("drillex")
  db <- tbl(ds, "cp.`employee.json`")
  src_drill("localhost") %>%
    tbl("cp.`employee.json`") -> test_dplyr

  count(db, gender, marital_status) %>%
    collect() -> res
  drill_connection("localhost") %>%
    drill_query("SELECT * FROM cp.`employee.json` limit 10") -> test_rest

  expect_that(res, is_a("data.frame"))

  dc <- drill_connection("drillex")
  expect_equal(drill_active(dc), TRUE)

  #con <- drill_jdbc("drill1:2181", "jla")
  con <- drill_jdbc("localhost:31010", use_zk=FALSE)
  res <- drill_query(con, "SELECT * FROM cp.`employee.json`")
  expect_that(res, is_a("data.frame"))
  expect_that(test_dplyr, is_a("tbl"))
  expect_that(test_rest, is_a("data.frame"))

})