MCPcopy Create free account
hub / github.com/apache/arrow / ReadOneBatchJson

Function ReadOneBatchJson

cpp/src/arrow/integration/json_integration_test.cc:999–1010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997}
998
999static void ReadOneBatchJson(const char* json, const Schema& expected_schema,
1000 std::shared_ptr<RecordBatch>* out) {
1001 auto buffer = Buffer::Wrap(json, strlen(json));
1002
1003 ASSERT_OK_AND_ASSIGN(auto reader, IntegrationJsonReader::Open(buffer));
1004
1005 AssertSchemaEqual(*reader->schema(), expected_schema, /*check_metadata=*/true);
1006 ASSERT_EQ(1, reader->num_record_batches());
1007
1008 ASSERT_OK_AND_ASSIGN(*out, reader->ReadRecordBatch(0));
1009 ASSERT_OK((*out)->ValidateFull());
1010}
1011
1012TEST(TestJsonFileReadWrite, JsonExample1) {
1013 Schema ex_schema({field("foo", int32()), field("bar", float64())});

Callers 1

TESTFunction · 0.85

Calls 6

WrapFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.50
schemaMethod · 0.45
num_record_batchesMethod · 0.45
ReadRecordBatchMethod · 0.45
ValidateFullMethod · 0.45

Tested by

no test coverage detected