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

Function ReadOneBatchJson

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

Source from the content-addressed store, hash-verified

1000}
1001
1002static void ReadOneBatchJson(const char* json, const Schema& expected_schema,
1003 std::shared_ptr<RecordBatch>* out) {
1004 auto buffer = Buffer::Wrap(json, strlen(json));
1005
1006 ASSERT_OK_AND_ASSIGN(auto reader, IntegrationJsonReader::Open(buffer));
1007
1008 AssertSchemaEqual(*reader->schema(), expected_schema, /*check_metadata=*/true);
1009 ASSERT_EQ(1, reader->num_record_batches());
1010
1011 ASSERT_OK_AND_ASSIGN(*out, reader->ReadRecordBatch(0));
1012 ASSERT_OK((*out)->ValidateFull());
1013}
1014
1015TEST(TestJsonFileReadWrite, JsonExample1) {
1016 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