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

Method Slice

cpp/src/arrow/record_batch.cc:181–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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