From 37c4de3cbf557ccfb22efa7b5568415ee79fc0b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:25:49 +0800 Subject: [PATCH] branch-2.1: [improve](variant) only sanitize in debug mode #45689 (#45698) Cherry-picked from #45689 Co-authored-by: lihangyu --- be/src/vec/columns/column_object.cpp | 2 ++ be/src/vec/columns/column_object.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/be/src/vec/columns/column_object.cpp b/be/src/vec/columns/column_object.cpp index 05f1bdb13a0386..47dbb14d377dff 100644 --- a/be/src/vec/columns/column_object.cpp +++ b/be/src/vec/columns/column_object.cpp @@ -1702,6 +1702,7 @@ std::string ColumnObject::debug_string() const { } Status ColumnObject::sanitize() const { +#ifndef NDEBUG RETURN_IF_CATCH_EXCEPTION(check_consistency()); for (const auto& subcolumn : subcolumns) { if (subcolumn->data.is_finalized()) { @@ -1716,6 +1717,7 @@ Status ColumnObject::sanitize() const { } VLOG_DEBUG << "sanitized " << debug_string(); +#endif return Status::OK(); } diff --git a/be/src/vec/columns/column_object.h b/be/src/vec/columns/column_object.h index 20848e9d0af433..43e5301f030aba 100644 --- a/be/src/vec/columns/column_object.h +++ b/be/src/vec/columns/column_object.h @@ -454,7 +454,7 @@ class ColumnObject final : public COWHelper { bool empty() const; - // Check if all columns and types are aligned + // Check if all columns and types are aligned, only in debug mode Status sanitize() const; std::string debug_string() const;