Skip to content

adopt and document the new apache-arrow date encoding #1375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/lib/arrow.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,20 @@ Visualized with [Plot’s difference mark](https://observablehq.com/plot/marks/d

```js echo
Plot.plot({
x: {type: "utc"},
marks: [
Plot.ruleY([0]),
Plot.differenceY(table, {x: "date", y: "value"})
]
})
```

<div class="note">

The chart above specifies _x_ as a UTC scale because Apache Arrow represents dates as numbers (milliseconds since [Unix epoch](<https://en.wikipedia.org/wiki/Epoch_(computing)>)) rather than Date objects; without this hint, Plot would assume that _date_ column is quantitative rather than temporal and produce a less legible axis.

</div>

## Apache Parquet

The [Apache Parquet](https://parquet.apache.org/) format is optimized for storage and transfer. To load a Parquet file — such as this sample of 250,000 stars from the [Gaia Star Catalog](https://observablehq.com/@cmudig/peeking-into-the-gaia-star-catalog) — use [`FileAttachment`](../files). This is implemented using Kyle Barron’s [parquet-wasm](https://kylebarron.dev/parquet-wasm/) library.
Expand Down