{"id":16482191,"url":"https://github.com/cajuncoding/parquetfiles.blobhelpers","last_synced_at":"2026-03-08T02:04:39.919Z","repository":{"id":65371820,"uuid":"311513496","full_name":"cajuncoding/ParquetFiles.BlobHelpers","owner":"cajuncoding","description":"A simple library and console application to illustrate how to read and load data into class models from Parquet files saved to Azure Blob Storage using Parquet .Net (parquet-dotnet).  This is useful for E-L-T processes whereby you need to load the data into Memory, Sql Server (e.g. Azure SQL), etc. or any other location where there is no built-in or default mechanism for working with Parquet data.","archived":false,"fork":false,"pushed_at":"2023-01-19T22:38:43.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T01:52:23.393Z","etag":null,"topics":["azure-blob","azure-blob-storage","azure-functions","parquet","parquet-data","parquet-dotnet","parquet-files","parquet-tools"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cajuncoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-10T01:41:34.000Z","updated_at":"2025-04-13T06:12:56.000Z","dependencies_parsed_at":"2023-02-11T22:02:09.680Z","dependency_job_id":null,"html_url":"https://github.com/cajuncoding/ParquetFiles.BlobHelpers","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cajuncoding/ParquetFiles.BlobHelpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FParquetFiles.BlobHelpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FParquetFiles.BlobHelpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FParquetFiles.BlobHelpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FParquetFiles.BlobHelpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cajuncoding","download_url":"https://codeload.github.com/cajuncoding/ParquetFiles.BlobHelpers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FParquetFiles.BlobHelpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270702471,"owners_count":24630873,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["azure-blob","azure-blob-storage","azure-functions","parquet","parquet-data","parquet-dotnet","parquet-files","parquet-tools"],"created_at":"2024-10-11T13:09:56.955Z","updated_at":"2026-03-08T02:04:34.891Z","avatar_url":"https://github.com/cajuncoding.png","language":"C#","funding_links":["https://www.buymeacoffee.com/cajuncoding"],"categories":[],"sub_categories":[],"readme":"﻿# ParquetFile.BlobHelpers\nThis is a simple library and example console application to illustrate how to read and load data into class models from \nParquet files saved to Azure Blob Storage using [Parquet .Net (parquet-dotnet)](https://github.com/elastacloud/parquet-dotnet#apache-parquet-for-net-platform).\n\n## Overview\nThis is useful for E-L-T (extract-load-transform) processes whereby you need to load the data into Memory, \nSql Server (e.g. Azure SQL), etc. or any other location where there is no built-in or default mechanism for \nworking with Parquet data.\n\n### [Buy me a Coffee ☕](https://www.buymeacoffee.com/cajuncoding)\n*I'm happy to share with the community, but if you find this useful (e.g for professional use), and are so inclinded,\nthen I do love-me-some-coffee!*\n\n\u003ca href=\"https://www.buymeacoffee.com/cajuncoding\" target=\"_blank\"\u003e\n\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\n\u003c/a\u003e \n\n## Nuget Package\nTo use in your project, add the [ParquetFiles.BlobHelpers NuGet package](https://www.nuget.org/packages/ParquetFiles.BlobHelpers) to your project.\n\n### v2.0 Release Notes:\n- Updated to use the latest Parquet.NET v4.2.2\n- Breaking changes in the underlying Parquet.NET necessitated breaking changes here in our API:\n    - Mainly `Read\u003cT\u003e()` is now `ReadAllAsync\u003cT\u003e()` -- fully async but no longer supports yielding the enumerable due to limitations in the underlying `ParquetConvert` class at this time.\n- Namespace was fixed for consistency ParquetFile.BlobHelpers is now ParquetFiles.BlobHelpers (plural).\n\n### v1.0 Release Notes:\n- Initial stable functioning release.\n\n## Details\nAs noted in the Parquet-DotNet documentation, processing data from a parquet file requires alot of seeking and therefore\nrequires that the file be provided in a readable and seekable Stream! This precludes the ability to read data\nwhile streaming down from Blob in real-time -- the entire file must be locally available.\n\nThis library provides ability to use either MemoryStream or FileStream depending on the size of the parquet file\nby setting a threshold limit the denotes the maximum size of which a MemoryStream should be used.  This allows\nfor high perfomrance of MemoryStreams whenever possible, but enabling FileStream anytime the environment has\nmore constrained memory (e.g. Azure Functions with only 1GB RAM).\n\nWhen necessary, per configuration, the FileStream work is fully encapsulated but overridable if needed via virtual method. \nA local temp file is created and used for managing the stream of data. Then the stream, as well as the temp file, is \nautomatically cleaned up as soon as the `ParquetBlobReader` is properly disposed -- which it must be via IDisposable.\n\n*Note: We leverage the [**Fast Automatic Serialization functionality**](https://github.com/elastacloud/parquet-dotnet/blob/master/doc/serialisation.md) \n built in functionality of Parquet-DotNet to Deserialise the data from the Parquet file into class Models -- \n`ParquetConvert.DeserializeAsync\u003cTModel\u003e(...)`.  This is convenient and initial testing shows solid performance (as expected).\nHowever it seems to have alot of dependencies on models with Nullable properties, and can actual load data \nincorrectly when they aren't nullable.  So pending further testinga and real world usage we may have to \nimplement our own processing of the data....*\n\n### Dependencies\n1. [Parquet-DotNet](https://github.com/elastacloud/parquet-dotnet#apache-parquet-for-net-platform) -- The goto Parquet File reader for C# \u0026 .Net.\n2. Azure.Storage.Blobs\n\n## Use Case Example (E-L-T)\nWe use this for loading data into Azure Sql via Azure Functions that handle our data-load processes. Unfortunately,\nAzure Sql does not have native support for efficiently reading Parquet data like Azure Sql Warehouse or \nAzure Synapse Analytics (the new DW re-branding) -- the OpenRowset() function in DW and Azure Sql Analytics\nhas unique functionality that makes working with Parquet files much easier.\n\nBut, when Parquet is used as a data transport mechanism for API's, Micro-services, etc. then this becomes an issue\nas Azure SQL is far appropriate to use as the persistence DB than DW.\n\nAnd, there isn't alot of information out there about how to easily load a file from Blob storage and read it\nwith [Parquet.Net (parquet-dotnet)](https://github.com/elastacloud/parquet-dotnet#apache-parquet-for-net-platform);\n which is the go-to parquet file reader for C# and .Net. \n\n### Loading into Azure Sql (or other system)\nBy using a Model based approach to reading the data, this makes it exceptionally easy to then pipe that data \ninto Azure Sql via your ORM or for high performance using SqlBulkHelpers (if you're a Dapper User) or RepoDb \n(which has a very similar Bulk Insert/Update capability OOTB)!\n\nFor example, if you're loading data with a Materialized Data pattern, and also using a serverless environment, \nsuch as Azure Functions, you can can use a distributed lock to ensure that only one process runs at a time\nand then load and instantly switch out data into Live loading tables with these other libraries:\n1. [Materialized Data Helpers via SqlBulkHelpers Library](https://github.com/cajuncoding/SqlBulkHelpers)\n   - Accomplish a near instantaneous live Table refresh leaving the Live tables unblocked until all data is laoded and ready to be switched (in millesconds)!\n2. [Implement a Distributed Mutex Application Lock via SqlAppLockHelper Library](https://github.com/cajuncoding/SqlAppLockHelper)\n   - Implement background (fully asynchronous) data loading for Materialization of data and ensrue that only one process ever runs at a time with Serverless resources such as Azure Functions! \n\n## Example Usage\n```csharp\n    //Initialize Options (here we wire up a simple log handler to redirect to the Console)...\n    var options = new ParquetBlobReaderOptions()\n    {\n        //Easily/Optionally direct logging wherever you want with a handler Action\u003cstring\u003e...\n        LogDebug = (message) =\u003e Console.WriteLine(message)\n    };\n\n    //Create an instance of ParquetBlobReader() which MUST be Disposed of properly...\n    using (var parquetReader = new ParquetBlobReader(blobStorageConnectionString, blobContainer, blobFilePath, options))\n    { \n        //Open \u0026 initialize the Blob Stream (this will download the blob data)...\n        await parquetReader.OpenAsync();\n\n        //Read All Results and filter, sort, etc.\n        var results = (await parquetReader.ReadAllAsync\u003cItemModel\u003e()).OrderBy(r =\u003e r.Id);\n        \n        //Example of Reading a Parquet File into the specified Model (by Generic Type) \n        // and enumerating the results provided by the IEnumerable result...\n        var x = 1;\n        foreach (var item in results)\n        {\n            Console.WriteLine($\"{x++}) {item.Id} -- {item.Name}\");\n        }\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcajuncoding%2Fparquetfiles.blobhelpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcajuncoding%2Fparquetfiles.blobhelpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcajuncoding%2Fparquetfiles.blobhelpers/lists"}