| 1128 | } |
| 1129 | |
| 1130 | std::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 | |
| 1152 | std::string Value::decimalToString() const { |
| 1153 | switch (dataType.getPhysicalType()) { |