Skip to content

Commit 709b413

Browse files
authored
fix RawBytes counter (#14594)
1 parent e3bc3bd commit 709b413

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

ydb/core/kqp/ut/olap/kqp_olap_stats_ut.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#include <ydb/core/testlib/common_helper.h>
44
#include <ydb/core/tx/columnshard/hooks/testing/controller.h>
55

6+
#include <ut/olap/helpers/get_value.h>
7+
#include <ut/olap/helpers/query_executor.h>
8+
69
namespace NKikimr {
710
namespace NKqp {
811

@@ -196,6 +199,23 @@ Y_UNIT_TEST_SUITE(KqpOlapStats) {
196199
const auto& storeDescription = describeStoreResult.GetTableDescription();
197200

198201
UNIT_ASSERT_VALUES_EQUAL(2000, storeDescription.GetTableRows());
202+
203+
{
204+
auto selectQuery = TString(R"(
205+
SELECT
206+
SUM(ColumnBlobBytes) AS BlobBytes,
207+
SUM(ColumnRawBytes) AS RawBytes,
208+
SUM(Rows) AS Rows,
209+
COUNT(*) AS Portions
210+
FROM `/Root/TableStoreTest/.sys/store_primary_index_portion_stats`
211+
)");
212+
213+
auto client = testHelper.GetKikimr().GetTableClient();
214+
auto rows = ExecuteScanQuery(client, selectQuery);
215+
UNIT_ASSERT_VALUES_EQUAL(rows.size(), 1);
216+
UNIT_ASSERT_VALUES_EQUAL(GetUint64(rows[0].at("Rows")), storeDescription.GetTableRows());
217+
UNIT_ASSERT_VALUES_EQUAL(GetUint64(rows[0].at("BlobBytes")), storeDescription.GetTableSize());
218+
}
199219
}
200220
}
201221

ydb/core/tx/columnshard/counters/portions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TSimplePortionsGroupInfo {
5555
TSimplePortionsGroupInfo& operator+=(const TSimplePortionsGroupInfo& item) {
5656
Blobs += item.Blobs;
5757
BlobBytes += item.BlobBytes;
58-
RawBytes += RawBytes + item.RawBytes;
58+
RawBytes += item.RawBytes;
5959
Count += item.Count;
6060
RecordsCount += item.RecordsCount;
6161
for (const auto& [channel, bytes] : item.BytesByChannel) {

0 commit comments

Comments
 (0)