lidavidm commented on code in PR #13088:
URL: https://github.com/apache/arrow/pull/13088#discussion_r868251835


##########
cpp/src/arrow/dataset/dataset.cc:
##########
@@ -202,11 +202,7 @@ Result<FragmentIterator> 
InMemoryDataset::GetFragmentsImpl(compute::Expression)
 
   auto create_fragment =
       [schema](std::shared_ptr<RecordBatch> batch) -> 
Result<std::shared_ptr<Fragment>> {
-    if (!batch->schema()->Equals(schema)) {
-      return Status::TypeError("yielded batch had schema ", *batch->schema(),
-                               " which did not match InMemorySource's: ", 
*schema);
-    }
-
+    RETURN_NOT_OK(CheckProjectable(*schema, *batch->schema()));

Review Comment:
   It _feels_ like this could be a construction-time check to avoid repeated 
checking except there is no way to return a Status there, unfortunately. (Not a 
big deal, though.)



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to