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

Method relToString

src/common/types/value/value.cpp:1130–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1128}
1129
1130std::string Value::relToString() const {
1131 if (children[3]->isNull_) {
1132 // REL is represented as STRUCT. We don't have a way to represent STRUCT as null.
1133 // Instead, we check the internal ID entry to decide if a REL is NULL.
1134 return "";
1135 }
1136 std::string result = "(" + children[0]->toString() + ")-{";
1137 auto fieldNames = StructType::getFieldNames(dataType);
1138 for (auto i = 2u; i < childrenSize; ++i) {
1139 if (children[i]->isNull_) {
1140 // Avoid printing null key value pair.
1141 continue;
1142 }
1143 if (i != 2) {
1144 result += ", ";
1145 }
1146 result += fieldNames[i] + ": " + children[i]->toString();
1147 }
1148 result += "}->(" + children[1]->toString() + ")";
1149 return result;
1150}
1151
1152std::string Value::decimalToString() const {
1153 switch (dataType.getPhysicalType()) {

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected