MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / GetInteger

Method GetInteger

src/codec/codec.cc:651–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651int32_t RowView::GetInteger(const int8_t* row, uint32_t idx,
652 ::fedb::type::DataType type, int64_t* val) {
653 int32_t ret = 0;
654 switch (type) {
655 case ::fedb::type::kSmallInt: {
656 int16_t tmp_val = 0;
657 ret = GetValue(row, idx, type, &tmp_val);
658 if (ret == 0) *val = tmp_val;
659 break;
660 }
661 case ::fedb::type::kInt: {
662 int32_t tmp_val = 0;
663 GetValue(row, idx, type, &tmp_val);
664 if (ret == 0) *val = tmp_val;
665 break;
666 }
667 case ::fedb::type::kTimestamp:
668 case ::fedb::type::kBigInt: {
669 int64_t tmp_val = 0;
670 GetValue(row, idx, type, &tmp_val);
671 if (ret == 0) *val = tmp_val;
672 break;
673 }
674 default:
675 return -1;
676 }
677 return ret;
678}
679
680int32_t RowView::GetValue(const int8_t* row, uint32_t idx,
681 ::fedb::type::DataType type, void* val) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected