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

Function SampleSchemas

cpp/src/arrow/type_benchmark.cc:101–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static std::vector<std::shared_ptr<Schema>> SampleSchemas() {
102 auto fa1 = field("as", list(float16()));
103 auto fa2 = field("as", list(float16()));
104 auto fb1 = field("bs", utf8());
105 auto fb2 = field("bs", utf8());
106 auto fc1 = field("cs", list(fixed_size_binary(10)));
107 auto fc2 = field("cs", list(fixed_size_binary(10)));
108 auto fd1 = field("ds", decimal128(19, 5));
109 auto fd2 = field("ds", decimal128(19, 5));
110 auto fe1 = field("es", map(utf8(), int32()));
111 auto fe2 = field("es", map(utf8(), int32()));
112 auto ff1 = field("fs", dictionary(int8(), binary()));
113 auto ff2 = field("fs", dictionary(int8(), binary()));
114 auto fg1 = field(
115 "gs", struct_({field("A", int8()), field("B", int16()), field("C", float32())}));
116 auto fg2 = field(
117 "gs", struct_({field("A", int8()), field("B", int16()), field("C", float32())}));
118 auto fh1 = field("hs", large_binary());
119 auto fh2 = field("hs", large_binary());
120
121 auto fz1 = field("zs", duration(TimeUnit::MICRO));
122 auto fz2 = field("zs", duration(TimeUnit::MICRO));
123 auto fz3 = field("zs", duration(TimeUnit::NANO));
124
125 auto schema1 = ::arrow::schema({fa1, fb1, fc1, fd1, fe1, ff1, fg1, fh1, fz1});
126 auto schema2 = ::arrow::schema({fa2, fb2, fc2, fd2, fe2, ff2, fg2, fh2, fz2});
127 auto schema3 = ::arrow::schema({fa2, fb2, fc2, fd2, fe2, ff2, fg2, fh2, fz3});
128
129 return {schema1, schema2, schema3};
130}
131
132static void SchemaEquals(benchmark::State& state) { // NOLINT non-const reference
133 auto schemas = SampleSchemas();

Callers 2

SchemaEqualsFunction · 0.85
SchemaEqualsWithMetadataFunction · 0.85

Calls 9

listFunction · 0.85
fixed_size_binaryFunction · 0.85
mapFunction · 0.85
struct_Function · 0.85
fieldFunction · 0.70
decimal128Function · 0.70
dictionaryFunction · 0.70
durationFunction · 0.70
schemaFunction · 0.70

Tested by

no test coverage detected