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