diff --git a/velox/row/CompactRow.cpp b/velox/row/CompactRow.cpp index 9b261dd05a85..eaa05ee72410 100644 --- a/velox/row/CompactRow.cpp +++ b/velox/row/CompactRow.cpp @@ -30,6 +30,9 @@ int32_t readInt32(const char* buffer) { return n; } +// Serialize a child vector of a row type within a list of rows. +// Write the serialized data at offsets of buffer row by row. +// Update offsets with the actual serialized size. template void serializeTyped( const raw_vector& rows, @@ -117,10 +120,12 @@ void serializeTyped( } } -void serializeVarcharAndVarBinary( +template <> +void serializeTyped( const raw_vector& rows, uint32_t childIdx, DecodedVector& decoded, + size_t valueBytes, const raw_vector& nulls, char* buffer, std::vector& offsets) { @@ -140,18 +145,6 @@ void serializeVarcharAndVarBinary( } } -template <> -void serializeTyped( - const raw_vector& rows, - uint32_t childIdx, - DecodedVector& decoded, - size_t valueBytes, - const raw_vector& nulls, - char* buffer, - std::vector& offsets) { - serializeVarcharAndVarBinary(rows, childIdx, decoded, nulls, buffer, offsets); -} - template <> void serializeTyped( const raw_vector& rows, @@ -161,7 +154,8 @@ void serializeTyped( const raw_vector& nulls, char* buffer, std::vector& offsets) { - serializeVarcharAndVarBinary(rows, childIdx, decoded, nulls, buffer, offsets); + serializeTyped( + rows, childIdx, decoded, valueBytes, nulls, buffer, offsets); } } // namespace