zanmato1984 commented on code in PR #44394:
URL: https://github.com/apache/arrow/pull/44394#discussion_r1879225436


##########
docs/source/cpp/compute.rst:
##########
@@ -1898,3 +1898,28 @@ operation to the n-th and (n+abs(p))-th inputs.
   ``Subtract``. The period can be specified in :struct:`PairwiseOptions`.
 * \(2) Wraps around the result when overflow is detected.
 * \(3) Returns an ``Invalid`` :class:`Status` when overflow is detected.
+
+Swizzle functions
+~~~~~~~~~~~~~~~~~~~
+
+Swizzle functions reorder the input array based on the specified indices.
+
++---------------------+--------+--------------+--------------+--------------+-------------------------------------+-------+
+| Function name       | Arity  | Input type 1 | Input type 2 | Output type  | 
Options class                       | Notes |
++=====================+========+==============+==============+==============+=====================================+=======+
+| inverse_permutation | Unary  | Integer      |              | Integer \(1) | 
:struct:`InversePermutationOptions` | \(2)  |
++---------------------+--------+--------------+--------------+--------------+-------------------------------------+-------+
+| scatter             | Binary | Any          | Integer      | Input type 1 | 
:struct:`ScatterOptions`            | \(3)  |
++---------------------+--------+--------------+--------------+--------------+-------------------------------------+-------+
+
+* \(1) The output type is specified in :struct:`InversePermutationOptions`.
+
+* \(2) For ``indices[i] = x``, ``inverse_permutation[x] = i``. And 
``inverse_permutation[x]
+ = null`` if ``x`` does not appear in the input ``indices``. For ``indices[i] 
= x``
+ where ``x < 0`` or ``x > max_index``, it is ignored. If multiple indices point
+ to the same value, the last one is used.

Review Comment:
   It is allowed and null indices will be ignored. And allowing null values is 
very useful for the "special form" case (I'll put definition/link about 
"special form" later). So I'd better add description about this behavior in the 
doc?



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