bigrquerystorage

R Client for BigQuery Storage API

https://github.com/meztez/bigrquerystorage

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords from Contributors

odbc dynamic date-time documentation-tool c-plus-plus-11 c-plus-plus-14 c-plus-plus-17 c-plus-plus-20 r-packages sqlite3
Last synced: 10 months ago · JSON representation

Repository

R Client for BigQuery Storage API

Basic Info
  • Host: GitHub
  • Owner: meztez
  • License: apache-2.0
  • Language: C++
  • Default Branch: main
  • Size: 12.4 MB
Statistics
  • Stars: 20
  • Watchers: 2
  • Forks: 3
  • Open Issues: 3
  • Releases: 5
Created over 5 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# bigrquerystorage


[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/bigrquerystorage)](https://cran.r-project.org/package=bigrquerystorage)
[![R-CMD-check](https://github.com/meztez/bigrquerystorage/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/meztez/bigrquerystorage/actions/workflows/R-CMD-check.yaml)


![Comparing bq_table_download from bigrquery to bgs_table_download from bigrquerystorage](./docs/bigrquerystorage.gif)

Use [BigQuery Storage API](https://cloud.google.com/bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1) from R.

The main utility is to replace `bigrquery::bq_table_download` method.

It supports [BigQueryRead interface](https://cloud.google.com/bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1#bigqueryread).
Support for [BigQueryWrite interface](https://cloud.google.com/bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1#bigquerywrite) may be added in a future release.

## Advantages over BigQuery REST API

BigQuery Storage API is not rate limited and per project quota do not apply. It is an rpc protocol
and provides faster downloads for big results sets.

## Details

This implementation use a C++ generated client combined with the `arrow` R package to transform
the raw stream into an R object.

`bqs_table_download` is the main function of this package. Other functions are helpers to
facilitate authentication and debugging.

## Installation

#### CRAN
``` r
install.packages("bigrquerystorage")
```

#### Github
```r
remotes::install_github("meztez/bigrquerystorage")
```

### System requirements:
- [gRPC](https://github.com/grpc/grpc)
- [protoc](https://github.com/protocolbuffers/protobuf)

#### Debian 11 & 12 / Ubuntu 22.04

```sh
# install protoc and grpc
apt-get install -y libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc \
                   pkg-config
```

#### Fedora 36 & 37 & 38 / Rocky Linux 9

```sh
# install grpc, protoc is automatically installed
dnf install -y grpc-devel pkgconf
```

Other Linux distributions Please [let us know](https://github.com/meztez/bigrquerystorage/issues/new/choose) if these instructions do not work any more. ##### Alpine Linux ```sh apk add grpc-dev protobuf-dev re2-dev c-ares-dev ``` Alpine Linux 3.19 and Edge do not work currently, because the installation of the arrow package fails. ##### Debian 10 Needs the buster-backports repository. ```sh echo "deb https://deb.debian.org/debian buster-backports main" >> \ /etc/apt/sources.list.d/backports.list && \ apt-get update && \ apt-get install -y 'libgrpc\+\+-dev'/buster-backports \ protobuf-compiler-grpc/buster-backports \ libprotobuf-dev/buster-backports \ protobuf-compiler/buster-backports pkg-config ``` ##### OpenSUSE In OpenSUSE 15.4 and 15.5 the version of the grpc package is too old, so installation fails. You can potentially compile a newer version of grpc from source. ##### Ubuntu 20.04 In Ubuntu 20.04 the version of the grpc package is too old, so installation fails. You can potentially compile a newer version of grpc from source. ##### CentOS 7 & 8 / RHEL 7 & 8 These distros do not have a grpc package. You can potentially compile grpc from source.
#### macOS If you use Homebrew you may install the `grpc` package, plus `pkg-config`. If you don't have Homebrew installed, the package will download static builds of the system dependencies during installation. This works with macOS Big Sur, or later, on Intel and Arm64 machines. ```sh brew install grpc pkg-config ``` #### Windows From Rtools43, grpc is included in the toolchain. The package used to automatically download static builds of the system requirements during installation but this was removed per CRAN policy. Only, R 4.3.x (with Rtools43) or later is currently supported. ## Example This is a basic example which shows you how to solve a common problem. BigQuery Storage API requires a billing project. ```{r example, eval=FALSE} # Auth is done automagically using Application Default Credentials. # or reusing bigrquery auth. # Use the following command once to set it up : # gcloud auth application-default login --billing-project={project} library(bigrquery) library(bigrquerystorage) # TODO: (developer): Set the project_id variable to your billing project. # The read session will bill this project. This project can be # different from the one that contains the table. project_id <- 'your-project-id' rows <- bqs_table_download( x = "bigquery-public-data:usa_names.usa_1910_current", parent = project_id # , snapshot_time = Sys.time() # a POSIXct time , selected_fields = c("name", "number", "state"), row_restriction = 'state = "WA"' # , sample_percentage = 50 ) sprintf( "Got %d unique names in states: %s", length(unique(rows$name)), paste(unique(rows$state), collapse = " ") ) ``` ## Authentication Done using Google Application Default Credentials (ADC) or by recycling `bigrquery` authentication. Auth will be done automatically the first time a request is made. ```{r auth, eval=FALSE} bqs_auth() bqs_deauth() ``` ## Stability Does not support AVRO output format. Report any issues to the project [issue tracker](https://github.com/meztez/bigrquerystorage/issues/new/choose). Full gRPC debug trace with `bigrquerystorage:::bqs_set_log_verbosity(0)`.

Owner

  • Name: Bruno Tremblay
  • Login: meztez
  • Kind: user
  • Location: Lévis, QC, Canada
  • Company: @Boostao

Not a robot.

GitHub Events

Total
  • Create event: 4
  • Release event: 2
  • Issues event: 14
  • Watch event: 2
  • Issue comment event: 22
  • Push event: 18
  • Pull request review event: 1
  • Pull request event: 5
Last Year
  • Create event: 4
  • Release event: 2
  • Issues event: 14
  • Watch event: 2
  • Issue comment event: 22
  • Push event: 18
  • Pull request review event: 1
  • Pull request event: 5

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 182
  • Total Committers: 7
  • Avg Commits per committer: 26.0
  • Development Distribution Score (DDS): 0.632
Past Year
  • Commits: 105
  • Committers: 4
  • Avg Commits per committer: 26.25
  • Development Distribution Score (DDS): 0.533
Top Committers
Name Email Commits
Bruno Tremblay b****y@l****m 67
Bruno Tremblay b****o@b****a 54
Gábor Csárdi c****r@g****m 49
Jeroen Ooms j****s@g****m 5
Bruno Tremblay m****z@n****m 3
Tremblay b****y@b****a 2
Hadley Wickham h****m@g****m 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 33
  • Total pull requests: 43
  • Average time to close issues: 3 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 10
  • Total pull request authors: 4
  • Average comments per issue: 3.97
  • Average comments per pull request: 0.7
  • Merged pull requests: 41
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 11
  • Average time to close issues: 15 days
  • Average time to close pull requests: about 3 hours
  • Issue authors: 5
  • Pull request authors: 3
  • Average comments per issue: 4.0
  • Average comments per pull request: 0.09
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • meztez (16)
  • hadley (7)
  • gaborcsardi (3)
  • michaelgap360 (2)
  • nkapur2 (1)
  • joscani (1)
  • stickfighter342 (1)
  • Stephen-McDaniel (1)
  • jake-coleman32 (1)
  • cheuerde (1)
  • botan (1)
  • thiagoveloso (1)
  • lionel- (1)
Pull Request Authors
  • meztez (30)
  • gaborcsardi (15)
  • hadley (8)
  • jeroen (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 296 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
cran.r-project.org: bigrquerystorage

An Interface to Google's 'BigQuery Storage' API

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 296 Last month
Rankings
Dependent packages count: 28.5%
Dependent repos count: 36.6%
Average: 50.2%
Downloads: 85.5%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/linux.yaml actions
  • actions/checkout v3 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • DBI * imports
  • Rcpp * imports
  • arrow * imports
  • assertthat * imports
  • base64enc * imports
  • bigrquery * imports
  • bit64 * imports
  • lifecycle * imports
  • methods * imports
  • rlang * imports
  • tibble * imports
  • hms * suggests
  • testthat * suggests
  • wk * suggests