Amazon Parquet data lake

AWS S3 Lambda 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

Below requires a paid tier AWS account[1] and an S3 bucket[2] - else see our guide.

Note

Ensure you test the MF4 decoders with your log files & DBC files locally before proceeding.


1: Upload files to input bucket

  1. Upload your prefixed DBC files (e.g. can1-xyz.dbc) to your bucket root via the S3 console[3]

  2. 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

  1. Open AWS CloudFormation and ensure you are in the same region as your input bucket

  2. Select the stack you used to create your S3 bucket (default name canedge-stack)[5]

  3. Click ‘Stack actions/Create change set for current stack’

  4. 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
  1. Enter a ‘UniqueID’ (e.g. datalake05)[6]

  2. Enter a valid email for notifications on Lambda errors/events[7]

  3. Click ‘Acknowledge’, ‘Submit’, wait ~1 min and click the upper-right refresh

  4. 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

  1. Upload a test MDF file from your CANedge into your input bucket via the S3 console

  2. 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

  1. Verify that your S3 output bucket contains Parquet files

  2. Open AWS Glue Triggers in a new tab

  3. Select the <uniqueid>-map-tables-on-demand trigger and click ‘Action/Start trigger’

  4. 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.