### Discussed in https://github.com/quarto-dev/quarto-cli/discussions/1844

<div type='discussions-op-text'>

<sup>Originally posted by **eitsupi** August 12, 2022</sup>
The following documentation suggests that Observable can handle Apache Arrow.
https://quarto.org/docs/computations/ojs.html#data-sources

> In our initial example we used a [FileAttachment](https://github.com/observablehq/stdlib#file-attachments) as our data source. File attachments support many formats including CSV, TSV, JSON, SQLite, and Arrow so are a convenient way to read a dataset that has already been prepared for analysis.

So I tried using the arrow file to exchange data between the R code block and the ojs code block and was confused by the strange results I was getting.

````qmd
---
title: sample
format:
  html: default
engine: knitr
---

```{r}
mtcars |>
  arrow::write_feather("data.arrow")
```

```{ojs}
data = FileAttachment("data.arrow").arrow()
```

```{ojs}
Inputs.table(data)
```
````

![image](https://user-images.githubusercontent.com/50911393/184337991-334560f7-5ef6-439e-aec1-cdeeda93701d.png)

This seems to be due to the fact that the Arrow library in js does not support compressed ipc files. I got the expected results by explicitly generating uncompressed files as follows

````qmd
---
title: sample
format:
  html: default
engine: knitr
---

```{r}
mtcars |>
  arrow::write_feather("data.arrow", compression = "uncompressed")
```

```{ojs}
data = FileAttachment("data.arrow").arrow()
```

```{ojs}
Inputs.table(data)
```
````

![image](https://user-images.githubusercontent.com/50911393/184338096-220c65ee-4833-4266-be8e-104e665d661d.png)

Note that arquero generates an error when it tries to read a compressed ipc file.

````qmd
---
title: sample
format:
  html: default
engine: knitr
---

```{r}
mtcars |>
  arrow::write_feather("data.arrow")
```

```{ojs}
data = aq.loadArrow("data.arrow")
```

```{ojs}
data.view()
```

```{ojs}
import { aq, op } from '@uwdata/arquero'
```
````

![image](https://user-images.githubusercontent.com/50911393/184340383-7b671b21-b901-4b7f-882a-cf45a01487b0.png)

Apache Arrow is a very promising format, so it may be worth including examples in the documentation. (I used several hours for this trial and error!)</div>
cscheid
2022-08-12T14:30:38Z
cscheid
documentation ojs-engine
Future
closed
Using Apache Arrow in ojs code blocks
https://github.com/quarto-dev/quarto-cli/issues/1845