| 1961 | |
| 1962 | template <TypeKind kind> |
| 1963 | void serializeConstantVectorImpl( |
| 1964 | const BaseVector* vector, |
| 1965 | const folly::Range<const IndexRange*>& ranges, |
| 1966 | VectorStream* stream) { |
| 1967 | using T = typename KindToFlatVector<kind>::WrapperType; |
| 1968 | auto constVector = dynamic_cast<const ConstantVector<T>*>(vector); |
| 1969 | if (constVector->valueVector() != nullptr) { |
| 1970 | serializeWrapped(constVector, ranges, stream); |
| 1971 | return; |
| 1972 | } |
| 1973 | |
| 1974 | const int32_t count = rangesTotalSize(ranges); |
| 1975 | if (vector->isNullAt(0)) { |
| 1976 | for (int32_t i = 0; i < count; ++i) { |
| 1977 | stream->appendNull(); |
| 1978 | } |
| 1979 | return; |
| 1980 | } |
| 1981 | |
| 1982 | const T value = constVector->valueAtFast(0); |
| 1983 | for (int32_t i = 0; i < count; ++i) { |
| 1984 | stream->appendNonNull(); |
| 1985 | stream->appendOne(value); |
| 1986 | } |
| 1987 | } |
| 1988 | |
| 1989 | template <TypeKind Kind> |
| 1990 | void serializeConstantVector( |
nothing calls this directly
no test coverage detected