nealrichardson commented on code in PR #19706:
URL: https://github.com/apache/arrow/pull/19706#discussion_r1072597692
##########
r/src/expression.cpp:
##########
@@ -46,13 +46,26 @@ std::shared_ptr<compute::Expression>
compute___expr__call(std::string func_name,
compute::call(std::move(func_name), std::move(arguments),
std::move(options_ptr)));
}
+// [[arrow::export]]
+bool compute___expr__is_field_ref(const std::shared_ptr<compute::Expression>&
x) {
+ return x->field_ref() != nullptr;
+}
+
// [[arrow::export]]
std::vector<std::string> field_names_in_expression(
const std::shared_ptr<compute::Expression>& x) {
std::vector<std::string> out;
+ std::vector<arrow::FieldRef> nested;
+
auto field_refs = FieldsInExpression(*x);
for (auto f : field_refs) {
- out.push_back(*f.name());
+ if (f.IsNested()) {
+ // We keep the top-level field name.
Review Comment:
This function is only used to prune columns in the dataset scanner, and IIRC
that interface accepts column names, not FieldRefs, so I need the names of the
top-level columns. But if I'm mistaken and we can use FieldRefs there now, we
can refactor this.
--
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]