| 59 | }; |
| 60 | |
| 61 | std::shared_ptr<Array> SliceArrayFromJSON(const std::shared_ptr<DataType>& ty, |
| 62 | std::string_view json, int64_t offset = 0, |
| 63 | int64_t length = -1) { |
| 64 | auto array = *ArrayFromJSONString(ty, json); |
| 65 | if (length != -1) { |
| 66 | return array->Slice(offset, length); |
| 67 | } else { |
| 68 | return array->Slice(offset); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | } // namespace |
| 73 |