Skip to content
Open
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
2 changes: 1 addition & 1 deletion cpp/src/arrow/array/concatenate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class ConcatenateImpl {
out_->buffers.resize(2);

for (const auto& in_data : in_) {
for (const auto& buf : util::span(in_data->buffers).subspan(2)) {
for (const auto& buf : std::span(in_data->buffers).subspan(2)) {
out_->buffers.push_back(buf);
}
}
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/array/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool DictionaryMayHaveLogicalNulls(const ArrayData& data) {

namespace {

BufferSpan PackVariadicBuffers(util::span<const std::shared_ptr<Buffer>> buffers) {
BufferSpan PackVariadicBuffers(std::span<const std::shared_ptr<Buffer>> buffers) {
return {const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(buffers.data())),
static_cast<int64_t>(buffers.size() * sizeof(std::shared_ptr<Buffer>))};
}
Expand Down Expand Up @@ -322,7 +322,7 @@ void ArraySpan::SetMembers(const ArrayData& data) {

if (type_id == Type::STRING_VIEW || type_id == Type::BINARY_VIEW) {
// store the span of data buffers in the third buffer
this->buffers[2] = internal::PackVariadicBuffers(util::span(data.buffers).subspan(2));
this->buffers[2] = internal::PackVariadicBuffers(std::span(data.buffers).subspan(2));
}

if (type_id == Type::DICTIONARY) {
Expand Down Expand Up @@ -679,7 +679,7 @@ std::shared_ptr<ArrayData> ArraySpan::ToArrayData() const {
return result;
}

util::span<const std::shared_ptr<Buffer>> ArraySpan::GetVariadicBuffers() const {
std::span<const std::shared_ptr<Buffer>> ArraySpan::GetVariadicBuffers() const {
DCHECK(HasVariadicBuffers());
return {buffers[2].data_as<std::shared_ptr<Buffer>>(),
static_cast<size_t>(buffers[2].size) / sizeof(std::shared_ptr<Buffer>)};
Expand Down
13 changes: 6 additions & 7 deletions cpp/src/arrow/array/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <cassert>
#include <cstdint>
#include <memory>
#include <span>
#include <utility>
#include <vector>

Expand All @@ -31,9 +32,7 @@
#include "arrow/type_fwd.h"
#include "arrow/util/bit_util.h"
#include "arrow/util/macros.h"
#include "arrow/util/span.h"
#include "arrow/util/visibility.h"

namespace arrow {

namespace internal {
Expand Down Expand Up @@ -577,11 +576,11 @@ struct ARROW_EXPORT ArraySpan {
/// this array type
/// \return A span<const T> of the requested length
template <typename T>
util::span<const T> GetSpan(int i, int64_t length) const {
std::span<const T> GetSpan(int i, int64_t length) const {
const int64_t buffer_length = buffers[i].size / static_cast<int64_t>(sizeof(T));
assert(i > 0 && length + offset <= buffer_length);
ARROW_UNUSED(buffer_length);
return util::span<const T>(buffers[i].data_as<T>() + this->offset, length);
return std::span<const T>(buffers[i].data_as<T>() + this->offset, length);
}

/// \brief Access a buffer's data as a span
Expand All @@ -593,11 +592,11 @@ struct ARROW_EXPORT ArraySpan {
/// this array type
/// \return A span<T> of the requested length
template <typename T>
util::span<T> GetSpan(int i, int64_t length) {
std::span<T> GetSpan(int i, int64_t length) {
const int64_t buffer_length = buffers[i].size / static_cast<int64_t>(sizeof(T));
assert(i > 0 && length + offset <= buffer_length);
ARROW_UNUSED(buffer_length);
return util::span<T>(buffers[i].mutable_data_as<T>() + this->offset, length);
return std::span<T>(buffers[i].mutable_data_as<T>() + this->offset, length);
}

inline bool IsNull(int64_t i) const { return !IsValid(i); }
Expand Down Expand Up @@ -709,7 +708,7 @@ struct ARROW_EXPORT ArraySpan {
/// sizeof(shared_ptr<Buffer>).
///
/// \see HasVariadicBuffers
util::span<const std::shared_ptr<Buffer>> GetVariadicBuffers() const;
std::span<const std::shared_ptr<Buffer>> GetVariadicBuffers() const;
bool HasVariadicBuffers() const;

private:
Expand Down
6 changes: 2 additions & 4 deletions cpp/src/arrow/array/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
// specific language governing permissions and limitations
// under the License.

#include "arrow/array/util.h"

#include <algorithm>
#include <array>
#include <cstdint>
#include <cstring>
#include <limits>
#include <memory>
#include <span>
#include <type_traits>
#include <utility>
#include <vector>

#include "arrow/array/util.h"
#include "arrow/array.h"
#include "arrow/array/builder_base.h"
#include "arrow/array/concatenate.h"
Expand All @@ -44,10 +44,8 @@
#include "arrow/util/endian.h"
#include "arrow/util/logging_internal.h"
#include "arrow/util/sort_internal.h"
#include "arrow/util/span.h"
#include "arrow/visit_data_inline.h"
#include "arrow/visit_type_inline.h"

namespace arrow {

using internal::checked_cast;
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/array/validate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,9 @@ struct ValidateArrayImpl {
HexEncode(data, BinaryViewType::kPrefixSize));
};

util::span views(data.GetValues<BinaryViewType::c_type>(1),
std::span views(data.GetValues<BinaryViewType::c_type>(1),
static_cast<size_t>(data.length));
util::span data_buffers(data.buffers.data() + 2, data.buffers.size() - 2);
std::span data_buffers(data.buffers.data() + 2, data.buffers.size() - 2);

for (size_t i = 0; i < static_cast<size_t>(data.length); ++i) {
if (data.IsNull(i)) continue;
Expand All @@ -663,7 +663,7 @@ struct ValidateArrayImpl {
}

if (views[i].is_inline()) {
auto padding_bytes = util::span(views[i].inlined.data).subspan(views[i].size());
auto padding_bytes = std::span(views[i].inlined.data).subspan(views[i].size());
for (auto padding_byte : padding_bytes) {
if (padding_byte != 0) {
return Status::Invalid("View at slot ", i, " was inline with size ",
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/arrow/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <cstring>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <utility>
Expand All @@ -30,7 +31,6 @@
#include "arrow/status.h"
#include "arrow/type_fwd.h"
#include "arrow/util/macros.h"
#include "arrow/util/span.h"
#include "arrow/util/visibility.h"

namespace arrow {
Expand Down Expand Up @@ -236,8 +236,8 @@ class ARROW_EXPORT Buffer {

/// \brief Return the buffer's data as a span
template <typename T>
util::span<const T> span_as() const {
return util::span(data_as<T>(), static_cast<size_t>(size() / sizeof(T)));
std::span<const T> span_as() const {
return std::span(data_as<T>(), static_cast<size_t>(size() / sizeof(T)));
}

/// \brief Return a writable pointer to the buffer's data
Expand Down Expand Up @@ -269,8 +269,8 @@ class ARROW_EXPORT Buffer {

/// \brief Return the buffer's mutable data as a span
template <typename T>
util::span<T> mutable_span_as() {
return util::span(mutable_data_as<T>(), static_cast<size_t>(size() / sizeof(T)));
std::span<T> mutable_span_as() {
return std::span(mutable_data_as<T>(), static_cast<size_t>(size() / sizeof(T)));
}

/// \brief Return the device address of the buffer's data
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/c/bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ struct ArrayExporter {
});

if (need_variadic_buffer_sizes) {
auto variadic_buffers = util::span(data->buffers).subspan(2);
auto variadic_buffers = std::span(data->buffers).subspan(2);
export_.variadic_buffer_sizes_.resize(variadic_buffers.size());
size_t i = 0;
for (const auto& buf : variadic_buffers) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/c/bridge_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ struct ArrayExportChecker {
ASSERT_EQ(c_export->buffers[i], expected_ptr);
}
if (has_variadic_buffer_sizes) {
auto variadic_buffers = util::span(expected_data.buffers).subspan(2);
auto variadic_buffer_sizes = util::span(
auto variadic_buffers = std::span(expected_data.buffers).subspan(2);
auto variadic_buffer_sizes = std::span(
static_cast<const int64_t*>(c_export->buffers[c_export->n_buffers - 1]),
variadic_buffers.size());
for (auto [buf, size] : Zip(variadic_buffers, variadic_buffer_sizes)) {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/chunk_resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace arrow {

using util::span;
using std::span;

namespace {
template <typename T>
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/chunk_resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
#include <cassert>
#include <cstdint>
#include <limits>
#include <span>
#include <type_traits>
#include <vector>

#include "arrow/type_fwd.h"
#include "arrow/util/macros.h"
#include "arrow/util/span.h"

namespace arrow {

Expand Down Expand Up @@ -77,7 +77,7 @@ class ARROW_EXPORT ChunkResolver {

public:
explicit ChunkResolver(const ArrayVector& chunks) noexcept;
explicit ChunkResolver(util::span<const Array* const> chunks) noexcept;
explicit ChunkResolver(std::span<const Array* const> chunks) noexcept;
explicit ChunkResolver(const RecordBatchVector& batches) noexcept;

/// \brief Construct a ChunkResolver from a vector of chunks.size() + 1 offsets.
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/aggregate_pivot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace arrow::compute::internal {
namespace {

using arrow::internal::VisitSetBitRunsVoid;
using arrow::util::span;
using std::span;

struct PivotImpl : public ScalarAggregator {
Status Init(const PivotWiderOptions& options, const std::vector<TypeHolder>& in_types,
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/chunked_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::vector<const Array*> GetArrayPointers(const ArrayVector& arrays) {
}

std::vector<int64_t> ChunkedIndexMapper::GetChunkLengths(
util::span<const Array* const> chunks) {
std::span<const Array* const> chunks) {
std::vector<int64_t> chunk_lengths(chunks.size());
for (int64_t i = 0; i < static_cast<int64_t>(chunks.size()); ++i) {
chunk_lengths[i] = chunks[i]->length();
Expand Down
13 changes: 6 additions & 7 deletions cpp/src/arrow/compute/kernels/chunked_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
#include <algorithm>
#include <cstdint>
#include <memory>
#include <span>
#include <utility>
#include <vector>

#include "arrow/array.h"
#include "arrow/chunk_resolver.h"
#include "arrow/compute/kernels/codegen_internal.h"
#include "arrow/util/span.h"
#include "arrow/util/visibility.h"

namespace arrow::compute::internal {

// The target chunk in a chunked array.
Expand Down Expand Up @@ -92,13 +91,13 @@ static_assert(sizeof(uint64_t) == sizeof(CompressedChunkLocation));
class ChunkedArrayResolver {
private:
ChunkResolver resolver_;
util::span<const Array* const> chunks_;
std::span<const Array* const> chunks_;
std::vector<const Array*> owned_chunks_;

public:
explicit ChunkedArrayResolver(std::vector<const Array*>&& chunks)
: resolver_(chunks), chunks_(chunks), owned_chunks_(std::move(chunks)) {}
explicit ChunkedArrayResolver(util::span<const Array* const> chunks)
explicit ChunkedArrayResolver(std::span<const Array* const> chunks)
: resolver_(chunks), chunks_(chunks) {}

ARROW_DEFAULT_MOVE_AND_ASSIGN(ChunkedArrayResolver);
Expand Down Expand Up @@ -129,8 +128,8 @@ class ARROW_EXPORT ChunkedIndexMapper {
public:
ChunkedIndexMapper(const std::vector<const Array*>& chunks, uint64_t* indices_begin,
uint64_t* indices_end)
: ChunkedIndexMapper(util::span(chunks), indices_begin, indices_end) {}
ChunkedIndexMapper(util::span<const Array* const> chunks, uint64_t* indices_begin,
: ChunkedIndexMapper(std::span(chunks), indices_begin, indices_end) {}
ChunkedIndexMapper(std::span<const Array* const> chunks, uint64_t* indices_begin,
uint64_t* indices_end)
: chunk_lengths_(GetChunkLengths(chunks)),
indices_begin_(indices_begin),
Expand All @@ -154,7 +153,7 @@ class ARROW_EXPORT ChunkedIndexMapper {
Status PhysicalToLogical();

private:
static std::vector<int64_t> GetChunkLengths(util::span<const Array* const> chunks);
static std::vector<int64_t> GetChunkLengths(std::span<const Array* const> chunks);
static std::vector<int64_t> GetChunkLengths(const RecordBatchVector& chunks);

std::vector<int64_t> chunk_lengths_;
Expand Down
5 changes: 2 additions & 3 deletions cpp/src/arrow/compute/kernels/hash_aggregate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cmath>
#include <functional>
#include <memory>
#include <span>
#include <string>
#include <vector>

Expand All @@ -44,14 +45,12 @@
#include "arrow/util/checked_cast.h"
#include "arrow/util/int_util_overflow.h"
#include "arrow/util/ree_util.h"
#include "arrow/util/span.h"
#include "arrow/visit_type_inline.h"

namespace arrow::compute::internal {

using ::arrow::internal::checked_cast;
using ::arrow::internal::FirstTimeBitmapWriter;
using ::arrow::util::span;
using std::span;

namespace {

Expand Down
3 changes: 1 addition & 2 deletions cpp/src/arrow/compute/kernels/hash_aggregate_numeric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cmath>
#include <functional>
#include <memory>
#include <span>
#include <string>
#include <vector>

Expand All @@ -32,10 +33,8 @@
#include "arrow/compute/row/grouper.h"
#include "arrow/util/checked_cast.h"
#include "arrow/util/int128_internal.h"
#include "arrow/util/span.h"
#include "arrow/util/tdigest_internal.h"
#include "arrow/visit_type_inline.h"

namespace arrow::compute::internal {
namespace {

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/kernels/hash_aggregate_pivot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <memory>
#include <string>
#include <vector>
#include <span>

#include "arrow/array/concatenate.h"
#include "arrow/compute/api_aggregate.h"
Expand All @@ -33,12 +34,11 @@
#include "arrow/util/bit_block_counter.h"
#include "arrow/util/checked_cast.h"
#include "arrow/util/logging_internal.h"
#include "arrow/util/span.h"
#include "arrow/visit_type_inline.h"

namespace arrow::compute::internal {

using ::arrow::util::span;
using std::span;

namespace {

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/pivot_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

namespace arrow::compute::internal {

using ::arrow::util::span;
using std::span;

struct ConcretePivotWiderKeyMapper : public PivotWiderKeyMapper {
Status Init(const DataType& key_type, const PivotWiderOptions* options,
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/vector_rank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace arrow::compute::internal {

using ::arrow::util::span;
using std::span;

namespace {

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/vector_sort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace arrow {

using internal::checked_cast;
using util::span;
using std::span;

namespace compute {
namespace internal {
Expand Down
Loading