# Bug description

With @rlesur we wanted to play with `duckdb` embarked implementation in `observable` notebooks (feature released in Novembre: https://observablehq.com/@observablehq/duckdb)

We tried using CSV and parquet files stored on local file systems. With CSV, everything works fine when using `FileAttachment`. Things are different with `parquet` files.


## Reproducible example

@rlesur proposed a reproducible example [here ](https://git.lab.sspcloud.fr/f7sggu/quarto-ojs-parquet) with a deployed version [there](https://f7sggu.pages.lab.sspcloud.fr/quarto-ojs-parquet/) based on `penguins` dataset.

If you want us to produce an english version because that would help you figuring out what is going on, I can do that.


First, when using ` FileAttachment` with relative link:

~~~
```{ojs}
db = DuckDBClient.of({
  penquins: FileAttachment("penguins.parquet")
})
```` 
~~~

we end up with the following error:

> Error: Invalid Input Error: File 'penguins.parquet' too small to be a Parquet file


![image](https://user-images.githubusercontent.com/33896139/207016312-17533af3-a4a5-4735-9fdf-8303d111ba4d.png)

@rlesur has had the idea to compare absolute and relative URL in [his notebook](https://git.lab.sspcloud.fr/f7sggu/quarto-ojs-parquet/-/blob/master/index.qmd#L8-47). 

With absolute URL it works fine. But relative URL give the same error: https://f7sggu.pages.lab.sspcloud.fr/quarto-ojs-parquet/

I tried to tweak that problem by giving absolute path to `ojs` cell :

~~~
```{python}
import os
path_parquet = os.path.abspath("penguins.parquet")
ojs_define(path = "file:///" + path_parquet)
```

```{ojs}
//| output: false
await db._db.registerFileURL("relative.parquet", path)
```
~~~

but this brought the same error

## Environment

We tried using [quarto v1.3.49](https://github.com/quarto-dev/quarto-cli/releases/tag/v1.3.49) on Linux and Windows OS

### Checklist

- [x] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [x] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [x] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cscheid
2022-12-12T10:06:51Z
linogaliana
bug ojs-engine
v1.3
closed
Read parquet files from local filesystem with duckdb on observable notebooks
https://github.com/quarto-dev/quarto-cli/issues/3630