Skip to content

Commit

Permalink
Enables getting value from date variant with integer type (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo authored and zhejiangxiaomai committed Jan 11, 2023
1 parent b33bd7e commit 8091814
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions velox/type/Variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8091814

Please sign in to comment.