Skip to content

Commit

Permalink
Add comment explaining TypeToFlatVector<Generic> (#11187)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #11187

This was a request in a comment made on
#11170 I missed it before I landed the
change, so this is to address it.

Reviewed By: amitkdutta, bikramSingh91

Differential Revision: D63987591

fbshipit-source-id: 08c403a394d67402c393d40cea58bce5afafaf2f
  • Loading branch information
Kevin Wilfong authored and facebook-github-bot committed Oct 7, 2024
1 parent 13c18db commit 291957f
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 291957f

Please sign in to comment.