| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Before runing this script, ensure you have the following installed.
Note: The project was setup on Ubuntu 22.04 OS.
$ git clone https://github.com/VuBacktracking/stream-data-processing.git
$ cd stream-data-processing$ sudo service docker start
$ docker compose -f storage-docker-compose.yaml -f stream-docker-compose.yaml up -d$ python3 -m venv .venv
$ pip install -r requirements.txtCreate .env file and paste your MINIO keys, SPARK_HOME in it.
# MinIO
- MINIO_ACCESS_KEY='minio_access_key'
- MINIO_SECRET_KEY='minio_secret_key'
- MINIO_ENDPOINT='http://localhost:9000'
- BUCKET_NAME='datalake'
# Postgres SQL
- POSTGRES_DB='v9'
- POSTGRES_USER='v9'
- POSTGRES_PASSWORD='v9'
# Spark
- SPARK_HOME=""cd debezium
bash run-cdc.sh register_connector conf/products-cdc-config.jsonYou should see the connection is running like the image below in the port http://localhost:8085.
python3 database-operations/create_table.py
python3 database-operations/insert_table.pyIn the PostgreSQL connection, you should see the database v9 and the table products like the image below.
python3 stream_processing/delta-to-minio.pyAfter putting data to MinIO storage, you can go to the port http://localhost:9001 and see the result like this image
Create your Trino schema and table in Dbeaver
-- Create the schema if it doesn't exist
CREATE SCHEMA IF NOT EXISTS lakehouse.products
WITH (location = 's3://datalake/');
-- Create the products table
CREATE TABLE IF NOT EXISTS lakehouse.products.products (
id VARCHAR,
name VARCHAR,
original_price DOUBLE,
price DOUBLE,
fulfillment_type VARCHAR,
brand VARCHAR,
review_count INTEGER,
rating_average DOUBLE,
favourite_count INTEGER,
current_seller VARCHAR,
number_of_images INTEGER,
category VARCHAR,
quantity_sold INTEGER,
discount DOUBLE
) WITH (
location = 's3://datalake/products/'
);| Back | FazBrowse Home | New Git URL |