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

ORC: validate values are not null for required columns #22

Open
rdblue opened this issue Mar 14, 2018 · 0 comments
Open

ORC: validate values are not null for required columns #22

rdblue opened this issue Mar 14, 2018 · 0 comments

Comments

@rdblue
Copy link
Contributor

rdblue commented Mar 14, 2018

The SparkOrcWriter defines converters that could easily throw exceptions when a required column has a null value, like this:

  static class RequiredIntConverter implements Converter {
    public void addValue(int rowId, int column, SpecializedGetters data,
                         ColumnVector output) {
      if (data.isNullAt(column)) {
        throw new NullPointerException("Column " + column + " is required, but null in row: " + rowId);
      } else {
        output.isNull[rowId] = false;
        ((LongColumnVector) output).vector[rowId] = data.getInt(column);
      }
    }
  }
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

1 participant