Skip to content

Commit fe135bf

Browse files
committed
use specific athena sample data bucket
1 parent 8fc26bb commit fe135bf

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

tuts/061-amazon-athena-gs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This tutorial demonstrates how to get started with Amazon Athena using the AWS CLI. You'll learn the fundamental concepts and operations for working with this AWS service through command-line interface.
44

5+
**Note:** This tutorial uses the `athena-examples-us-east-1` S3 bucket for sample data, which is only available in the us-east-1 region. The tutorial and script have been configured to use this specific bucket regardless of your current AWS region.
6+
57
You can either run the automated script `amazon-athena-gs.sh` to execute all operations automatically with comprehensive error handling and resource cleanup, or follow the step-by-step instructions in the `amazon-athena-gs.md` tutorial to understand each AWS CLI command and concept in detail. The script includes interactive prompts and built-in safeguards, while the tutorial provides detailed explanations of features and best practices.
68

79
## Resources Created

tuts/061-amazon-athena-gs/amazon-athena-gs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ CREATE EXTERNAL TABLE IF NOT EXISTS mydatabase.cloudfront_logs (
142142
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
143143
WITH SERDEPROPERTIES (
144144
"input.regex" = "^(?!#)([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+([^ ]+)\\s+[^\\(]+\\([^\\;]+\\).*\\%20([^\\/]+)[\\/](.*)$"
145-
) LOCATION 's3://athena-examples-${AWS_REGION}/cloudfront/plaintext/';
145+
) LOCATION 's3://athena-examples-us-east-1/cloudfront/plaintext/';
146146
EOF
147147

148148
aws athena start-query-execution \
@@ -174,7 +174,7 @@ TABLE_QUERY="CREATE EXTERNAL TABLE IF NOT EXISTS mydatabase.cloudfront_logs (
174174
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
175175
WITH SERDEPROPERTIES (
176176
\"input.regex\" = \"^(?!#)([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+[^\\\\(]+[\\\\(]([^\\\\;]+).*\\\\%20([^\\\\/]+)[\\\\/](.*)$\"
177-
) LOCATION 's3://athena-examples-$AWS_REGION/cloudfront/plaintext/';"
177+
) LOCATION 's3://athena-examples-us-east-1/cloudfront/plaintext/';"
178178

179179
TABLE_QUERY_ID=$(aws athena start-query-execution \
180180
--query-string "$TABLE_QUERY" \
@@ -227,7 +227,7 @@ The output should include details about your new table:
227227
],
228228
"Parameters": {
229229
"EXTERNAL": "TRUE",
230-
"location": "s3://athena-examples-us-east-2/cloudfront/plaintext"
230+
"location": "s3://athena-examples-us-east-1/cloudfront/plaintext"
231231
// Additional parameters omitted for brevity
232232
}
233233
}

tuts/061-amazon-athena-gs/amazon-athena-gs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ CREATE_TABLE_QUERY="CREATE EXTERNAL TABLE IF NOT EXISTS $DATABASE_NAME.$TABLE_NA
111111
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
112112
WITH SERDEPROPERTIES (
113113
\"input.regex\" = \"^(?!#)([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+([^ ]+)\\\\s+[^\\\\(]+[\\\\(]([^\\\\;]+).*\\\\%20([^\\\\/]+)[\\\\/](.*)$\"
114-
) LOCATION 's3://athena-examples-$AWS_REGION/cloudfront/plaintext/';"
114+
) LOCATION 's3://athena-examples-us-east-1/cloudfront/plaintext/';"
115115

116116
CREATE_TABLE_RESULT=$(aws athena start-query-execution \
117117
--query-string "$CREATE_TABLE_QUERY" \

0 commit comments

Comments
 (0)