No project description provided
Project description
Datalake Loader
Code under lake-loader consumes and transforms data from various online platforms and save them into azure datalake storage.
Runtime Stages
This code has 4 runtime stages: local_local, local_remote, remote_dev, and remote_prod.
Local_Local
This runtime stage uses localhost spark; it consumes data from local kafka and writes the consumed data directly to
console. This runtime setting doesn't rely on any azure computing services. To run this stage, first follow
the README.md file under projects/local-setup to set up local development environment.
Telegram
To run telegram, first copy lake-loader/sample_env_files/local_local.env.sample to lake-loader/.env and modify the
file accordingly. Then, under lake-loader run source .env to export all environmental variables.
Next run the following:
poetry run main telegram
Local_Remote
This runtime stage uses localhost spark that connects to remote kafka and remote adls storage. It consumes data from azure eventhub kafka and writes to azure datalake storage. To run this stage, first obtain azure credentials for eventhub and adls gen 2.
Telegram
To run telegram, first copy lake-loader/sample_env_files/local_remote.env.sample to lake-loader/.env and modify the
file accordingly to fill out missing credentials. Then, under lake-loader run source .env to export all
environmental variables.
Next run the following:
poetry run main telegram
Remote_Dev
This runtime stage runs lake-loader on databricks. First, fill out variables
from lake-loader/sample_env_files/remote_dev.env.sample and then copy the variables to databrick's computing cluster.
See Spark configuration. Next,
run poetry build under lake-loader to build a wheel. The wheel is under lake-loader/dist folder and has the
name lake_loader-x.y-py3-none-any.whl. Next, create and run a
databricks job by uploading the wheel. See the following image to fill out the relevant fields. Note that if a wheel is updated, the old wheel needs to be removed from the computing cluster's libraries.
.
Schema
Spark uses json schema when transforming raw data. The schema generation process is currently outside the lake-loader repo. Using telegram as an example, we first capture a hundred of raw telegram messages. We then use the telegram parser to transform the raw data into gold data. Next, we use spark to read the batch of transformed gold data to infer their schema. The schema is then written to file and dropped off to lake-loader/schema/. When the telegram parser is updated, the schema may also need to be updated (e.g. schema/telegram_v1.json needs to updated to schema/telegram_v2.json.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lake_loader-1.0.20230329232345.tar.gz.
File metadata
- Download URL: lake_loader-1.0.20230329232345.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-35-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff374af7bce373eea8fae9f02dd4dacf4722aa3d13d3bf050ea526b38ed29cdc
|
|
| MD5 |
8d05501cfe08f3495a8e550382ce5db4
|
|
| BLAKE2b-256 |
a6cfeba0b4c1c0d1244afe3874e64e6da35cbe7d38f8c1b8b1d2d7d433fd277c
|
File details
Details for the file lake_loader-1.0.20230329232345-py3-none-any.whl.
File metadata
- Download URL: lake_loader-1.0.20230329232345-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-35-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41bfaabb122d4f317c7b6ecdc930de2855d8196d156f7173128efb26b6f2e9c3
|
|
| MD5 |
e97bf2c27da24a3906d2c85a91132039
|
|
| BLAKE2b-256 |
a4589bed639de81e18cc5e0de8e7a7b7677c62f785d3130f84ae8f46af1e77b7
|