Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marin-ma committed Aug 15, 2024
1 parent da4674e commit 10f92bf
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions velox/row/CompactRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <TypeKind kind>
void serializeTyped(
const raw_vector<vector_size_t>& rows,
Expand Down Expand Up @@ -117,10 +120,12 @@ void serializeTyped<TypeKind::TIMESTAMP>(
}
}

void serializeVarcharAndVarBinary(
template <>
void serializeTyped<TypeKind::VARCHAR>(
const raw_vector<vector_size_t>& rows,
uint32_t childIdx,
DecodedVector& decoded,
size_t valueBytes,
const raw_vector<uint8_t*>& nulls,
char* buffer,
std::vector<size_t>& offsets) {
Expand All @@ -140,18 +145,6 @@ void serializeVarcharAndVarBinary(
}
}

template <>
void serializeTyped<TypeKind::VARCHAR>(
const raw_vector<vector_size_t>& rows,
uint32_t childIdx,
DecodedVector& decoded,
size_t valueBytes,
const raw_vector<uint8_t*>& nulls,
char* buffer,
std::vector<size_t>& offsets) {
serializeVarcharAndVarBinary(rows, childIdx, decoded, nulls, buffer, offsets);
}

template <>
void serializeTyped<TypeKind::VARBINARY>(
const raw_vector<vector_size_t>& rows,
Expand All @@ -161,7 +154,8 @@ void serializeTyped<TypeKind::VARBINARY>(
const raw_vector<uint8_t*>& nulls,
char* buffer,
std::vector<size_t>& offsets) {
serializeVarcharAndVarBinary(rows, childIdx, decoded, nulls, buffer, offsets);
serializeTyped<TypeKind::VARCHAR>(
rows, childIdx, decoded, valueBytes, nulls, buffer, offsets);
}
} // namespace

Expand Down

0 comments on commit 10f92bf

Please sign in to comment.