简体   繁体   中英

Installing arrow package on shinyapps.io

I'm using the arrow package to read parquet files into my shiny app, which works well locally. However, when trying to deploy the app on shinyapps.io, I get the following installation error:

IOError: NotImplemented: Support for codec 'snappy' not built In order to read this file, you will need to reinstall arrow with additional features enabled. Set one of these environment variables before installing:

The message is very clear, but I haven't been able to pass those environment variables to the shinyapps.io server. I've tried uploading.bashrc and.Renviron files with appropriate environment variables set, but neither worked, and reading the mentioned article didn't help me, either.

I'd greatly appreciate any suggestions or explanations for how to proceed.

Update as on 24th Feb, 2022

As of arrow R package version 7.0.0, shinyapps.io reads compressed parquet files without having to do any config using renviron.

Snappy and lz4 compression libraries are enabled by default in Linux builds. This means that the default build of Arrow, without setting any environment variables, will be able to read and write snappy encoded Parquet files.

Ref: https://cran.r-project.org/web/packages/arrow/news/news.html

Previous answer I have had a similar issue. It seems that there is a problem with reading compressed parquet files on shinyapps.io. Not the solution but a workaround is to save your parquet files with compression = 'uncompressed' (default is snappy). Uncompressed parquet files read perfectly fine on shinyapps.io. This would increase the file size but in my case, it was still way better than using csv files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM