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

Function CheckPrimitive

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

Source from the content-addressed store, hash-verified

771
772template <typename T, typename ValueType>
773void CheckPrimitive(const std::shared_ptr<DataType>& type,
774 const std::vector<bool>& is_valid,
775 const std::vector<ValueType>& values) {
776 MemoryPool* pool = default_memory_pool();
777 typename TypeTraits<T>::BuilderType builder(pool);
778
779 for (size_t i = 0; i < values.size(); ++i) {
780 if (is_valid[i]) {
781 ASSERT_OK(builder.Append(values[i]));
782 } else {
783 ASSERT_OK(builder.AppendNull());
784 }
785 }
786
787 std::shared_ptr<Array> array;
788 ASSERT_OK(builder.Finish(&array));
789 TestArrayRoundTrip(*array);
790}
791
792TEST(TestJsonSchemaWriter, FlatTypes) {
793 std::vector<std::shared_ptr<Field>> fields = {

Callers

nothing calls this directly

Calls 6

default_memory_poolFunction · 0.85
TestArrayRoundTripFunction · 0.85
sizeMethod · 0.45
AppendMethod · 0.45
AppendNullMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected