{"id":15208665,"url":"https://github.com/sdspot2034/exploring-parquet","last_synced_at":"2026-03-14T07:06:22.961Z","repository":{"id":247636748,"uuid":"825365981","full_name":"sdspot2034/exploring-parquet","owner":"sdspot2034","description":"Project to compare write efficiency and memory efficiency of CSV and Parquet files","archived":false,"fork":false,"pushed_at":"2024-07-20T17:28:18.000Z","size":49359,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T09:37:41.775Z","etag":null,"topics":["chunking","csv-export","data-engineering","data-modeling","database","decorators","etl","mysql","parquet","pyspark","python3","spark"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdspot2034.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-07T15:32:40.000Z","updated_at":"2024-07-20T17:28:21.000Z","dependencies_parsed_at":"2024-07-20T18:43:12.586Z","dependency_job_id":null,"html_url":"https://github.com/sdspot2034/exploring-parquet","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.050000000000000044","last_synced_commit":"bc2c6c22f08b246675efa5289909d20a663ad6eb"},"previous_names":["sdspot2034/exploring-parquet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdspot2034%2Fexploring-parquet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdspot2034%2Fexploring-parquet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdspot2034%2Fexploring-parquet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdspot2034%2Fexploring-parquet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdspot2034","download_url":"https://codeload.github.com/sdspot2034/exploring-parquet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243021773,"owners_count":20223068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chunking","csv-export","data-engineering","data-modeling","database","decorators","etl","mysql","parquet","pyspark","python3","spark"],"created_at":"2024-09-28T07:01:33.712Z","updated_at":"2025-12-24T07:52:17.503Z","avatar_url":"https://github.com/sdspot2034.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# exploring-parquet\n\n## Introduction\nIn this mini-project, I sought to compare the result of storing a table as a CSV file against parquet. It is well known that Parquet is a read-efficient file format that supercharges query performance for analytical use cases due to its columnar nature. By default, it uses `snappy` compression that reduces file size by more than half. Due to this compression, a slight overhead is associated with the write time of the file. Read my [blog article](https://shreyandas.hashnode.dev/parquet-vs-csv) to know more.\n\n## Procedure\n1. Set up a MySQL Server on your local machine.\n2. Download all Python packages and dependencies mentioned below.\n3. Download the `airportdb` Database from [MySQL's Official Pages](https://dev.mysql.com/doc/index-other.html).\n4. Extract the files in your preferred directory.\n5. Copy all files with the extension `.zst` and place it inside a folder called `zst_folder`.\n6. Run the Python script `zst_extractor.py` making appropriate changes in the source and destination folder paths.\n7. Run the `tsv_to_csv_converter.py` Python Script to convert to a format readable by MySQL Server. (*This step is optional.*)\n8. Run the `DDL Queries.sql` file on the MySQL Server to create the schemas for all the required tables on the `airportdb` database.\n9. Set `allow_local_infile` parameter on the MySQL Server configurations to `true`.\n10. Run the `Data Loader.ipynb` notebook to load all the files to the database.\n11. Query the tables on the database to ensure proper data load.\n12. Run the `ingestion_pipeline.py` twice, once with `write_mode='csv'` and then with `write_mode='parquet'` and changing the sink folder location for each run.\n\nYou can monitor the Spark Jobs on the Web UI by opening the link http://localhost:4050 on your browser.\n\n## Dependencies\n\n1. **MySQL Database**\n   Ensure you have a MySQL database set up either locally or hosted somewhere. Ensure you have the hostname (IP Address), username and password (preferrably, non-root) with read and create table and create database access on the server.\n   \n2. **Zstandard**\n   A Python compression library that is used to convert database into TSV files.\n   Installed version: `zstandard=0.22.0`\n   Command to install: `pip install zstandard`\n\n3. **MySQL Connector Python**\n   A Python library to connect and query on the MySQL Database.\n   Installed version: `mysql-connector-python=9.0.0`\n   Command to install: `pip install mysql-connector-python`\n\n4. **PySpark**\n   Python API for Apache Spark\n   [Official Documentation](https://spark.apache.org/docs/latest/api/python/index.html)\n   Installed Version: `pyspark=3.5.1`\n   Command to install: `pip install pyspark`\n\n5. **MySQL JDBC Driver**\n   [Official MySQL JDBC Connector link](https://www.mysql.com/products/connector/)\n   Installed Version: 9.0.0\n\n\n## References\n\n1. [Adrian Jay Timbal's Article](https://www.linkedin.com/pulse/uploading-airportdb-free-sample-database-from-mysql-local-timbal/)\n2. [`airportdb` Documentation](https://dev.mysql.com/doc/airportdb/en/)\n3. ChatGPT\n\n\nFor any questions, comments or suggestions, please feel free to reach out to me via email! 😄📬","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdspot2034%2Fexploring-parquet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdspot2034%2Fexploring-parquet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdspot2034%2Fexploring-parquet/lists"}