pitrou commented on code in PR #14495:
URL: https://github.com/apache/arrow/pull/14495#discussion_r1009562881
##########
cpp/src/arrow/compute/kernels/scalar_nested.cc:
##########
@@ -196,9 +196,22 @@ const FunctionDoc list_element_doc(
struct StructFieldFunctor {
static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult*
out) {
const auto& options = OptionsWrapper<StructFieldOptions>::Get(ctx);
-
std::shared_ptr<Array> current = MakeArray(batch[0].array.ToArrayData());
- for (const auto& index : options.indices) {
+
+ // Specific struct handling
Review Comment:
I don't understand why this is special-cased. I would intuitively expect the
following process:
1) compute a `FieldPath` using `FieldRef::FindOne`
2) Loop over the indices of the `FieldPath` in the loop below
##########
cpp/src/arrow/compute/kernels/scalar_nested.cc:
##########
@@ -196,9 +196,22 @@ const FunctionDoc list_element_doc(
struct StructFieldFunctor {
static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult*
out) {
const auto& options = OptionsWrapper<StructFieldOptions>::Get(ctx);
-
std::shared_ptr<Array> current = MakeArray(batch[0].array.ToArrayData());
- for (const auto& index : options.indices) {
+
+ // Specific struct handling
Review Comment:
I don't understand why this is special-cased. I would intuitively expect the
following process:
1) Compute a `FieldPath` using `FieldRef::FindOne`
2) Loop over the indices of the `FieldPath` in the loop below
--
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]