Skip to content

Commit

Permalink
mem alloc issue no rows table, checkout v4 (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
meztez authored Apr 3, 2024
1 parent 6494b3c commit 679e74d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
outputs:
distros: ${{ steps.setup-matrix.outputs.distros }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up matrix of builds
id: setup-matrix
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-Latest
name: ${{ matrix.distro }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build package
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
## R CMD check results

Duration: 1m 23.1s
Duration: 1m 17.6s

❯ checking installed package size ... NOTE
installed size is 14.7Mb
sub-directories of 1Mb or more:
libs 14.6Mb

0 errors ✔ | 0 warnings ✔ | 1 note ✖

* This is a new release.
10 changes: 7 additions & 3 deletions src/bqs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ class BigQueryReadClient {
long int& rows_count,
long int& pages_count,
bool quiet,
RProgress::RProgress* pb) {
RProgress::RProgress* pb,
bool last_stream) {

grpc::ClientContext context;
context.AddMetadata("x-goog-request-params", "read_stream=" + stream);
Expand Down Expand Up @@ -193,6 +194,9 @@ class BigQueryReadClient {
Rcpp::stop(err.c_str());
}
rows_count += method_request.offset();
if (last_stream && !quiet) {
pb->update(1);
}
}

// Split stream
Expand Down Expand Up @@ -372,12 +376,12 @@ SEXP bqs_ipc_stream(SEXP client,
// Add batches to IPC stream
for (int i = 0; i < read_session.streams_size(); i++) {
client_ptr->ReadRows(read_session.streams(i).name(), &ipc_stream,
n, rows_count, pages_count, quiet, &pb);
n, rows_count, pages_count, quiet,
&pb, i == read_session.streams_size() - 1);
if (n > 0 && rows_count >= n) {
break;
}
}
pb.update(1);

if (!quiet) {
REprintf("Streamed %ld rows in %ld messages.\n", rows_count, pages_count);
Expand Down

0 comments on commit 679e74d

Please sign in to comment.