\brief helper for Key() functions sets the field builder with name key, or returns false if there is no field with that name
| 836 | /// sets the field builder with name key, or returns false if |
| 837 | /// there is no field with that name |
| 838 | bool SetFieldBuilder(std::string_view key, bool* duplicate_keys) { |
| 839 | auto parent = Cast<Kind::kObject>(builder_stack_.back()); |
| 840 | field_index_ = parent->GetFieldIndex(key); |
| 841 | if (ARROW_PREDICT_FALSE(field_index_ == -1)) { |
| 842 | return false; |
| 843 | } |
| 844 | if (field_index_ < absent_fields_stack_.TopSize()) { |
| 845 | *duplicate_keys = !absent_fields_stack_[field_index_]; |
| 846 | } else { |
| 847 | // When field_index is beyond the range of absent_fields_stack_ we have a duplicated |
| 848 | // field that wasn't declared in schema or previous records. |
| 849 | *duplicate_keys = true; |
| 850 | } |
| 851 | if (*duplicate_keys) { |
| 852 | status_ = ParseError("Column(", Path(), ") was specified twice in row ", num_rows_); |
| 853 | return false; |
| 854 | } |
| 855 | builder_ = parent->field_builder(field_index_); |
| 856 | absent_fields_stack_[field_index_] = false; |
| 857 | return true; |
| 858 | } |
| 859 | |
| 860 | Status EndObjectImpl() { |
| 861 | auto parent = builder_stack_.back(); |
nothing calls this directly
no test coverage detected