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


##########
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:
   I found this API to be awkward -- I think we can do something to make it 
better. I am working on a PR now...



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