MCPcopy Create free account
hub / github.com/apache/orc / createRowBatch

Method createRowBatch

c++/src/Reader.cc:1464–1484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1462 }
1463
1464 std::unique_ptr<ColumnVectorBatch> RowReaderImpl::createRowBatch(uint64_t capacity) const {
1465 // If the read type is specified, then check that the selected schema matches the read type
1466 // on the first call to createRowBatch.
1467 if (schemaEvolution_.getReadType() && selectedSchema_.get() == nullptr) {
1468 auto fileSchema = &getSelectedType();
1469 auto readType = schemaEvolution_.getReadType();
1470 std::set<uint64_t> readColumns, fileColumns;
1471 getColumnIds(readType, readColumns);
1472 getColumnIds(fileSchema, fileColumns);
1473 if (readColumns != fileColumns) {
1474 std::ostringstream ss;
1475 ss << "The selected schema " << fileSchema->toString() << " doesn't match read type "
1476 << readType->toString();
1477 throw SchemaEvolutionError(ss.str());
1478 }
1479 }
1480 const Type& readType =
1481 schemaEvolution_.getReadType() ? *schemaEvolution_.getReadType() : getSelectedType();
1482 return readType.createRowBatch(capacity, *contents_->pool, enableEncodedBlock_,
1483 useTightNumericVector_);
1484 }
1485
1486 void ensureOrcFooter(InputStream* stream, DataBuffer<char>* buffer, uint64_t postscriptLength) {
1487 const std::string MAGIC("ORC");

Callers 15

TEST_PFunction · 0.45
TESTFunction · 0.45
mainFunction · 0.45
printContentsFunction · 0.45
processFileFunction · 0.45
scanFileFunction · 0.45
createMemTestFileFunction · 0.45
TestRangePredicatesFunction · 0.45
TestNoRowsSelectedFunction · 0.45
TestOrPredicatesFunction · 0.45
TestSeekWithPredicatesFunction · 0.45

Calls 5

getColumnIdsFunction · 0.85
getReadTypeMethod · 0.45
getMethod · 0.45
toStringMethod · 0.45

Tested by 15

TEST_PFunction · 0.36
TESTFunction · 0.36
createMemTestFileFunction · 0.36
TestRangePredicatesFunction · 0.36
TestNoRowsSelectedFunction · 0.36
TestOrPredicatesFunction · 0.36
TestSeekWithPredicatesFunction · 0.36