| 870 | } |
| 871 | |
| 872 | Status UnpackSchemaMessage(const void* opaque_schema, const IpcReadOptions& options, |
| 873 | DictionaryMemo* dictionary_memo, |
| 874 | std::shared_ptr<Schema>* schema, |
| 875 | std::shared_ptr<Schema>* out_schema, |
| 876 | std::vector<bool>* field_inclusion_mask, |
| 877 | Endianness* original_endianness, bool* swap_endian) { |
| 878 | RETURN_NOT_OK(internal::GetSchema(opaque_schema, dictionary_memo, schema)); |
| 879 | |
| 880 | // If we are selecting only certain fields, populate the inclusion mask now |
| 881 | // for fast lookups |
| 882 | RETURN_NOT_OK(GetInclusionMaskAndOutSchema(*schema, options.included_fields, |
| 883 | field_inclusion_mask, out_schema)); |
| 884 | *original_endianness = out_schema->get()->endianness(); |
| 885 | *swap_endian = options.ensure_native_endian && !out_schema->get()->is_native_endian(); |
| 886 | if (*swap_endian) { |
| 887 | // create a new schema with native endianness before swapping endian in ArrayData |
| 888 | *schema = schema->get()->WithEndianness(Endianness::Native); |
| 889 | *out_schema = out_schema->get()->WithEndianness(Endianness::Native); |
| 890 | } |
| 891 | return Status::OK(); |
| 892 | } |
| 893 | |
| 894 | Status UnpackSchemaMessage(const Message& message, const IpcReadOptions& options, |
| 895 | DictionaryMemo* dictionary_memo, |
no test coverage detected