| 1106 | } |
| 1107 | |
| 1108 | std::string Value::nodeToString() const { |
| 1109 | if (children[0]->isNull_) { |
| 1110 | // NODE is represented as STRUCT. We don't have a way to represent STRUCT as null. |
| 1111 | // Instead, we check the internal ID entry to decide if a NODE is NULL. |
| 1112 | return ""; |
| 1113 | } |
| 1114 | std::string result = "{"; |
| 1115 | auto fieldNames = StructType::getFieldNames(dataType); |
| 1116 | for (auto i = 0u; i < childrenSize; ++i) { |
| 1117 | if (children[i]->isNull_) { |
| 1118 | // Avoid printing null key value pair. |
| 1119 | continue; |
| 1120 | } |
| 1121 | if (i != 0) { |
| 1122 | result += ", "; |
| 1123 | } |
| 1124 | result += fieldNames[i] + ": " + children[i]->toString(); |
| 1125 | } |
| 1126 | result += "}"; |
| 1127 | return result; |
| 1128 | } |
| 1129 | |
| 1130 | std::string Value::relToString() const { |
| 1131 | if (children[3]->isNull_) { |