Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/src/arrow/compute/api_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class ARROW_EXPORT SelectKOptions : public FunctionOptions {
int64_t k;
/// Column key(s) to order by and how to order by these sort keys.
std::vector<SortKey> sort_keys;
NullPlacement null_placement = NullPlacement::AtEnd;
};

/// \brief Partitioning options for NthToIndices
Expand Down
13 changes: 12 additions & 1 deletion cpp/src/arrow/compute/kernels/chunked_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ struct ResolvedChunk {
// The index in the target array.
const int64_t index;

ResolvedChunk() : index(-1) {}

ResolvedChunk(const ArrayType* array, int64_t index) : array(array), index(index) {}

bool IsNull() const { return array->IsNull(index); }
Expand Down Expand Up @@ -139,11 +141,20 @@ struct ChunkedArrayResolver : protected ChunkResolver {

template <typename ArrayType>
ResolvedChunk<ArrayType> Resolve(int64_t index) const {
const auto loc = ChunkResolver::Resolve(index);
const auto loc = ResolveChunkLocation(index);
return Resolve<ArrayType>(loc);
}

template <typename ArrayType>
ResolvedChunk<ArrayType> Resolve(ChunkLocation loc) const {
return ResolvedChunk<ArrayType>(
checked_cast<const ArrayType*>(chunks_[loc.chunk_index]), loc.index_in_chunk);
}

ChunkLocation ResolveChunkLocation(int64_t index) const {
return ChunkResolver::Resolve(index);
}

protected:
static std::vector<int64_t> MakeLengths(const std::vector<const Array*>& chunks) {
std::vector<int64_t> lengths(chunks.size());
Expand Down
Loading