Question 65: You have lot of csv files generated using the log data from your web server all the csv files are having the same schema and stored in an S3 bucket. Now you want to run SQL queries on the data stored in

S3 bucket. Hence, using the AWS Athena you are creating a table on this data. So that you can run SQL query. Which all options are correct for this table creation requirement?

A. You will be creating a Lambda function which will remove all the unwanted files from the bucket.

B. You have to make sure that all the files are in JSON format.

C. You have to make sure that all the files are in XML format.

D. If you are using LOCATION clause then, you will be using trailing slash for your folder or bucket.

E. You have to make sure that CRR (Cross region replication) is enabled for the bucket.

1. A,B

2. B,C

3. C,D

4. A,D

5. A,E

Correct Answer : 4 Exp : As you are using AWS Athena service which can help you to run the SQL queries on the data stored in S3 bucket. For that you dont have to provision any server or infrastructure resources. Its

a server less architecture and you will be charged for running your queries. Amazon Athena is an interactive query service that makes it easy to analyze data directly in Amazon S3 using standard SQL. With a few

actions in the AWS Management Console, you can point Athena at your data stored in Amazon S3 and begin using standard SQL to run ad-hoc queries and get results in seconds.

Athena is serverless, so there is no infrastructure to set up or manage, and you pay only for the queries you run. Athena scales automatically-executing queries in parallel-so results are fast, even with large

datasets and complex queries.

When you create a table for SQL queries:

Table Location in Amazon S3 : When you run a CREATE TABLE query in Athena, you register your table with the data catalog that Athena uses. If you migrated to AWS Glue, this is the catalog from AWS Glue. You also

specify the location in Amazon S3 for your table in this format: s3://bucketname/keyname/.

Use these tips and examples when you specify the location in Amazon S3.

Athena reads all files in an Amazon S3 location you specify in the CREATE TABLE statement, and cannot ignore any files included in the prefix. When you create tables, include in the Amazon S3 path only the files you

want Athena to read. Use AWS Lambda functions to scan files in the source location, remove any empty files, and move unneeded files to another location.

In the LOCATION clause, use a trailing slash for your folder or bucket.

4