diff options
| author | Daniil Cherednik <[email protected]> | 2024-05-22 13:25:11 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-22 13:25:11 +0200 |
| commit | 307fa4f6e10b73b63276b0b50e988c84a570d9c4 (patch) | |
| tree | 7274cb36c124f0c5e2a2809f90cdb6c71d0b01a3 | |
| parent | 2ef3bcf6f7768e8f5734c6f4db6c9bb4af043933 (diff) | |
pass not null flag as TTableColumnInfo field (#4731)
| -rw-r--r-- | ydb/core/grpc_services/resolve_local_db_table.cpp | 4 | ||||
| -rw-r--r-- | ydb/core/tx/locks/sys_tables.h | 4 | ||||
| -rw-r--r-- | ydb/core/tx/scheme_board/cache.cpp | 1 | ||||
| -rw-r--r-- | ydb/core/tx/tx_proxy/read_table_impl.cpp | 4 |
4 files changed, 8 insertions, 5 deletions
diff --git a/ydb/core/grpc_services/resolve_local_db_table.cpp b/ydb/core/grpc_services/resolve_local_db_table.cpp index 81ae3d12a0c..daa0ebc8919 100644 --- a/ydb/core/grpc_services/resolve_local_db_table.cpp +++ b/ydb/core/grpc_services/resolve_local_db_table.cpp @@ -45,7 +45,9 @@ namespace NGRpcService { const NTable::TScheme::TTableInfo* tableInfo = scheme.Tables.FindPtr(*ti); for (const auto& col : tableInfo->Columns) { - entry.Columns[col.first] = TSysTables::TTableColumnInfo(col.second.Name, col.first, col.second.PType, col.second.PTypeMod, col.second.KeyOrder); + entry.Columns[col.first] = TSysTables::TTableColumnInfo( + col.second.Name, col.first, col.second.PType, col.second.PTypeMod, col.second.KeyOrder, + {}, TSysTables::TTableColumnInfo::EDefaultKind::DEFAULT_UNDEFINED, {}, false, col.second.NotNull); } } diff --git a/ydb/core/tx/locks/sys_tables.h b/ydb/core/tx/locks/sys_tables.h index a1ac25c0a84..7378daf1e26 100644 --- a/ydb/core/tx/locks/sys_tables.h +++ b/ydb/core/tx/locks/sys_tables.h @@ -31,6 +31,7 @@ struct TSysTables { EDefaultKind DefaultKind; Ydb::TypedValue DefaultFromLiteral; bool IsBuildInProgress = false; + bool IsNotNullColumn = false; //maybe move into TTypeInfo? TTableColumnInfo() = default; @@ -54,7 +55,7 @@ struct TSysTables { const TString& typeMod = {}, i32 keyOrder = -1, const TString& defaultFromSequence = {}, EDefaultKind defaultKind = EDefaultKind::DEFAULT_UNDEFINED, - const Ydb::TypedValue& defaultFromLiteral = {}, bool isBuildInProgress = false) + const Ydb::TypedValue& defaultFromLiteral = {}, bool isBuildInProgress = false, bool isNotNullColumn = false) : Name(name) , Id(colId) , PType(type) @@ -64,6 +65,7 @@ struct TSysTables { , DefaultKind(defaultKind) , DefaultFromLiteral(defaultFromLiteral) , IsBuildInProgress(isBuildInProgress) + , IsNotNullColumn(isNotNullColumn) {} }; diff --git a/ydb/core/tx/scheme_board/cache.cpp b/ydb/core/tx/scheme_board/cache.cpp index e036e5c9af0..3b37dff2f73 100644 --- a/ydb/core/tx/scheme_board/cache.cpp +++ b/ydb/core/tx/scheme_board/cache.cpp @@ -783,6 +783,7 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> { } if (columnDesc.GetNotNull()) { + column.IsNotNullColumn = true; NotNullColumns.insert(columnDesc.GetName()); } } diff --git a/ydb/core/tx/tx_proxy/read_table_impl.cpp b/ydb/core/tx/tx_proxy/read_table_impl.cpp index 5f887a89ab5..deb79024f3f 100644 --- a/ydb/core/tx/tx_proxy/read_table_impl.cpp +++ b/ydb/core/tx/tx_proxy/read_table_impl.cpp @@ -541,14 +541,12 @@ private: size_t no = 0; size_t keys = 0; - const auto& notNullColumns = res.NotNullColumns; - for (auto &entry : res.Columns) { auto& col = entry.second; if (col.KeyOrder != -1) { keyTypes[col.KeyOrder] = col.PType; - notNullKeys[col.KeyOrder] = notNullColumns.contains(col.Name); + notNullKeys[col.KeyOrder] = col.IsNotNullColumn; ++keys; } |
