| 160 | class JsonScanMixin { |
| 161 | public: |
| 162 | void TestScanWithBOM() { |
| 163 | auto source = ToFileSource( |
| 164 | "\xef\xbb\xbf{\"ab\":0,\"cd\":\"foo\"}\n{\"ab\":1,\"cd\":\"bar\"}\n"); |
| 165 | auto fragment = this_->MakeFragment(*source); |
| 166 | auto dataset_schema = schema({field("ab", int64()), field("cd", utf8())}); |
| 167 | this_->SetSchema(dataset_schema->fields()); |
| 168 | this_->SetJsonOptions(); |
| 169 | |
| 170 | int64_t num_rows = 0; |
| 171 | for (auto maybe_batch : this_->Batches(fragment)) { |
| 172 | ASSERT_OK_AND_ASSIGN(auto batch, maybe_batch); |
| 173 | AssertSchemaEqual(dataset_schema, batch->schema()); |
| 174 | num_rows += batch->num_rows(); |
| 175 | } |
| 176 | |
| 177 | ASSERT_EQ(num_rows, 2); |
| 178 | } |
| 179 | |
| 180 | void TestScanWithCustomParseOptions() { |
| 181 | auto source = ToFileSource("{\n\"i\":0\n}\n{\n\"i\":1\n}"); |
nothing calls this directly
no test coverage detected