From 291957f9b6fd7f4793b132bd59a9968eb0b82f16 Mon Sep 17 00:00:00 2001 From: Kevin Wilfong Date: Mon, 7 Oct 2024 14:56:13 -0700 Subject: [PATCH] Add comment explaining TypeToFlatVector (#11187) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/11187 This was a request in a comment made on https://github.com/facebookincubator/velox/pull/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 --- velox/vector/VectorTypeUtils.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/velox/vector/VectorTypeUtils.h b/velox/vector/VectorTypeUtils.h index ca6a6b3cef13..b23316db5085 100644 --- a/velox/vector/VectorTypeUtils.h +++ b/velox/vector/VectorTypeUtils.h @@ -85,6 +85,11 @@ struct TypeToFlatVector { using type = typename KindToFlatVector::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 struct TypeToFlatVector> { using type = BaseVector;