Skip to content

Commit

Permalink
Add comment explaining TypeToFlatVector<Generic>
Browse files Browse the repository at this point in the history
Summary:
This was a request in a comment made on 
#11170 I missed it before I landed the
change, so this is to address it.

Differential Revision: D63987591
  • Loading branch information
Kevin Wilfong authored and facebook-github-bot committed Oct 7, 2024
1 parent 4f11402 commit a905ea1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions velox/vector/VectorTypeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ struct TypeToFlatVector {
using type = typename KindToFlatVector<SimpleTypeTrait<T>::typeKind>::type;
};

// Generic's, by design, do not have any compile time type information, so it is
// impossible to determine what sort of Vector would hold values for this type.
// To work around this, we just return BaseVector, since any Vector class can be
// safely casted to BaseVector, and it is consistent with classes specialized
// for the Generic type, like the VectorWriter.
template <typename T, bool comparable, bool orderable>
struct TypeToFlatVector<Generic<T, comparable, orderable>> {
using type = BaseVector;
Expand Down

0 comments on commit a905ea1

Please sign in to comment.