| 312 | |
| 313 | template <TypeKind kind> |
| 314 | void writeScalarConstant(const BaseVector& vector, std::ostream& out) { |
| 315 | using T = typename TypeTraits<kind>::NativeType; |
| 316 | |
| 317 | auto value = vector.as<ConstantVector<T>>()->valueAt(0); |
| 318 | out.write((const char*)&value, sizeof(T)); |
| 319 | |
| 320 | if constexpr (std::is_same_v<T, StringView>) { |
| 321 | if (!value.isInline()) { |
| 322 | write<int32_t>(value.size(), out); |
| 323 | out.write(value.data(), value.size()); |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | void writeConstantVector(const BaseVector& vector, std::ostream& out) { |
| 329 | bool isNull = vector.isNullAt(0); |