lidavidm commented on pull request #9802:
URL: https://github.com/apache/arrow/pull/9802#issuecomment-809437568
Aha, the reason why scanning a fragment is empty is because it gets
constructed with an empty schema due to a spot of undefined behavior.
```cpp
InMemoryFragment::InMemoryFragment(RecordBatchVector record_batches,
Expression partition_expression)
: InMemoryFragment(record_batches.empty() ? schema({}) :
record_batches[0]->schema(),
std::move(record_batches),
std::move(partition_expression)) {}
```
This might move record_batches before we evaluate empty(), resulting in an
empty schema getting passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]