MCPcopy Create free account
hub / github.com/apache/impala / GetDecimalValInterpreted

Method GetDecimalValInterpreted

be/src/exprs/slot-ref.cc:520–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520DecimalVal SlotRef::GetDecimalValInterpreted(
521 ScalarExprEvaluator* eval, const TupleRow* row) const {
522 DCHECK_EQ(type_.type, TYPE_DECIMAL);
523 Tuple* t = row->GetTuple(tuple_idx_);
524 if (t == NULL || t->IsNull(null_indicator_offset_)) return DecimalVal::null();
525 switch (type_.GetByteSize()) {
526 case 4:
527 return DecimalVal(*reinterpret_cast<int32_t*>(t->GetSlot(slot_offset_)));
528 case 8:
529 return DecimalVal(*reinterpret_cast<int64_t*>(t->GetSlot(slot_offset_)));
530 case 16:
531 // Avoid an unaligned load by using memcpy
532 __int128_t val;
533 memcpy(&val, t->GetSlot(slot_offset_), sizeof(val));
534 return DecimalVal(val);
535 default:
536 DCHECK(false);
537 return DecimalVal::null();
538 }
539}
540
541DateVal SlotRef::GetDateValInterpreted(
542 ScalarExprEvaluator* eval, const TupleRow* row) const {

Callers

nothing calls this directly

Calls 5

DecimalValClass · 0.85
GetByteSizeMethod · 0.80
GetTupleMethod · 0.45
IsNullMethod · 0.45
GetSlotMethod · 0.45

Tested by

no test coverage detected