![]() |
VOOZH | about |
dotnet add package DeltaIO --version 1.0.0-alpha.4
NuGet\Install-Package DeltaIO -Version 1.0.0-alpha.4
<PackageReference Include="DeltaIO" Version="1.0.0-alpha.4" />
<PackageVersion Include="DeltaIO" Version="1.0.0-alpha.4" />Directory.Packages.props
<PackageReference Include="DeltaIO" />Project file
paket add DeltaIO --version 1.0.0-alpha.4
#r "nuget: DeltaIO, 1.0.0-alpha.4"
#:package DeltaIO@1.0.0-alpha.4
#addin nuget:?package=DeltaIO&version=1.0.0-alpha.4&prereleaseInstall as a Cake Addin
#tool nuget:?package=DeltaIO&version=1.0.0-alpha.4&prereleaseInstall as a Cake Tool
This is an ongoing attempt to implement delta.io in pure .net with no native dependencies, wrappers and so on.
Delta Spark depends on Java and Spark, which is fine for many use cases, but not all Delta Lake users want to depend on these libraries. This library allows using Delta Lake in C# or other languages using .NET runtime.
It lets you query Delta tables with blazing speed without depending on Java/Scala.
Suppose you want to query a Delta table with on your local machine. This library makes it easy to query the table with a simple dotnet add package command - no need to install Java or Spark.
This library heavily relies on parquet-dotnet - a fast, safe, pure parquet implementation in .NET, for reading delta log checkpoints and the data itself.
Delta lake essentially stores data as a set of parquet files. When you add a set of rows to the delta lake table, it essentially adds more parquet files. The problem is only to figure out which files to read.
Sometimes delta tables will be "compacted" to minimise the number of files and reorganise the storage for more efficiency, especially if those files are small and there are a lot of them.
When you delete rows from a delta lake table, some files will be deleted. But wait, what happens if you want to delete one row, and the file it's in contains other rows as well? In that case delta lake will mark the file as deleted, and create a new file without that row.
So the purpose of the delta lake library like this is to figure out which files are relevant.
Delta tables also support versioning, because files are kept for reasons of time travel. So that you can tell which files were relevant at specific point of time.
This library is almost at the stage where it can read delta tables. The aim of the first version is to fully support reading the lake, with next version to support modification operations as well. You can already use it for non-critical workloads today.
After installing the nuget package 👁 NuGet Version
, find out type of storage your tables are stored in. We will stick with local disk here, but there are plenty of other options. This library relies on Stowage library to abstract the locations of source files. Let's say I have three delta tables in D:\delta-dotnet\src\DeltaLake.Test\data\chinook folder, which looks like this:
using DeltaLake;
using Stowage;
// point to location where delta table root is stored
IFileStorage location = Files.Of.LocalDiskStorage("D:/delta-dotnet/src/DeltaLake.Test/data/chinook");
// open "artist.simple" table
Table table = await Table.OpenAsync(location, "chinook");
This will instantiate an interface to the delta table, so you can start performing other operations.
To figure out which files are valid for current delta table, read the DataFiles property;
IReadOnlyCollection<DataFile> dataFiles = table.DataFiles;
This returns the list of files at the latest version of this table. Each DataFile contains basic metadata about those data files, including it's size in bytes, partitions and their values, creation timestamp and, most importantly, path to the actual data in parquet format.
You can choose which files to read, and do the following:
// let's open the first data file
using Stream parquetStream =
await table.OpenSeekableStreamAsync(dataFiles.First());
Then read file data in any way you would normally do with Parquet.Net library, for example deserialise them into Artist:
public class Artist {
public int? ArtistId { get; set; }
public string? Name { get; set; }
}
IList<Artist> artists = await ParquetSerializer.DeserializeAsync<Artist>(parquetStream);
Stay tuned!
Tune in!
Bookmark, star, start discussions, spread the word if you are interested in the future of this project! You can also donate to the project if you find it useful.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.4 | 806 | 11/14/2024 |
| 1.0.0-alpha.3 | 252 | 11/12/2024 |
| 1.0.0-alpha.2 | 147 | 11/11/2024 |
| 1.0.0-alpha.1 | 135 | 11/8/2024 |
| 0.0.0-pre.5 | 132 | 11/6/2024 |
| 0.0.0-pre.4 | 129 | 10/30/2024 |
| 0.0.0-pre.3 | 135 | 10/30/2024 |