diff --git a/velox/type/Variant.h b/velox/type/Variant.h index f0d4c7c51916..3e7a700348a2 100644 --- a/velox/type/Variant.h +++ b/velox/type/Variant.h @@ -542,6 +542,10 @@ class variant { } void checkIsKind(TypeKind kind) const { + // Integer is compatible for getting the value from a date variant. + if (kind_ == TypeKind::DATE && kind == TypeKind::INTEGER) { + return; + } if (kind_ != kind) { // Error path outlined to encourage inlining of the branch. throwCheckIsKindError(kind);