Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Minor cleanups for variant::serialize #12275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions velox/type/Variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ folly::dynamic variant::serialize() const {
break;
}
case TypeKind::ARRAY: {
auto& row = value<TypeKind::ARRAY>();
auto& array = value<TypeKind::ARRAY>();
folly::dynamic arr = folly::dynamic::array;
for (auto& v : row) {
for (auto& v : array) {
arr.push_back(v.serialize());
}
objValue = std::move(arr);
Expand Down Expand Up @@ -553,7 +553,7 @@ folly::dynamic variant::serialize() const {
}
case TypeKind::TIMESTAMP: {
auto ts = value<TypeKind::TIMESTAMP>();
variantObj["value"] = -1; // Not used, but cannot be null.
objValue = -1; // Not used, but cannot be null.
variantObj["seconds"] = ts.getSeconds();
variantObj["nanos"] = ts.getNanos();
break;
Expand Down
Loading