MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getAsValue

Method getAsValue

src/common/vector/value_vector.cpp:258–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258std::unique_ptr<Value> ValueVector::getAsValue(uint64_t pos) const {
259 auto value = Value::createNullValue(dataType).copy();
260 if (isNull(pos)) {
261 return value;
262 }
263 value->setNull(false);
264 value->dataType = dataType.copy();
265 switch (dataType.getPhysicalType()) {
266 case PhysicalTypeID::INT64: {
267 value->val.int64Val = getValue<int64_t>(pos);
268 } break;
269 case PhysicalTypeID::INT32: {
270 value->val.int32Val = getValue<int32_t>(pos);
271 } break;
272 case PhysicalTypeID::INT16: {
273 value->val.int16Val = getValue<int16_t>(pos);
274 } break;
275 case PhysicalTypeID::INT8: {
276 value->val.int8Val = getValue<int8_t>(pos);
277 } break;
278 case PhysicalTypeID::UINT64: {
279 value->val.uint64Val = getValue<uint64_t>(pos);
280 } break;
281 case PhysicalTypeID::UINT32: {
282 value->val.uint32Val = getValue<uint32_t>(pos);
283 } break;
284 case PhysicalTypeID::UINT16: {
285 value->val.uint16Val = getValue<uint16_t>(pos);
286 } break;
287 case PhysicalTypeID::UINT8: {
288 value->val.uint8Val = getValue<uint8_t>(pos);
289 } break;
290 case PhysicalTypeID::INT128: {
291 value->val.int128Val = getValue<int128_t>(pos);
292 } break;
293 case PhysicalTypeID::DOUBLE: {
294 value->val.doubleVal = getValue<double>(pos);
295 } break;
296 case PhysicalTypeID::FLOAT: {
297 value->val.floatVal = getValue<float>(pos);
298 } break;
299 case PhysicalTypeID::BOOL: {
300 value->val.booleanVal = getValue<bool>(pos);
301 } break;
302 case PhysicalTypeID::INTERVAL: {
303 value->val.intervalVal = getValue<interval_t>(pos);
304 } break;
305 case PhysicalTypeID::STRING:
306 case PhysicalTypeID::JSON: {
307 value->strVal = getValue<string_t>(pos).getAsString();
308 } break;
309 case PhysicalTypeID::ARRAY:
310 case PhysicalTypeID::LIST: {
311 auto dataVector = ListVector::getDataVector(this);
312 auto listEntry = getValue<list_entry_t>(pos);
313 std::vector<std::unique_ptr<Value>> children;
314 children.reserve(listEntry.size);
315 for (auto i = 0u; i < listEntry.size; ++i) {

Callers 12

printValueVectorFunction · 0.80
dumpRecordFunction · 0.80
validatePkNotExistsMethod · 0.80
lookupPKMethod · 0.80
scanPKColumnMethod · 0.80
lookupPKMethod · 0.80
commitInsertMethod · 0.80
commitInsertMethod · 0.80
insertMethod · 0.80
jsonifyAsStringFunction · 0.80

Calls 10

getFieldVectorsFunction · 0.85
getAsStringMethod · 0.80
isNullFunction · 0.50
getDataVectorFunction · 0.50
copyMethod · 0.45
setNullMethod · 0.45
getPhysicalTypeMethod · 0.45
reserveMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected