westonpace commented on code in PR #35798:
URL: https://github.com/apache/arrow/pull/35798#discussion_r1240528021
##########
cpp/src/arrow/dataset/file_parquet.cc:
##########
@@ -224,6 +224,41 @@ Status ResolveOneFieldRef(
return Status::OK();
}
+bool IsNamedFieldRef(const FieldRef& ref) {
+ if (ref.IsName()) return true;
+ if (const auto* nested_refs = ref.nested_refs()) {
+ for (const auto& nested_ref : *nested_refs) {
+ if (!nested_ref.IsName()) return false;
+ }
+ return true;
+ }
+ return false;
+}
Review Comment:
I don't think it's too niche. I feel like I have run into situations a few
times now in the scanner where I've needed to know if a ref is all-names,
all-indices, or mixed (a lot of the new scanner stuff normalizes to
all-indices). We do have FieldPath already which is a flat vector of indices.
--
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]