Skip to content

Commit

Permalink
Fixing some renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
zanmato1984 committed Nov 6, 2024
1 parent 9e9ccb0 commit bd334fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cpp/src/arrow/compute/api_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ class ARROW_EXPORT InversePermutationOptions : public FunctionOptions {
static InversePermutationOptions Defaults() { return InversePermutationOptions(); }

/// \brief The max value in the input indices to process. Any indices that are greater
/// to this length will be ignored. If negative, this value will be set to the length of
/// the input indices minus 1.
/// than this value will be ignored. If negative, this value will be set to the length
/// of the input indices minus 1.
int64_t max_index = -1;
/// \brief The type of the output inverse permutation. If null, the output will be of
/// the same type as the input indices, otherwise must be integer types. An invalid
Expand All @@ -284,7 +284,7 @@ class ARROW_EXPORT ScatterOptions : public FunctionOptions {
static ScatterOptions Defaults() { return ScatterOptions(); }

/// \brief The max value in the input indices to process. Any values with indices that
/// are greater to this length will be ignored. If negative, this value will be set to
/// are greater than this value will be ignored. If negative, this value will be set to
/// the length of the input minus 1.
int64_t max_index = -1;
};
Expand Down
5 changes: 2 additions & 3 deletions cpp/src/arrow/compute/kernels/vector_swizzle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ struct InversePermutationImpl {
// buffer is preallocated and filled with all "impossible" values (that is,
// input_length - note that the range of inverse_permutation is [0, input_length)) for
// the subsequent processing to detect validity.
bool likely_many_nulls = LikelyManyNulls();
if (likely_many_nulls) {
if (LikelyManyNulls()) {
RETURN_NOT_OK(AllocateValidityBufAndFill(false));
RETURN_NOT_OK(AllocateDataBuf(output_type));
return Execute<Type, true>();
Expand Down Expand Up @@ -158,7 +157,7 @@ struct InversePermutationImpl {

ARROW_ASSIGN_OR_RAISE(validity_buf, ctx->AllocateBitmap(output_length));
auto validity = validity_buf->mutable_data_as<uint8_t>();
std::memset(validity, valid ? 0xff : 0, bit_util::BytesForBits(output_length));
std::memset(validity, valid ? 0xff : 0, validity_buf->size());

return Status::OK();
}
Expand Down
6 changes: 3 additions & 3 deletions docs/source/cpp/compute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ operation to the n-th and (n+abs(p))-th inputs.
Swizzle functions
~~~~~~~~~~~~~~~~~~~

Swizzle functions reorder the input array based on targeting indices.
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 |
Expand All @@ -1916,10 +1916,10 @@ Swizzle functions reorder the input array based on targeting indices.

* \(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 >= output_length``, it is ignored. If multiple indices point
where ``x < 0`` or ``x > max_index``, it is ignored. If multiple indices point
to the same value, the last one is used.

* \(3) For ``indices[i] = x``, ``output[x] = values[i]``. And ``output[x] = null``
if ``x`` does not appear in the input ``indices``. For ``indices[i] = x`` where
``x < 0`` or ``x >= output_length``, ``values[i]`` is ignored. If multiple indices
``x < 0`` or ``x > max_index``, ``values[i]`` is ignored. If multiple indices
point to the same value, the last one is used.

0 comments on commit bd334fe

Please sign in to comment.