MCPcopy Create free account
hub / github.com/apache/arrow / Slice

Method Slice

cpp/src/arrow/compute/exec.cc:133–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133ExecBatch ExecBatch::Slice(int64_t offset, int64_t length) const {
134 ExecBatch out = *this;
135 for (auto& value : out.values) {
136 if (value.is_scalar()) {
137 // keep value as is
138 } else if (value.is_array()) {
139 value = value.array()->Slice(offset, length);
140 } else if (value.is_chunked_array()) {
141 value = value.chunked_array()->Slice(offset, length);
142 } else {
143 ARROW_DCHECK(false);
144 }
145 }
146 out.length = std::min(length, this->length - offset);
147 return out;
148}
149
150Result<ExecBatch> ExecBatch::SelectValues(const std::vector<int>& ids) const {
151 std::vector<Datum> selected_values;

Callers 15

TEST_FFunction · 0.45
SlicedArrayFactoryMethod · 0.45
SlicedArrayFactoryMethod · 0.45
NextMethod · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
CheckIterationMethod · 0.45
DoTestMethod · 0.45
TESTFunction · 0.45
GenericTestSliceFunction · 0.45

Calls 4

is_scalarMethod · 0.80
is_arrayMethod · 0.80
chunked_arrayMethod · 0.80
arrayMethod · 0.45

Tested by 15

TEST_FFunction · 0.36
SlicedArrayFactoryMethod · 0.36
SlicedArrayFactoryMethod · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
CheckIterationMethod · 0.36
DoTestMethod · 0.36
TESTFunction · 0.36
GenericTestSliceFunction · 0.36
TYPED_TESTFunction · 0.36
TESTFunction · 0.36
CheckModeWithRangeSlicedFunction · 0.36