7/24/2023 0 Comments Datagrid jetbrainsNote: Every time you run a query against Athena which requires it to process data, you will pay for it. SELECT * FROM "default"."elb_logs" limit 10 Now, let’s pull some data from it using this query: If you selected that this connection is a read-only one, you’d need to confirm you want to execute this query. Select the whole query and press Ctrl/Cmd+Enter. If you decide to a different data source, such as your own data in an S3 bucket your account has access to, make sure you also allow Athena to query the data as explained in the official documentation.įirst, run this query to create the table that we’ll use: CREATE EXTERNAL TABLE IF NOT EXISTS default.elb_logs ( For this, we’ll use the AWS Athena sample data for AWS ELB logs. Let’s run a few sample queries to see how everything. This means you configured everything correctly and you can now connect to AWS Athena.Ĭlose the window by pressing the OK button, and now you’ll be presented with a database console ready for use. Go back to the General tab and click on the Test Connection button and you should see a “ Successful” message. By default, Athena will save this under a location similar to “ s3://aws-athena-query-results-YourAWSAccountID-eu-west-1/” but you can find yours via the Settings section in the Athena Console. You can also mark the connection as Read-only since Athena does not support modifying data on the S3 buckets it queries.Ĭlick on the Advanced tab and type in the location of where the query results will be saved. In the Host field introduce the AWS region you want to make the queries from, “ eu-west-1”, in the User section add your AWS Access Key Id, “ AKIA…”, and in the Password field the AWS Secret Access Key, “ Go2018…”. Since the driver is now configured, you can go to the “+” sign at the top left of the Data Sources and Drivers window and select “ Athena” as a driver. Click on the “+” button under the URL templates section and add a new entry named default with the value: In order for the IDE to connect to Athena, we can also define a connection URL template. In the Dialect drop-down, select Generic SQL. New options should now be available under the Class drop-down, select “ 42.Driver” from it. ![]() Once you downloaded the driver, go back to the IDE, and in the Additional files section, click on “+” and add the file we’ve just downloaded. As our IDEs work on JDK 8, you can download the corresponding jar file, at the time of writing is “ AthenaJDBC42-2.0.2.jar”. Here you can import custom JDBC drivers to expand the IDE connectivity capabilities.ĪWS provides a JDBC driver for use with Java, which you can download from this page. You will notice that there is a section called Driver files. Start by changing the name of the configuration to “ Athena”. ![]() Head towards the Database Tool Window, then select Data Source Properties, click on the “+” button and then, at the bottom of the list you’ll see an entry named Driver, click on this. To do this, we’ll first need to do some configuration to connect the IDE with Athena. So how to access this data straight from the IDE? Amazon offers Athena, a service built on Presto, and allows you to query this S3 data using ANSI SQL syntax. If you use the AWS cloud, then you probably store data on their S3 platform, either for your application data or in the form of logs from services like the AWS Elastic Load Balancing.
0 Comments
Leave a Reply. |