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

Function CheckPrimitive

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

Source from the content-addressed store, hash-verified

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