Amazon Parquet data lake
Here we explain how to deploy an Amazon Parquet data lake with automation and an interface.
This can e.g. be used in Grafana-Athena dashboards or Python/MATLAB scripts.
Overview
This guide lets you set up an automated data pre-processing workflow, including:
An ‘input bucket’ (for MDF/DBC files) and ‘output bucket’ (for Parquet files)
A ‘Lambda function’ (DBC decodes new MDF files and outputs them as Parquet files)
An ‘Athena’ SQL interface for querying the data lake (e.g. from Grafana)
Three ‘support Glue jobs’ (map data lake, process MDF backlogs, summarize trips)
Note
Ensure you test the MF4 decoders with your log files & DBC files locally before proceeding.
1: Upload files to input bucket
Upload your prefixed DBC files (e.g.
can1-xyz.dbc) to your bucket root via the S3 console[3]Upload below 4 files[4] (zip file and Python scripts) to your bucket root
Lambda zip | Mapping script | Backlog script | Aggregation script
2: Deploy integration
Open AWS CloudFormation and ensure you are in the same region as your input bucket
Select the stack you used to create your S3 bucket (default name
canedge-stack)[5]Click ‘Stack actions/Create change set for current stack’
Click ‘Replace current template’ and enter below:
https://css-electronics-resources.s3.eu-central-1.amazonaws.com/stacks/data-lake-v4.2.1-vG.6.0.json
Enter a ‘UniqueID’ (e.g.
datalake05)[6]Enter a valid email for notifications on Lambda errors/events[7]
Click ‘Acknowledge’, ‘Submit’, wait ~1 min and click the upper-right refresh
Click ‘Execute change set’ (and click it again in the popup), then wait ~1 min
Note
If the deployment fails, double check that you uploaded the zip/scripts to your S3 input bucket
Note
If you later need to update the integration with a new revision, see this guide
3: Test your cloud function
Upload a test MDF file from your CANedge into your input bucket via the S3 console
Verify that the decoded Parquet files are created in your output bucket[8]
Your data lake will now get auto-filled when new MDF files are uploaded to the input bucket.
Note
If you are not seeing the expected results, review the Lambda CloudWatch logs
4: Map your Parquet data lake to tables
Verify that your S3 output bucket contains Parquet files
Open AWS Glue Triggers in a new tab
Select the
<uniqueid>-map-tables-on-demandtrigger and click ‘Action/Start trigger’Open the trigger target Glue job, click ‘Runs’ and verify that it succeeds[10]
Note
Glue adds ‘meta data’ about your S3 output bucket. If new devices/messages are added to your Parquet data lake, the Glue job should be triggered again (manually or by schedule)[9]
You can now use Athena as a data source in e.g. Grafana-Athena dashboards. See also the advanced topics to learn about backlog processing, event detection, trip summaries and more.