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

Method WriteNull

be/src/runtime/complex-value-writer.inline.h:84–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83template <class JsonStream>
84void ComplexValueWriter<JsonStream>::WriteNull(bool map_key) {
85 // We don't use writer_->Null() because that does not work for map keys. Maps are
86 // modelled as JSON objects but JSON objects can only have string keys, not nulls. We
87 // circumvent this limitation by writing the string "null" with quotes if
88 // 'stringify_map_keys_' is true and a raw null value without quotes if it is false.
89 constexpr char const* null_str = RawValue::NullLiteral(/*top_level*/ false);
90
91 if (map_key && stringify_map_keys_) {
92 writer_->String(null_str);
93 } else {
94 const int null_str_len = std::char_traits<char>::length(null_str);
95 writer_->RawValue(null_str, null_str_len, rapidjson::kStringType);
96 }
97}
98
99// Structs in collections are not converted to StructVal but are left as they are in the
100// tuple.

Callers

nothing calls this directly

Calls 2

NullLiteralClass · 0.50
StringMethod · 0.45

Tested by

no test coverage detected