An example of Glue schema derivation using Magnolia. The schema is used to create a Glue table + Firehose that converts json into parquet format. Glue/Firehose and other aws resources are created with aws-cdk.
npm install -g aws-cdk
- Init cdk (this action is required only once per account+region). Execute only if nobody used cdk in your aws account.
cdk bootstrap --bootstrap-bucket-name cdk-demo-bootstrap
- See the changes that are going to be applied
cdk diff
- Apply the changes
cdk deploy
- Send a sample event to firehose
sbt "project client" run
- Add partitions to the table
MSCK REPAIR TABLE demo.events;
- Query Athena
SELECT * FROM demo.events limit 10;
- Delete the stack when it is not needed any more
aws s3 rm --recursive s3://demo-purchase-events
cdk destroy