chore: Include a README in the NuGet packages (#485) ## What's Changed `dotnet nuget push` warns that our packages have no readme. This adds a short package readme (`src/README.md`) and wires it up in the shared NuGet properties in `Directory.Build.props` (`PackageReadmeFile` plus a packed `Content` item next to the license and icon), so every packable project under `src/` gets it. The root `README.md` is aimed at people building the repo (build steps, relative links to source folders), so I wrote a separate, smaller one for nuget.org: what Apache Arrow is, the list of packages, a short IPC reading example and links to the docs and the repository. All links are absolute so they work on nuget.org. It carries the usual ASF license header like the other Markdown files. Checked with `dotnet pack -c Release` for each project in `src/`: all seven `.nupkg` files now contain `README.md` at the package root and their nuspec has `<readme>README.md</readme>`, with no new pack warnings. This PR was prepared with AI assistance and reviewed by me. Closes #45. ## Review follow-ups - The icon and the README both pack with `PackagePath=""` (`d9b24ae`), so both land at the package root. - `dev/release/verify_rc.sh` derives the package names from `src/*/*.csproj` (`4a6613a`) instead of iterating every `src/*/` directory, so `src/README.md` and any directory without a project cannot break release verification. No project sets `PackageId`, so the file name is the package id. - The README example uses `RecordBatch? batch` (`3c9f12c`), so pasting it into a nullable-enabled project does not warn. Verification for those two commits: `bash -n dev/release/verify_rc.sh` plus a dry run of the loop over a fixture tree (emits `nupkg`/`snupkg` names per project, skips a README file and an empty directory). This environment has no .NET SDK, so the `dotnet pack` check above was not re-run after the Markdown and shell changes. --------- Signed-off-by: Vincent <52391318+ump45nose@users.noreply.github.com> Co-authored-by: ump45nose <ump45nose@users.noreply.github.com>
An implementation of Arrow targeting .NET Standard.
See our current feature matrix for currently available features.
using System.Diagnostics; using System.IO; using System.Threading.Tasks; using Apache.Arrow; using Apache.Arrow.Ipc; public static async Task<RecordBatch> ReadArrowAsync(string filename) { using (var stream = File.OpenRead(filename)) using (var reader = new ArrowFileReader(stream)) { var recordBatch = await reader.ReadNextRecordBatchAsync(); Debug.WriteLine("Read record batch with {0} column(s)", recordBatch.ColumnCount); return recordBatch; } }
Apache.Arrow.Compression package. When reading compressed data, you must pass an Apache.Arrow.Compression.CompressionCodecFactory instance to the ArrowFileReader or ArrowStreamReader constructor, and when writing compressed data a CompressionCodecFactory must be set in the IpcOptions. Alternatively, a custom implementation of ICompressionCodecFactory can be used.Install the latest .NET Core SDK from https://dotnet.microsoft.com/download.
dotnet build
To build the NuGet package run the following command to build a debug flavor, preview package into the artifacts folder.
dotnet pack
When building the officially released version run: (see Note below about current git repository)
dotnet pack -c Release
Which will build the final/stable package.
NOTE: When building the officially released version, ensure that your git repository has the origin remote set to https://github.com/apache/arrow-dotnet.git, which will ensure Source Link is set correctly. See https://github.com/dotnet/sourcelink/blob/main/docs/README.md for more information.
There are two output artifacts:
Apache.Arrow.<version>.nupkg - this contains the executable assembliesApache.Arrow.<version>.snupkg - this contains the debug symbols filesBoth of these artifacts can then be uploaded to https://www.nuget.org/packages/manage/upload.
Build from the Apache Arrow project root.
docker build -f csharp/build/docker/Dockerfile .
dotnet test
All build artifacts are placed in the artifacts folder in the project root.
This project follows the coding style specified in Coding Style.
See https://flatbuffers.dev/languages/c_sharp/ for how to get the flatc executable.
Run flatc --csharp on each .fbs file in the format folder. And replace the checked in .cs files under FlatBuf with the generated files.
Update the non-generated FlatBuffers .cs files with the files from the google/flatbuffers repo.