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

Function ToPhysicalData

cpp/src/arrow/compute/kernels/vector_search_sorted.cc:208–223  ·  view source on GitHub ↗

Convert ArrayData to its physical representation so that typed accessors can be constructed with a physical ArrowType (e.g. Date32 → Int32). For REE arrays, only the values child type is converted; the REE wrapper type stays unchanged.

Source from the content-addressed store, hash-verified

206// For REE arrays, only the values child type is converted; the REE wrapper
207// type stays unchanged.
208std::shared_ptr<ArrayData> ToPhysicalData(
209 const std::shared_ptr<ArrayData>& data,
210 const std::shared_ptr<DataType>& physical_type) {
211 if (data->type->id() == Type::RUN_END_ENCODED) {
212 const auto& ree_type = checked_cast<const RunEndEncodedType&>(*data->type);
213 auto result = data->Copy();
214 auto values_copy = result->child_data[1]->Copy();
215 values_copy->type = physical_type;
216 result->type = run_end_encoded(ree_type.run_end_type(), physical_type);
217 result->child_data[1] = std::move(values_copy);
218 return result;
219 }
220 auto result = data->Copy();
221 result->type = physical_type;
222 return result;
223}
224
225/// Read a run-end value from any supported run-end integer representation.
226int64_t GetRunEndValue(const ArraySpan& run_ends, int64_t physical_index) {

Callers 1

VisitArrayNeedleRunsFunction · 0.85

Calls 3

run_end_encodedFunction · 0.85
idMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected