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

Function RecordBatchReader__Head

r/src/recordbatchreader.cpp:188–198  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

186
187// [[arrow::export]]
188std::shared_ptr<arrow::RecordBatchReader> RecordBatchReader__Head(
189 const std::shared_ptr<arrow::RecordBatchReader>& reader, int64_t num_rows) {
190 if (num_rows <= 0) {
191 // If we are never going to pull any batches from this reader, close it
192 // immediately.
193 StopIfNotOk(reader->Close());
194 return ValueOrStop(arrow::RecordBatchReader::Make({}, reader->schema()));
195 } else {
196 return std::make_shared<RecordBatchReaderHead>(reader, num_rows);
197 }
198}
199
200// Some types of RecordBatchReader input (e.g., DuckDB output) will crash or hang
201// if scanned from another thread (e.g., by an ExecPlan). This RecordBatchReader

Callers 1

Calls 5

StopIfNotOkFunction · 0.85
ValueOrStopFunction · 0.85
MakeFunction · 0.50
CloseMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected