Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParquetTransformer stream doesn't emit error #116

Open
annfomenko opened this issue Oct 8, 2020 · 1 comment
Open

ParquetTransformer stream doesn't emit error #116

annfomenko opened this issue Oct 8, 2020 · 1 comment

Comments

@annfomenko
Copy link

annfomenko commented Oct 8, 2020

Please add error catcher to _transform method of ParquetTransformer class:

_transform(row, encoding, callback) {
     if (row) {
      this.writer.appendRow(row).then(callback).catch((error) => callback(error));
    } else {
      callback();
    }
}

It allows to listen error on the stream object.

@IvanOfThings
Copy link

IvanOfThings commented Jan 23, 2021

@annfomenko I think your suggestion also solves the problem of founding a error when applying schema in stream process.

I would make the PR but contributors agreement is not available anymore.

Based on the current code the _transform function should look like this:

  _transform(row, encoding, callback) {
    if (row) {
      this.writer
        .appendRow(row)
        .then((d) => callback(null, d), callback)
        .catch((error) => callback(error));
    } else {
      callback();
    }
  }

Edited: It is an already open PR to solve that --> #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants