diff options
author | Semyon <yentsovsemyon@ydb.tech> | 2025-02-15 11:34:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-15 11:34:41 +0300 |
commit | 709b41317cbba34d1204f3b80146db8e684310be (patch) | |
tree | c6883cff146ada8698cf002b744c1533b8d4689d | |
parent | e3bc3bdb70937e401484014dfbc460b2dd6e2070 (diff) | |
download | ydb-709b41317cbba34d1204f3b80146db8e684310be.tar.gz |
fix RawBytes counter (#14594)
-rw-r--r-- | ydb/core/kqp/ut/olap/kqp_olap_stats_ut.cpp | 20 | ||||
-rw-r--r-- | ydb/core/tx/columnshard/counters/portions.h | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/ydb/core/kqp/ut/olap/kqp_olap_stats_ut.cpp b/ydb/core/kqp/ut/olap/kqp_olap_stats_ut.cpp index bc9ae55b2f..5da66f8673 100644 --- a/ydb/core/kqp/ut/olap/kqp_olap_stats_ut.cpp +++ b/ydb/core/kqp/ut/olap/kqp_olap_stats_ut.cpp @@ -3,6 +3,9 @@ #include <ydb/core/testlib/common_helper.h> #include <ydb/core/tx/columnshard/hooks/testing/controller.h> +#include <ut/olap/helpers/get_value.h> +#include <ut/olap/helpers/query_executor.h> + namespace NKikimr { namespace NKqp { @@ -196,6 +199,23 @@ Y_UNIT_TEST_SUITE(KqpOlapStats) { const auto& storeDescription = describeStoreResult.GetTableDescription(); UNIT_ASSERT_VALUES_EQUAL(2000, storeDescription.GetTableRows()); + + { + auto selectQuery = TString(R"( + SELECT + SUM(ColumnBlobBytes) AS BlobBytes, + SUM(ColumnRawBytes) AS RawBytes, + SUM(Rows) AS Rows, + COUNT(*) AS Portions + FROM `/Root/TableStoreTest/.sys/store_primary_index_portion_stats` + )"); + + auto client = testHelper.GetKikimr().GetTableClient(); + auto rows = ExecuteScanQuery(client, selectQuery); + UNIT_ASSERT_VALUES_EQUAL(rows.size(), 1); + UNIT_ASSERT_VALUES_EQUAL(GetUint64(rows[0].at("Rows")), storeDescription.GetTableRows()); + UNIT_ASSERT_VALUES_EQUAL(GetUint64(rows[0].at("BlobBytes")), storeDescription.GetTableSize()); + } } } diff --git a/ydb/core/tx/columnshard/counters/portions.h b/ydb/core/tx/columnshard/counters/portions.h index c5e7023325..72915d255b 100644 --- a/ydb/core/tx/columnshard/counters/portions.h +++ b/ydb/core/tx/columnshard/counters/portions.h @@ -55,7 +55,7 @@ public: TSimplePortionsGroupInfo& operator+=(const TSimplePortionsGroupInfo& item) { Blobs += item.Blobs; BlobBytes += item.BlobBytes; - RawBytes += RawBytes + item.RawBytes; + RawBytes += item.RawBytes; Count += item.Count; RecordsCount += item.RecordsCount; for (const auto& [channel, bytes] : item.BytesByChannel) { |