diff --git a/velox/vector/BaseVector.h b/velox/vector/BaseVector.h index d2d6627325c8..7a6b2d9349e2 100644 --- a/velox/vector/BaseVector.h +++ b/velox/vector/BaseVector.h @@ -795,7 +795,9 @@ class BaseVector { } void clearContainingLazyAndWrapped() { - containsLazyAndIsWrapped_ = false; + if (containsLazyAndIsWrapped_) { + containsLazyAndIsWrapped_ = false; + } } bool memoDisabled() const { @@ -919,7 +921,7 @@ class BaseVector { // unloaded lazy vector should not be wrapped by two separate top level // vectors. This would ensure we avoid it being loaded for two separate set // of rows. - bool containsLazyAndIsWrapped_{false}; + std::atomic_bool containsLazyAndIsWrapped_{false}; // Whether we should use Expr::evalWithMemo to cache the result of evaluation // on dictionary values (this vector). Set to false when the dictionary