bkietz commented on a change in pull request #9725:
URL: https://github.com/apache/arrow/pull/9725#discussion_r596084650



##########
File path: cpp/src/arrow/dataset/dataset_internal.h
##########
@@ -185,5 +185,14 @@ inline bool operator==(const SubtreeImpl::Encoded& l, 
const SubtreeImpl::Encoded
          l.partition_expression == r.partition_expression;
 }
 
+template <typename T>
+std::shared_ptr<T> DowncastFragmentScanOptions(
+    const std::shared_ptr<ScanOptions>& scan_options, const std::string& 
type_name) {
+  if (!scan_options) return nullptr;
+  if (!scan_options->fragment_scan_options) return nullptr;
+  if (scan_options->fragment_scan_options->type_name() != type_name) return 
nullptr;

Review comment:
       I think this should be an error
   ```suggestion
     if (scan_options->fragment_scan_options->type_name() != type_name) {
       return Status::Invalid("FragmentScanOptions of type ", 
scan_options->fragment_scan_options->type_name(),
           " were provided for scanning a fragment of type ", type_name);
     }
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to