aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpavelvelikhov <pavelvelikhov@yandex-team.com>2023-10-20 18:03:50 +0300
committerpavelvelikhov <pavelvelikhov@yandex-team.com>2023-10-20 19:26:49 +0300
commitbabd49b87ac8b28d492552a48161080fae18a250 (patch)
tree34ba5e554d7f54b382b69a67970b7c8934cf1444
parent91bd1340c270c176737da8ce6d331d66ed054c2d (diff)
downloadydb-babd49b87ac8b28d492552a48161080fae18a250.tar.gz
Transition to feature flag instead of pragma to get statistics
Transition to feature flag instead of pragma to get statistics
-rw-r--r--ydb/core/kqp/gateway/kqp_metadata_loader.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/ydb/core/kqp/gateway/kqp_metadata_loader.cpp b/ydb/core/kqp/gateway/kqp_metadata_loader.cpp
index 64e9f21a58..108796a755 100644
--- a/ydb/core/kqp/gateway/kqp_metadata_loader.cpp
+++ b/ydb/core/kqp/gateway/kqp_metadata_loader.cpp
@@ -785,7 +785,7 @@ NThreading::TFuture<TTableMetadataResult> TKqpTableMetadataLoader::LoadTableMeta
// Create an apply for the future that will fetch table statistics and save it in the metadata
// This method will only run if cost based optimization is enabled
- if (!Config || !Config->HasOptEnableCostBasedOptimization()){
+ if (!Config || !Config->FeatureFlags.GetEnableStatistics()){
return future;
}
@@ -825,9 +825,11 @@ NThreading::TFuture<TTableMetadataResult> TKqpTableMetadataLoader::LoadTableMeta
return;
}
auto resp = response.StatResponses[0];
- auto s = std::get<NKikimr::NStat::TStatSimple>(resp.Statistics);
- result.Metadata->RecordsCount = s.RowCount;
- result.Metadata->DataSize = s.BytesSize;
+ if (std::holds_alternative<NKikimr::NStat::TStatSimple>(resp.Statistics)) {
+ auto s = std::get<NKikimr::NStat::TStatSimple>(resp.Statistics);
+ result.Metadata->RecordsCount = s.RowCount;
+ result.Metadata->DataSize = s.BytesSize;
+ }
promise.SetValue(result);
});