| 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"); |