| 1165 | namespace { |
| 1166 | |
| 1167 | Status MakeUnionExtension(const std::shared_ptr<DataType>& type, |
| 1168 | std::shared_ptr<RecordBatch>* out) { |
| 1169 | auto storage_type = checked_cast<const ExtensionType&>(*type).storage_type(); |
| 1170 | |
| 1171 | auto f0 = field("f0", type); |
| 1172 | auto f1 = field("f1", type, /*nullable=*/false); |
| 1173 | auto schema = ::arrow::schema({f0, f1}); |
| 1174 | |
| 1175 | auto a0 = ExtensionType::WrapArray( |
| 1176 | type, ArrayFromJSON(storage_type, R"([[0, 1.5], [1, null]])")); |
| 1177 | auto a1 = ExtensionType::WrapArray( |
| 1178 | type, ArrayFromJSON(storage_type, R"([[0, 1.5], [1, "abc"]])")); |
| 1179 | |
| 1180 | *out = RecordBatch::Make(schema, a1->length(), {a0, a1}); |
| 1181 | return Status::OK(); |
| 1182 | } |
| 1183 | |
| 1184 | } // namespace |
| 1185 |
no test coverage detected