Skip to content

BigTable createReadStream error handling #1758

Description

@arbesfeld

Hi, I am using BigTable createReadStream and it seems to be hanging on errors from BigTable.
I am using through2.obj as recommended in #1715:

Perhaps I'm using the API incorrectly? I couldn't find any examples of this in the documentation.

    eventsTable
      .createReadStream({
        decode: true,
        start: rowKey,
        end: `${appID}|${recordingID}||`,
        filter: [{
          family: 'metadata',
          column: {
            cellLimit: 1,
          },
        }],
      })
      .pipe(through2.obj(async (row, _, next) => {
          await doWork();
      }))
      .on('data', () => {
        // For some reason we need to have a data block in order for 'end' to be called.
      })
      .on('error', reject)
      .on('end', async () => {
        resolve();
      });

Activity

  1. callmehiphop commented on Oct 31, 2016

    @callmehiphop
    Contributor

    @arbesfeld I'm going to update the example in that issue, but the stream emits a finish event not end in this particular instance.

    eventsTable
      .createReadStream({
        decode: true,
        start: rowKey,
        end: `${appID}|${recordingID}||`,
        filter: [{
          family: 'metadata',
          column: {
            cellLimit: 1,
          },
        }],
      })
      .pipe(through2.obj(async (row, _, next) => {
          await doWork();
          next();
      }))
      .on('error', reject)
      .on('finish', async () => {
        resolve();
      });
  2. added a commit that references this issue on Jul 23, 2025
  3. added a commit that references this issue on Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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