alamb commented on code in PR #6936:
URL: https://github.com/apache/arrow-datafusion/pull/6936#discussion_r1284563552


##########
datafusion/expr/src/expr.rs:
##########
@@ -358,19 +359,57 @@ impl ScalarUDF {
     }
 }
 
-/// Returns the field of a [`arrow::array::ListArray`] or 
[`arrow::array::StructArray`] by key
+/// Key of `GetIndexedFieldKey`.
+/// This structure is needed to separate the responsibilities of the key for 
`DataType::List` and `DataType::Struct`.
+/// If we use index with `DataType::List`, then we use the `list_key` argument 
with `struct_key` equal to `None`.
+/// If we use index with `DataType::Struct`, then we use the `struct_key` 
argument with `list_key` equal to `None`.
+/// `list_key` can be any expression, unlike `struct_key` which can only be 
`ScalarValue::Utf8`.
+#[derive(Clone, PartialEq, Eq, Hash, Debug)]
+pub struct GetIndexedFieldKey {

Review Comment:
   filed https://github.com/apache/arrow-datafusion/issues/7193 to track 
improving this API



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