RAthena | Connect R to Athena using Boto3 SDK | AWS library

 by   DyfanJones R Version: v2.6.1 License: Non-SPDX

kandi X-RAY | RAthena Summary

kandi X-RAY | RAthena Summary

RAthena is a R library typically used in Cloud, AWS, Amazon S3 applications. RAthena has no bugs, it has no vulnerabilities and it has low support. However RAthena has a Non-SPDX License. You can download it from GitHub.

The goal of the RAthena package is to provide a DBI-compliant interface to Amazon’s Athena (using Boto3 SDK. This allows for an efficient, easy setup connection to Athena using the Boto3 SDK as a driver.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              RAthena has a low active ecosystem.
              It has 30 star(s) with 5 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 49 have been closed. On average issues are closed in 37 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of RAthena is v2.6.1

            kandi-Quality Quality

              RAthena has no bugs reported.

            kandi-Security Security

              RAthena has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              RAthena has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              RAthena releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of RAthena
            Get all kandi verified functions for this library.

            RAthena Key Features

            No Key Features are available at this moment for RAthena.

            RAthena Examples and Code Snippets

            RAthena,Usage,Tidyverse Usage
            Rdot img1Lines of Code : 94dot img1License : Non-SPDX (NOASSERTION)
            copy iconCopy
            library(DBI)
            library(dplyr)
            
            con <- dbConnect(RAthena::athena(),
                            aws_access_key_id='YOUR_ACCESS_KEY_ID',
                            aws_secret_access_key='YOUR_SECRET_ACCESS_KEY',
                            s3_staging_dir='s3://path/to/query/bucket/',
               
            RAthena,Work Groups
            Rdot img2Lines of Code : 78dot img2License : Non-SPDX (NOASSERTION)
            copy iconCopy
            library(RAthena)
            library(DBI)
            
            con <- dbConnect(RAthena::athena(),
                            profile_name = "your_profile",
                            encryption_option = "SSE_S3",
                            s3_staging_dir='s3://path/to/query/bucket/')
            
            create_work_group(con, "d  
            RAthena,Usage,Intermediate Usage
            Rdot img3Lines of Code : 25dot img3License : Non-SPDX (NOASSERTION)
            copy iconCopy
            query <- 
              "CREATE EXTERNAL TABLE impressions (
                  requestBeginTime string,
                  adId string,
                  impressionId string,
                  referrer string,
                  userAgent string,
                  userCookie string,
                  ip string,
                  number string,
                  proce  

            Community Discussions

            QUESTION

            SQL query output as a dataframe in R
            Asked 2021-Jan-13 at 15:25

            I am very new to R. I wanted to use a sql query to get data with R. (I am using athena but I think this doesn't matter).

            ...

            ANSWER

            Answered 2021-Jan-13 at 15:25

            You can use function dbGetQuery from package DBI

            From documentation:

            Description Returns the result of a query as a data frame. dbGetQuery() comes with a default implementation (which should work with most backends) that calls dbSendQuery(), then dbFetch(), ensuring that the result is always free-d by dbClearResult().

            Implemantation from your example:

            Source https://stackoverflow.com/questions/65704799

            QUESTION

            Error in value[[3L]](cond) : No region provided (Package noctua)
            Asked 2020-Nov-07 at 13:19

            I am making a shinydashboard app in R. I wanted to make an app that withdraws data from a database in AWS Athena every time it is deployed and display a DT table in my shiny app that gives you the option to see the information based on what date ranges you select in dateInputRange.

            I needed an R package for this so I used RAthena I also used the packages DBI for the AWS CLI and paws. I downloaded all what I needed for this like boto3 and so forth. I also made a aws profile that contained all important information like secret key, region, path to bucket etc. Anyways I established a connection to the database and locally I was able to withdraw information from the database. My app was running fine locally. However the app when uploaded to shiny app io and deployed a second time it would not show updated dates in table. I thought this might be due to how I set up the scripts in my app. It now contains three scripts only ui.R, server.R and a global.R However after I did this I kept getting the error:

            Error: Boto3 is not detected please install boto3 using either: pip install boto3 in terminal or install_boto(). Alternatively reticulate::use_python or reticulate::use_condaenv will have to be used if boto3 is in another environment.

            So I did as the error said to and I added:reticulate::use_virtualenv("RAthena") to my global.R script where all data withdrawals and calculations are done. Here is the stack overflow answer. After I did this I got the error:

            Error: Unable to find conda binary. Is Anaconda installed?

            I decided to try then reticulate::use_condaenv("RAthena") I then simply got the boto3 error again. The annoying part is I have checked in my terminal and Boto3 is successfully installed. I also have Anaconda installed I even updated Boto3.

            I saw from the answer that it is possible to use noctau to establish a database connection. I did this and everything worked fine locally. I was able to withdraw data from the database. Of course when I deployed this to shiny app io I got the error

            Error in value[3L] : No region provided

            I don't know why I have this error. In my aws profile my region for the database is specified. In R studio I see it in the connections tab in the right hand corner. With the code dbGetInfo(con) I see it there as well. I don't know what the solution is.

            ...

            ANSWER

            Answered 2020-Nov-07 at 13:19

            For RAthena it appears shinyapp.io is having difficulty setting up your environment. This tutorial may help solve the RAthena problem. Tutorial: using Shiny + reticulate to create apps with R and Python 3

            For noctua, it looks like it is having difficulty getting your aws credentials when on shinyapp.io server. When setting up the shinyapp.io how have you set up your credentials for AWS? Are you using environmental variables or are you using .aws/credentails and .aws/config files?

            You might want to consider the config package recommended in the shinyapps.io user guide book: https://docs.rstudio.com/shinyapps.io/applications.html#config-package

            Here is an example of how to set it up.

            Setting up config.yml

            Source https://stackoverflow.com/questions/64699108

            QUESTION

            Problems with deployment of shiny app due to reticulate_python
            Asked 2020-Oct-09 at 06:33

            I have an app that I want to deploy on shinyapps.io. I think it is important to note that in the app data is extracted from a database in athena. I used the package Rathena to connect to the database and everything used to run fine locally from my computer. However I tried to deploy it on shinyapps.io and I get a message that an error has occurred. I see this simply in the window that pops up after I deployed it. I went and looked at the log section from shinyapps.io and I see the message that says:

            warning: using reticulate but python was not specified; will use python at /usr/bin/python3 Did you forget to set the RETICULATE_PYTHON environment variable in your .Rprofile before publishing?

            I have never used an .Rprofile and I don't know what it means by RETICULATE_PYTHON. Anyways they say on stack overflow google is your best friend. I found this tutorial on Github called Tutorial: using Shiny + reticulate to create apps with R and Python 3. I did the initial steps like it says to and then it says at the end:

            Confirm that the .Rprofile file is included in your project's directory and was deployed along with server.R and ui.R to shinyapps.io. This file sets the RETICULATE_PYTHON environment variable, which tells reticulate where to locate the Python virtual environment on the shinyapps.io servers.

            I looked up what .Rprofile is and I think it's just a script for code but It doesn't tell me what code I should put there. I think I need to mention that package Rathena uses Python code to connect to the database.

            I also read somewhere that I should place this line RETICULATE_PYTHON = /usr/local/bin/python3 in my .Renviron file. I did this and now when I try to run the app locally on my computer I get the error message:

            Error: Boto3 is not detected please install boto3 using either: pip install boto3 numpy in terminal or install_boto(). If this doesn't work please set the python you are using with reticulate::use_python() or reticulate::use_condaenv()

            This doesn't make sense because I already have installed boto3 and even in the terminal it says

            Requirement already satisfied: boto3 in ./Library/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (1.14.28)

            I feel like I am going in circles here.

            ...

            ANSWER

            Answered 2020-Oct-09 at 06:33

            This is actually a fairly annoying problem with running software locally and running in another environment and I'd say solutions are generally non-obvious. You probably aren't the first person to run into this.

            Here are some facts that I think are relevant:

            • reticulate needs to know where your Python executable is on the computer
            • The locatl of the Python executable differs between your computer and the virtual computer shinyapps.io runs your Shiny app from
            • reticulate seems to determine where your Python executable is from the RETICULATE_PYTHON environment variable but also has some default behavior when the variable isn't set
            • The Python executable on your computer is at a different location than the executable on the virtual computer shinyapps.io runs your Shiny app from
            • When you set the value of RETICULATE_PYTHON in your .Rprofile to the value shinyapps.io needs, your setup breaks because your Python environment is different

            I haven't tested this as a solution but I think the fix is actually in your link! Check out https://github.com/ranikay/shiny-reticulate-app/blob/master/.Rprofile and see how they include a bit more than just a simple assignment of a value to RETICULATE_PYTHON and actually use conditional statements to set various values depending on the result of (Sys.info()[['user']].

            The value of (Sys.info()[['user']] will differ based upon whether R executes .Rprofile on your local computer versus the virtual computer shinyapps.io runs your Shiny app on and the linked .Rprofile is doing the work of setting up various values based upon whether R is running on your local computer or on another computer. This all works because shinyapps.io

            From the code in the .Rprofile, I can tell that shinyapps.io runs your Shiny app under the user named "shiny",

            Source https://stackoverflow.com/questions/64221199

            QUESTION

            In R, Error for No Boto3 to connect Athena even though Boto3 Installed
            Asked 2020-Apr-17 at 10:44

            I am trying to connect to Athena from R. After setup 'RAthena' and connection, I got this error:

            ...

            ANSWER

            Answered 2020-Apr-17 at 10:44

            really sorry to hear you are having issue with the RAthena package. Can you let me know what version of the package you are running.

            Have you tried setting which python you are using through reticulate? For example:

            Source https://stackoverflow.com/questions/61256653

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install RAthena

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular AWS Libraries

            localstack

            by localstack

            og-aws

            by open-guides

            aws-cli

            by aws

            awesome-aws

            by donnemartin

            amplify-js

            by aws-amplify

            Try Top Libraries by DyfanJones

            noctua

            by DyfanJonesR

            s3fs

            by DyfanJonesR

            sagemaker-r-sdk

            by DyfanJonesR

            connectR

            by DyfanJonesR

            sagemaker-r-common

            by DyfanJonesR