-
Notifications
You must be signed in to change notification settings - Fork 0
/
athena-prepared-statements.yaml
88 lines (88 loc) · 2.76 KB
/
athena-prepared-statements.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
S3QueryResultsBucketName:
Type: String
Description: Amazon S3 bucket name for storing Amazon Athena query results
AthenaWorkGroupName:
Type: String
Description: (Can be left as default) Amazon Athena WorkGroup name
Default: "PreparedStatementsWG"
Resources:
AthenaWorkGroup:
Type: AWS::Athena::WorkGroup
Properties:
Name: !Ref AthenaWorkGroupName
State: ENABLED
RecursiveDeleteOption: true
WorkGroupConfiguration:
EnforceWorkGroupConfiguration: True
EngineVersion:
SelectedEngineVersion: AUTO
ResultConfiguration:
EncryptionConfiguration:
EncryptionOption: SSE_S3
OutputLocation: !Sub s3://${S3QueryResultsBucketName}/results/
GlueDatabase:
Type: AWS::Glue::Database
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseInput:
Name: athena_prepared_statements
GlueTableAmazonReviews:
Type: AWS::Glue::Table
Properties:
DatabaseName: !Ref GlueDatabase
CatalogId: !Ref AWS::AccountId
TableInput:
Name: amazon_reviews_parquet
Parameters:
EXTERNAL: 'TRUE'
PartitionKeys:
- Name: product_category
Type: string
StorageDescriptor:
BucketColumns: []
Columns:
- Name: marketplace
Type: string
- Name: customer_id
Type: string
- Name: review_id
Type: string
- Name: product_id
Type: string
- Name: product_title
Type: string
- Name: star_rating
Type: bigint
- Name: helpful_votes
Type: bigint
- Name: total_votes
Type: bigint
- Name: insight
Type: string
- Name: review_headline
Type: string
- Name: review_body
Type: string
- Name: review_date
Type: bigint
- Name: review_year
Type: bigint
Compressed: false
InputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat
Location: s3://aws-bigdata-blog/generated_synthetic_reviews/data/
NumberOfBuckets: -1
OutputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat
Parameters: {}
SerdeInfo:
Parameters:
serialization.format: '1'
SerializationLibrary: org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe
SkewedInfo:
SkewedColumnNames: []
SkewedColumnValueLocationMaps: {}
SkewedColumnValues: []
SortColumns: []
StoredAsSubDirectories: false
TableType: EXTERNAL_TABLE