Skip to content

BigTableInstance.getRows sometimes returns 0 values silently #1757

@arbesfeld

Description

@arbesfeld

I noticed when running getRows that I would sometimes get 0 results. No error was thrown so this took a while to uncover, and eventually I had to do it in batches:

  let rows = [];
  const MAX_KEYS = 1000;

  for (const i = 0; i * MAX_KEYS < rowIds.length; i++) {
    const [newRows] = await eventsTable.getRows({
      decode: false,
      keys: rowIds.slice(i * MAX_KEYS, (i + 1) * MAX_KEYS),
      filter: [{
        column: {
          cellLimit: 1,
        },
      }],
    });

    rows = rows.concat(newRows);
  };

I'm not sure if this is even the right approach, since 1000 seems pretty arbitrary.

Potentially this is related to #1755? However I was only using ~9k keys which where ~100 characters each which should be under the 4mb limit.

Metadata

Metadata

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