Access and Query Amazon Athena via DBI/JDBC
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

58 Zeilen
2.2KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/metis.r
  3. \name{athena_connect}
  4. \alias{athena_connect}
  5. \title{Simplified Athena JDBC connection helper}
  6. \usage{
  7. athena_connect(default_schema = "default", region = c("us-east-1",
  8. "us-east-2", "us-west-2"),
  9. s3_staging_dir = Sys.getenv("AWS_S3_STAGING_DIR"),
  10. max_error_retries = 10, connection_timeout = 10000,
  11. socket_timeout = 10000, log_path = "", log_level = c("OFF",
  12. "FATAL", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE"), ...)
  13. }
  14. \arguments{
  15. \item{default_schema}{default schema (you'll still need to fully qualify non-default schema table names)}
  16. \item{region}{AWS region (Ref: \url{http://docs.aws.amazon.com/general/latest/gr/rande.html#athena})}
  17. \item{s3_staging_dir}{the Amazon S3 location to which your query output is written. The JDBC driver then asks Athena to read the results and provide rows of data back to the user.}
  18. \item{max_error_retries}{the maximum number of retries that the JDBC client attempts to make a request to Athena.}
  19. \item{connection_timeout}{the maximum amount of time, in milliseconds, to make a successful connection to Athena before an attempt is terminated.}
  20. \item{socket_timeout}{the maximum amount of time, in milliseconds, to wait for a socket in order to send data to Athena.}
  21. \item{log_path}{local path of the Athena JDBC driver logs. If no log path is provided, then no log files are created.}
  22. \item{log_level}{log level of the Athena JDBC driver logs. Use names
  23. "OFF", "FATAL", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE".}
  24. \item{...}{passed on to the driver}
  25. }
  26. \description{
  27. Handles the up-front JDBC config
  28. }
  29. \examples{
  30. \dontrun{
  31. use_credentials("personal")
  32. athena_connect(
  33. default_schema = "sampledb",
  34. s3_staging_dir = "s3://accessible-bucket",
  35. log_path = "/tmp/athena.log",
  36. log_level = "DEBUG"
  37. ) -> ath
  38. dbListTables(ath)
  39. dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 1")
  40. }
  41. }
  42. \references{
  43. \href{https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html}{Connect with JDBC};
  44. \href{https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC_2.0.6/docs/Simba+Athena+JDBC+Driver+Install+and+Configuration+Guide.pdf}{Simba Athena JDBC Driver with SQL Connector Installation and Configuration Guide}
  45. }