Skip to content

Commit 7f7c664

Browse files
authored
Merge e738085 into 4dbe124
2 parents 4dbe124 + e738085 commit 7f7c664

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

ydb/core/tx/datashard/datashard_ut_change_exchange.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,20 @@ Y_UNIT_TEST_SUITE(Cdc) {
20152015
});
20162016
}
20172017

2018+
Y_UNIT_TEST(DecimalKey) {
2019+
const auto table = TShardedTableOptions()
2020+
.Columns({
2021+
{"decimal1_key", "Decimal(1, 0)", true, false},
2022+
{"decimal35_key", "Decimal(35, 10)", true, false},
2023+
{"decimal_value", "Decimal", false , false},
2024+
});
2025+
TopicRunner::Read(table, Updates(NKikimrSchemeOp::ECdcStreamFormatJson), {
2026+
R"(UPSERT INTO `/Root/Table` (decimal1_key, decimal35_key, decimal_value) VALUES (CAST("5.0" AS Decimal(1, 0)), CAST("355555555555555.321" AS Decimal(35, 10)), CAST("4.321" AS Decimal(22, 9)));)",
2027+
}, {
2028+
R"({"update":{"decimal_value":"4.321"},"key":["5","355555555555555.321"]})",
2029+
});
2030+
}
2031+
20182032
// Schema snapshots
20192033
using TActionFunc = std::function<ui64(TServer::TPtr)>;
20202034

ydb/core/tx/scheme_board/cache.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,9 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> {
990990

991991
schema.reserve(pqConfig.PartitionKeySchemaSize());
992992
for (const auto& keySchema : pqConfig.GetPartitionKeySchema()) {
993-
// TODO: support pg types
994-
schema.push_back(NScheme::TTypeInfo(keySchema.GetTypeId()));
993+
auto typeInfoMod = NScheme::TypeInfoModFromProtoColumnType(keySchema.GetTypeId(),
994+
keySchema.HasTypeInfo() ? &keySchema.GetTypeInfo() : nullptr);
995+
schema.push_back(NScheme::TTypeInfo(typeInfoMod.TypeInfo));
995996
}
996997

997998
partitioning.reserve(pqDesc.PartitionsSize());

0 commit comments

Comments
 (0)