GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Binary data in BigTable column · Issue #1526 · googleapis/google-cloud-node

Binary data in BigTable column #1526

New issue
Copy link
New issue
Copy link
Closed
Closed
Binary data in BigTable column#1526
Copy link
Assignees
stephenplusplus
Labels
api: bigtableIssues related to the Bigtable API.

Description

@arbesfeld
arbesfeld
opened on Aug 25, 2016
Issue body actions

Hi, I am trying to store an encode protobuf in BigTable and I'm not able to insert binary data (represented as a Buffer) into a BigTable column. I have tried the following ways:

this.table.insert([
  key: `foo`,
  data: {
    event: new Buffer(),
  },
]);

this.table.insert([
  key: `foo`,
  data: {
    event: {
     data: new Buffer(),
    }
  },
]);

It seems to get stringified somewhere in the client library, which is making the data invalid.

Activity

  1. callmehiphop
    added
    api: bigtableIssues related to the Bigtable API.
    on Aug 25, 2016
  2. callmehiphop commented on Aug 25, 2016

    @callmehiphop
    callmehiphop
    on Aug 25, 2016
    Contributor
    More actions

    Hi @arbesfeld, we don't stringify any data before trying to insert it. However, we do transform any data you pass in into Buffers. Have you tried passing your data in as a string/number?

    e.g.

    this.table.insert([
      {
        key: 'foo',
        data: {
          familyName: {
            columnName: 'data'
          }
        }
      }
    ]);
  3. callmehiphop commented on Aug 25, 2016

    @callmehiphop
    callmehiphop
    on Aug 25, 2016
    Contributor
    More actions

    @arbesfeld can you give me an example of what kind of data you're trying to save? (Aside from Node buffers)

  4. stephenplusplus
    closed this as completedin #1439on Aug 29, 2016
  5. callmehiphop commented on Aug 29, 2016

    @callmehiphop
    callmehiphop
    on Aug 29, 2016
    Contributor
    More actions

    @arbesfeld we've just merged some changes for the Bigtable API. Assuming what you're passing in is a Buffer, then it should pass through just fine to the API. When retrieving the data, if you want a Buffer returned to you, you'll need to set the decode: false option like so

    table.getRows({ decode: false }, function(err, rows) {});
  6. arbesfeld commented on Sep 1, 2016

    @arbesfeld
    arbesfeld
    on Sep 1, 2016
    ContributorAuthor
    More actions

    Hey @callmehiphop, I'm setting decode: false and getting seemingly all base64 encoded buffers when I call .getRows(). I passed in a binary-encoded Buffer. Is this the expected behavior?

  7. stephenplusplus commented on Sep 1, 2016

    @stephenplusplus
    stephenplusplus
    on Sep 1, 2016
    Contributor
    More actions

    @callmehiphop I think we should always create the Buffer from the response base64 value: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/3cbc93b9d770dd25aa5c6ed1f215e01518e42a03/packages/bigtable/src/row.js#L163

        if (qualifier && chunk.value) {
          var value = Mutation.convertFromBytes(chunk.value, options);
    
          qualifier.push({
            value: value,
            labels: chunk.labels,
            timestamp: chunk.timestampMicros,
            size: chunk.valueSize
          });
        }

    and do something like this in Mutation.convertFromBytes:

      var buf = new Buffer(bytes, 'base64');
      var num = new Int64(buf).toNumber();
    
      if (!isNaN(num) && isFinite(num)) {
        return num;
      }
    
      if (options && options.decode === false) {
        return buf;
      }
    
      return buf.toString();
  8. stephenplusplus
    reopened this on Sep 1, 2016
  9. stephenplusplus
    closed this as completedin #1556on Sep 6, 2016
  10. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  11. miguelvelezsa
    added a commit that references this issue on Jul 23, 2025

    chore: remove compile protos from post processor (#1526)

    86b35d8
  12. sofisl
    added a commit that references this issue on Feb 3, 2026

    chore: update types from Discovery (#1526)

    19464b9
  13. sofisl
    added 3 commits that reference this issue on Feb 24, 2026

    fix: GoogleAdsError missing using generator version after 1.3.0 (#1526)

    a31d94f

    chore: remove GOOGLE_CLOUD_PROJECT linter warning (#1526)

    ae07887

    chore: add api_shortname and library_type to repo metadata (#1526)

    5bf092e
  14. GautamSharda
    added a commit that references this issue on Mar 11, 2026

    chore(main): release 2.19.2 (#1526)

    e8a7308
  15. sofisl
    added a commit that references this issue on Mar 17, 2026

    chore(deps): update dependency aspect_rules_js to v1.37.1 (#1526)

    b1977ca
  16. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    chore: remove GOOGLE_CLOUD_PROJECT linter warning (googleapis#1526)

    2be70f2
  17. feywind
    added a commit that references this issue on Mar 27, 2026

    chore(main): release 2.19.2 (#1526)

    61cf3f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: bigtableIssues related to the Bigtable API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.