This project contains scripts and tools for data processing and analysis using Kafka and Spark. It includes functionalities for producing and consuming Kafka messages, as well as Spark jobs for analyzing cricket match data.
README.md
# Data folder containing input datasets
data/
ipl_2022_deliveries.csv
# Kafka folder containing producer and consumer scripts
kafka/
producer.py
test_consumer.py
# Spark folder containing data analysis scripts
spark/
bowl.py
highest_score_overall.py
highest_score_team_match.py
runrate.py
- data/ipl_2022_deliveries.csv: Dataset containing cricket match delivery details.
- kafka/producer.py: Script to produce messages to a Kafka topic.
- kafka/test_consumer.py: Script to consume messages from a Kafka topic.
- spark/bowl.py: Spark job for analyzing bowling data.
- spark/highest_score_overall.py: Spark job to find the highest score across all matches.
- spark/highest_score_team_match.py: Spark job to find the highest score by a team in a match.
- spark/runrate.py: Spark job to calculate run rates.
- Clone the repository:
git clone <repository-url> cd DBT
- Install required Python libraries:
pip install -r requirements.txt
- Set up Kafka and Spark environments as per their official documentation.
- To produce messages:
python kafka/producer.py
- To consume messages:
python kafka/test_consumer.py
- Run any Spark job using the following command:
Replace
spark-submit spark/<script_name>.py
<script_name>with the desired script, e.g.,highest_score_overall.py.
- Python 3.8+
- Apache Kafka
- Apache Spark
- Required Python libraries (listed in
requirements.txt)
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push the branch.
- Open a pull request with a detailed description of your changes.