| 1798 | public ::testing::TestWithParam<MakeRecordBatch*> {}; |
| 1799 | |
| 1800 | Status MakeDictionaryBatch(std::shared_ptr<RecordBatch>* out) { |
| 1801 | auto f0_type = arrow::dictionary(int32(), utf8()); |
| 1802 | auto f1_type = arrow::dictionary(int8(), utf8()); |
| 1803 | |
| 1804 | auto dict = ArrayFromJSON(utf8(), "[\"foo\", \"bar\", \"baz\"]"); |
| 1805 | |
| 1806 | auto indices0 = ArrayFromJSON(int32(), "[1, 2, null, 0, 2, 0]"); |
| 1807 | auto indices1 = ArrayFromJSON(int8(), "[0, 0, 2, 2, 1, 1]"); |
| 1808 | |
| 1809 | auto a0 = std::make_shared<DictionaryArray>(f0_type, indices0, dict); |
| 1810 | auto a1 = std::make_shared<DictionaryArray>(f1_type, indices1, dict); |
| 1811 | |
| 1812 | // construct batch |
| 1813 | auto schema = ::arrow::schema({field("dict1", f0_type), field("dict2", f1_type)}); |
| 1814 | |
| 1815 | *out = RecordBatch::Make(schema, 6, {a0, a1}); |
| 1816 | return Status::OK(); |
| 1817 | } |
| 1818 | |
| 1819 | // A utility that supports reading/writing record batches, |
| 1820 | // and manually specifying dictionaries. |
no test coverage detected