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

Function ViewOrCastChunkedArray

cpp/src/parquet/arrow/reader_internal.cc:288–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288Result<std::shared_ptr<ChunkedArray>> ViewOrCastChunkedArray(
289 const std::shared_ptr<ChunkedArray>& array, MemoryPool* pool,
290 const std::shared_ptr<DataType>& logical_value_type) {
291 auto view_result = array->View(logical_value_type);
292 if (view_result.ok()) {
293 return view_result.ValueOrDie();
294 } else {
295 ::arrow::compute::ExecContext exec_context(pool);
296 ARROW_ASSIGN_OR_RAISE(
297 auto casted_datum,
298 ::arrow::compute::Cast(Datum(array), logical_value_type,
299 ::arrow::compute::CastOptions(), &exec_context));
300 return casted_datum.chunked_array();
301 }
302}
303
304} // namespace
305

Callers 1

TransferDictionaryFunction · 0.85

Calls 4

ValueOrDieMethod · 0.80
chunked_arrayMethod · 0.80
ViewMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected