Access and Query Amazon Athena via DBI/JDBC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
730B

  1. context("Driver & queries work")
  2. skip_on_cran()
  3. drv <- metis::Athena()
  4. expect_is(drv, "AthenaDriver")
  5. dbConnect(
  6. drv = drv,
  7. schema_name = "sampledb",
  8. provider = "com.simba.athena.amazonaws.auth.PropertiesFileCredentialsProvider",
  9. AwsCredentialsProviderArguments = path.expand("~/.aws/athenaCredentials.props"),
  10. s3_staging_dir = "s3://aws-athena-query-results-569593279821-us-east-1",
  11. ) -> con
  12. expect_is(con, "AthenaConnection")
  13. expect_equal(dbListTables(con, schema="sampledb"), "elb_logs")
  14. expect_true(dbExistsTable(con, "elb_logs", schema="sampledb"))
  15. expect_true("url" %in% dbListFields(con, "elb_logs", "sampledb"))
  16. expect_is(
  17. dbGetQuery(con, "SELECT * FROM sampledb.elb_logs LIMIT 10"),
  18. "data.frame"
  19. )