MCPcopy Create free account
hub / github.com/apache/orc / createColumnPrinter

Function createColumnPrinter

c++/src/ColumnPrinter.cc:227–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225 }
226
227 std::unique_ptr<ColumnPrinter> createColumnPrinter(std::string& buffer, const Type* type,
228 ColumnPrinter::Param param) {
229 std::unique_ptr<ColumnPrinter> result;
230 if (type == nullptr) {
231 result = std::make_unique<VoidColumnPrinter>(buffer, param);
232 } else {
233 switch (static_cast<int64_t>(type->getKind())) {
234 case BOOLEAN:
235 result = std::make_unique<BooleanColumnPrinter>(buffer, param);
236 break;
237
238 case BYTE:
239 case SHORT:
240 case INT:
241 case LONG:
242 result = std::make_unique<LongColumnPrinter>(buffer, param);
243 break;
244
245 case FLOAT:
246 case DOUBLE:
247 result = std::make_unique<DoubleColumnPrinter>(buffer, *type, param);
248 break;
249
250 case STRING:
251 case VARCHAR:
252 case CHAR:
253 result = std::make_unique<StringColumnPrinter>(buffer, param);
254 break;
255
256 case BINARY:
257 case GEOMETRY:
258 case GEOGRAPHY:
259 result = std::make_unique<BinaryColumnPrinter>(buffer, param);
260 break;
261
262 case TIMESTAMP:
263 case TIMESTAMP_INSTANT:
264 result = std::make_unique<TimestampColumnPrinter>(buffer, param);
265 break;
266
267 case LIST:
268 result = std::make_unique<ListColumnPrinter>(buffer, *type, param);
269 break;
270
271 case MAP:
272 result = std::make_unique<MapColumnPrinter>(buffer, *type, param);
273 break;
274
275 case STRUCT:
276 result = std::make_unique<StructColumnPrinter>(buffer, *type, param);
277 break;
278
279 case DECIMAL:
280 if (type->getPrecision() == 0 || type->getPrecision() > 18) {
281 result = std::make_unique<Decimal128ColumnPrinter>(buffer, param);
282 } else {
283 result = std::make_unique<Decimal64ColumnPrinter>(buffer, param);
284 }

Callers 8

TEST_PFunction · 0.85
TESTFunction · 0.85
printContentsFunction · 0.85
TESTFunction · 0.85
ListColumnPrinterMethod · 0.85
MapColumnPrinterMethod · 0.85
UnionColumnPrinterMethod · 0.85
StructColumnPrinterMethod · 0.85

Calls 2

getKindMethod · 0.65
getPrecisionMethod · 0.45

Tested by 3

TEST_PFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68