MCPcopy Create free account
hub / github.com/apache/arrow / Slice

Method Slice

cpp/src/arrow/record_batch.cc:182–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 }
181
182 std::shared_ptr<RecordBatch> Slice(int64_t offset, int64_t length) const override {
183 std::vector<std::shared_ptr<ArrayData>> arrays;
184 arrays.reserve(num_columns());
185 for (const auto& field : columns_) {
186 arrays.emplace_back(field->Slice(offset, length));
187 }
188 int64_t num_rows = std::min(num_rows_ - offset, length);
189 return std::make_shared<SimpleRecordBatch>(schema_, num_rows, std::move(arrays),
190 device_type_, sync_event_);
191 }
192
193 Status Validate() const override {
194 if (static_cast<int>(columns_.size()) != schema_->num_fields()) {

Callers

nothing calls this directly

Calls 4

emplace_backMethod · 0.80
num_columnsFunction · 0.70
reserveMethod · 0.45
SliceMethod · 0.45

Tested by

no test coverage detected