| 2034 | } |
| 2035 | |
| 2036 | void serializeColumn( |
| 2037 | const BaseVector* vector, |
| 2038 | const folly::Range<const IndexRange*>& ranges, |
| 2039 | VectorStream* stream) { |
| 2040 | switch (vector->encoding()) { |
| 2041 | case VectorEncoding::Simple::FLAT: |
| 2042 | BOLT_DYNAMIC_SCALAR_TYPE_DISPATCH_ALL( |
| 2043 | serializeFlatVector, vector->typeKind(), vector, ranges, stream); |
| 2044 | break; |
| 2045 | case VectorEncoding::Simple::CONSTANT: |
| 2046 | BOLT_DYNAMIC_TYPE_DISPATCH_ALL( |
| 2047 | serializeConstantVector, vector->typeKind(), vector, ranges, stream); |
| 2048 | break; |
| 2049 | case VectorEncoding::Simple::DICTIONARY: |
| 2050 | BOLT_DYNAMIC_TYPE_DISPATCH_ALL( |
| 2051 | serializeDictionaryVector, |
| 2052 | vector->typeKind(), |
| 2053 | vector, |
| 2054 | ranges, |
| 2055 | stream); |
| 2056 | break; |
| 2057 | case VectorEncoding::Simple::BIASED: |
| 2058 | switch (vector->typeKind()) { |
| 2059 | case TypeKind::SMALLINT: |
| 2060 | serializeBiasVector<int16_t>(vector, ranges, stream); |
| 2061 | break; |
| 2062 | case TypeKind::INTEGER: |
| 2063 | serializeBiasVector<int32_t>(vector, ranges, stream); |
| 2064 | break; |
| 2065 | case TypeKind::BIGINT: |
| 2066 | serializeBiasVector<int64_t>(vector, ranges, stream); |
| 2067 | break; |
| 2068 | default: |
| 2069 | BOLT_FAIL( |
| 2070 | "Invalid biased vector type {}", |
| 2071 | static_cast<int>(vector->encoding())); |
| 2072 | } |
| 2073 | break; |
| 2074 | case VectorEncoding::Simple::ROW: |
| 2075 | case VectorEncoding::Simple::VARIANT: |
| 2076 | serializeRowVector(vector, ranges, stream); |
| 2077 | break; |
| 2078 | case VectorEncoding::Simple::ARRAY: |
| 2079 | serializeArrayVector(vector, ranges, stream); |
| 2080 | break; |
| 2081 | case VectorEncoding::Simple::MAP: |
| 2082 | serializeMapVector(vector, ranges, stream); |
| 2083 | break; |
| 2084 | case VectorEncoding::Simple::LAZY: |
| 2085 | serializeColumn(vector->loadedVector(), ranges, stream); |
| 2086 | break; |
| 2087 | default: |
| 2088 | serializeWrapped(vector, ranges, stream); |
| 2089 | } |
| 2090 | } |
| 2091 | |
| 2092 | // Returns ranges for the non-null rows of an array or map. 'rows' gives the |
| 2093 | // rows. nulls is the nulls of the array/map or nullptr if no nulls. 'offsets' |
no test coverage detected