From 726a52bf6fc5dec5e6dd493099c85f40682e1fff Mon Sep 17 00:00:00 2001 From: rui-mo Date: Mon, 9 Jan 2023 05:39:37 +0000 Subject: [PATCH] get value from date variant --- velox/type/Variant.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/velox/type/Variant.h b/velox/type/Variant.h index 8506e653c18f..f9dc6f774b0f 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);