Reputation: 17
I want to create a crawler resource from CFN (Cloudformation).
Here is my code:
Type: AWS::Glue::Crawler
Properties:
Name: !Ref GlueCrawlerName
Role: !GetAtt crawlerRole.Arn
Description: AWS Glue crawler to crawl DLG data
DatabaseName: !Ref GlueDatabaseName
Targets:
S3Targets:
- Path:
!Join
- ''
- - 's3://'
- !Ref s3bucket
- '/'
- !Ref GlueTableName
SchemaChangePolicy:
UpdateBehavior: UPDATE_IN_DATABASE
DeleteBehavior: DEPRECATE_IN_DATABASE
Schedule:
ScheduleExpression: cron(0 1 * * ? 2019)
Everything is alright as expected, only 'Create a single schema for each S3 path' is false. Which property is for this to set to true?
Upvotes: 1
Views: 4196
Reputation: 2144
Do you need one table per subfolder or only one table at the root level of the s3 path?
for single root level table, append following in your CFN:
Configuration: "{\"Version\":1.0,\"Grouping\":{\"TableGroupingPolicy\":\"CombineCompatibleSchemas\"}}"
Upvotes: 3
Reputation: 212
Maybe it will be helpful. As per AWS documentation:
Set the Configuration field with a string representation of the following JSON object in the crawler API:
{
"Version": 1.0,
"Grouping": {
"TableGroupingPolicy": "CombineCompatibleSchemas" }
}
Upvotes: -1