You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release contains completely rewritten class serializer using .NET expression trees. All the class serialisation documentation has been updated to reflect this. Existing `ParquetConvert` serializer is left untouched and marked obsolete, hence there is no increase in the major version number.
If you are using `ParquetConvert`, consider switching to `ParquetSerializer` soon, because no new features or fixes will be added to `ParquetConvert`.
New class serializer supports all primitive types and nested types (structs, lists, maps and their combinations). It also fully conforms to Dremel specification, which was a massive headache to implement properly.
Other improvements:
- Documentation updated for low-level and serializer API on how to use nested data types.
- Corrected how definition and repetition levels are calculated, making it more conformant to Parquet specification.
- Schema path calculation logic improved and does not rely on string splitting/joining, which allows you to use any characters anywhere in column names (tensorflow#278)
Copy file name to clipboardExpand all lines: docs/README.md
+33-17Lines changed: 33 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,22 @@
7
7
8
8
**Fully portable, managed** .NET library to 📖read and ✍️write [Apache Parquet](https://parquet.apache.org/) files. Targets `.NET 7`, `.NET 6.0`, `.NET Core 3.1`, `.NET Standard 2.1` and `.NET Standard 2.0`.
9
9
10
-
Runs everywhere .NET runs Linux, MacOS, Windows, iOS, Android, Tizen, Xbox, PS4, Raspberry Pi, Samsung TVs and much more.
10
+
Whether you want to build apps for Linux, MacOS, Windows, iOS, Android, Tizen, Xbox, PS4, Raspberry Pi, Samsung TVs or much more, Parquet.NET has you covered.
11
11
12
-
## Quick Start
12
+
## Why
13
+
14
+
Parquet is a great format for storing and processing large amounts of data, but it can be tricky to use with .NET. That's why this library is here to help. It's a pure library that doesn't need any external dependencies, and it's super fast - faster than Python and Java, and other C# solutions. It's also native to .NET, so you don't have to deal with any wrappers or adapters that might slow you down or limit your options.
15
+
16
+
This library is the best option for parquet files in .NET. It has a simple and intuitive API, supports all the parquet features you need, and handles complex scenarios with ease.
13
17
14
-
Why should I use this? I think you shouldn't. Go away and look at better alternatives, like [PyArrow](https://arrow.apache.org/docs/python/) that does it much better in Python. Also I'd rather you use [Apache Spark](https://spark.apache.org/) with native support for Parquet and other commercial alternatives. Seriously. Comparing to those, this library is just pure shite, developed in spare time by one person. Despite that, it's a de facto standard for .NET when it comes to reading and writing Parquet files. Why? Because:
18
+
Also it:
15
19
16
-
- It has zero dependencies - pure library that just works.
17
-
- It's really fast. Faster than Python and Java implementations.
18
-
- It's .NET native. Designed to utilise .NET and made for .NET developers.
20
+
- Has zero dependencies - pure library that just works.
21
+
- Really fast. Faster than Python and Java, and alternative C# implementations out there. It's often even faster than native C++ implementations.
22
+
- .NET native. Designed to utilise .NET and made for .NET developers, not the other way around.
23
+
- Not a "wrapper" that forces you to fit in. It's the other way around - forces parquet to fit into .NET.
24
+
25
+
## Quick Start
19
26
20
27
Parquet is designed to handle *complex data in bulk*. It's *column-oriented* meaning that data is physically stored in columns rather than rows. This is very important for big data systems if you want to process only a subset of columns - reading just the right columns is extremely efficient.
21
28
@@ -54,7 +61,7 @@ var data = Enumerable.Range(0, 1_000_000).Select(i => new Record {
54
61
Now, to write these to a file in say `/mnt/storage/data.parquet` you can use the following **line** of code:
That's pretty much it! You can [customise many things](serialisation.md) in addition to the magical magic process, but if you are a really lazy person that will do just fine for today.
3. Row group is like a data partition inside the file. In this example we have just one, but you can create more if there are too many values that are hard to fit in computer memory.
148
154
4. Three calls to row group writer write out the columns. Note that those are performed sequentially, and in the same order as schema defines them.
149
155
150
-
Read more on writing [here](writing.md).
156
+
Read more on writing [here](writing.md) which also includes guides on writing [nested types](nested_types.md) such as lists, maps, and structs.
151
157
152
158
### 📖Reading Data
153
159
@@ -158,7 +164,7 @@ Reading data also has three different approaches, so I'm going to unwrap them he
158
164
Provided that you have written the data, or just have some external data with the same structure as above, you can read those by simply doing the following:
This will give us an array with one million class instances similar to this:
@@ -216,15 +222,25 @@ This is what's happening:
216
222
217
223
If you have a choice, then the choice is easy - use Low Level API. They are the fastest and the most flexible. But what if you for some reason don't have a choice? Then think about this:
218
224
219
-
| Feature | 🚤Class Serialisation | 🌛Table API | ⚙️Low Level API |
| Developer Convenience | C# native | feels like Excel | close to Parquet internals|
229
+
| Row based access | easy | easy | hard|
230
+
| Column based access |C# native| hard| easy|
225
231
226
232
227
233
228
234
## Contributing
229
235
230
-
Any contributions are welcome, in any form. Documentation, code, tests, donations or anything else. I don't like processes so anything goes. If you happen to get interested in parquet development, there are some [interesting links](parquet-getting-started-md).
236
+
Any contributions are welcome, in any form. Documentation, code, tests, donations or anything else. I don't like processes so anything goes. If you happen to get interested in parquet development, there are some [interesting links](parquet-getting-started.md).
237
+
238
+
## Special Thanks
239
+
240
+
Without these tools development would be really painful.
241
+
242
+
-[Visual Studio Community](https://visualstudio.microsoft.com/vs/community/) - free IDE from Microsoft. The best in class C# and C++ development tool. It's worth using Windows just because Visual Studio exists there.
243
+
-[JetBrains Rider](https://www.jetbrains.com/rider/) - for their cross-platform C# IDE, which has some great features.
244
+
-[IntelliJ IDEA](https://www.jetbrains.com/idea/) - the best Python, Scala and Java IDE.
245
+
-[LINQPad](https://www.linqpad.net/) - extremely powerful C# REPL with unique visualisation features, IL decompiler, expression tree visualiser, benchmarking, charting and so on. Again it's worth having Windows just for this tool. Please support the author and purchase it.
246
+
-[Benchmarkdotnet](https://benchmarkdotnet.org/) - the best cross-platform tool that can microbenchmark C# code. This library is faster than native ones only thanks for this.
Copy file name to clipboardExpand all lines: docs/legacy_serialisation.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Class Serialisation
2
2
3
+
> This document refers to legacy serialisation, which is still in the library, but is marked as obsolete and will be removed by the end of 2023. No new features will be added and you should [migrate](serialisation.md).
4
+
3
5
Parquet library is generally extremely flexible in terms of supporting internals of the Apache Parquet format and allows you to do whatever the low level API allow to. However, in many cases writing boilerplate code is not suitable if you are working with business objects and just want to serialise them into a parquet file.
4
6
5
7
Class serialisation is **really fast** as it generates [MSIL](https://en.wikipedia.org/wiki/Common_Intermediate_Language) on the fly. That means there is a tiny bit of delay when serialising a first entity, which in most cases is negligible. Once the class is serialised at least once, further operations become blazingly fast (around *x40* speed improvement comparing to reflection on relatively large amounts of data (~5 million records)).
0 commit comments