> For the complete documentation index, see [llms.txt](https://docs.pal.aic.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pal.aic.io/using-pal.net/datasets.md).

# Datasets

The Datasets façade covers dataset metadata and streamed table reads. Large table content is never forced through the buffered response path.

## Register and resolve

```csharp
services.AddPalantir(options);
services.AddPalantirDatasets();

var datasets = scope.ServiceProvider.GetRequiredService<IPalDatasetClient>();
```

## Get dataset metadata

```csharp
var dataset = await datasets.GetAsync("ri.dataset.example", cancellationToken);

Console.WriteLine(dataset.Rid);
Console.WriteLine(dataset.Name);
Console.WriteLine(dataset.ParentFolderRid);
```

## Read a table as a stream

```csharp
var request = new PalDatasetReadTableRequest
{
    DatasetRid = "ri.dataset.example",
    Format = PalDatasetTableFormat.Arrow,
    BranchName = "master",
    Columns = ["employee_id", "display_name"],
    RowLimit = 100_000
};

await using var table = await datasets.ReadTableAsync(request, cancellationToken);
await table.Data.CopyToAsync(outputStream, cancellationToken);
```

{% hint style="info" %}
`Columns` must contain at least one non-empty column name. `RowLimit`, when supplied, must be positive. `PalDatasetTable.Format` tells you which format was requested and `ContentType` exposes the upstream media type when present.
{% endhint %}

## CSV and Arrow

Use `PalDatasetTableFormat.Csv` for line-oriented interoperability and `PalDatasetTableFormat.Arrow` for columnar processing. PAL.NET returns the stream; it does not add an Arrow or CSV reader dependency. The consumer owns parsing and must consume incrementally for large responses.

## Branch and transaction windows

`BranchName`, `StartTransactionRid`, and `EndTransactionRid` are optional request values. Use them when the data contract requires a particular branch or a bounded transaction view. Do not assume a branch name is valid for every dataset; upstream permissions and dataset configuration still apply.

## Filesystem operations

Filesystem operations are part of the generated `FilesystemPlatformClient`. Use the same registration and generated-client pattern described in [Platform API](/using-pal.net/platform-api.md). Binary file operations generally return or accept a streaming contract; dispose response wrappers and request streams.
