You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/11 19:49:07 UTC

[GitHub] [arrow] emkornfield commented on pull request #7704: ARROW-9297: [C++][Parquet] Support chunked row groups in RowGroupRecordBatchReader

emkornfield commented on pull request #7704:
URL: https://github.com/apache/arrow/pull/7704#issuecomment-657119271


   I prefer checks to assertions for 'in the wild' errors.  Especially around
   code that is acting on passed data.
   
   On Saturday, July 11, 2020, Benjamin Kietzman <no...@github.com>
   wrote:
   
   > *@bkietz* commented on this pull request.
   > ------------------------------
   >
   > In cpp/src/parquet/arrow/schema.h
   > <https://github.com/apache/arrow/pull/7704#discussion_r453228008>:
   >
   > >      // Coalesce a list of schema field indices which are the roots of the
   >      // columns referred to by a list of column indices
   >      const schema::GroupNode* group = descr->group_node();
   >      std::unordered_set<int> already_added;
   > -    out->clear();
   > -    for (auto& column_idx : column_indices) {
   > +
   > +    std::vector<int> out;
   > +    for (int column_idx : column_indices) {
   > +      if (column_idx < 0 || column_idx >= descr->num_columns()) {
   > +        return ::arrow::Status::IndexError("Column index ", column_idx, " is not valid");
   > +      }
   >        auto field_node = descr->GetColumnRoot(column_idx);
   >        auto field_idx = group->FieldIndex(*field_node);
   >        if (field_idx < 0) {
   >
   > Worth noting: replacing this check with an assertion locally broke no
   > tests in C++ or python. I'll leave it as an assertion for now and see what
   > CI thinks
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/arrow/pull/7704#discussion_r453228008>, or
   > unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AEIKYDUCHLANLHU73PTVCEDR3C6MTANCNFSM4OW2OZ6A>
   > .
   >
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org