aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnaz <ilnaz@ydb.tech>2023-05-18 11:30:26 +0300
committerilnaz <ilnaz@ydb.tech>2023-05-18 11:30:26 +0300
commita858831787c87dddf92e4d87f883f5990ee7fb35 (patch)
treed49fe0ff6096ef49a179429f8338917939d07406
parent46444f475a4f1f19ef04654624be6883ed89a130 (diff)
downloadydb-a858831787c87dddf92e4d87f883f5990ee7fb35.tar.gz
DOCUMENT_TABLE_JSON -> DYNAMODB_STREAMS_JSON
-rw-r--r--ydb/core/kqp/provider/yql_kikimr_exec.cpp4
-rw-r--r--ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp12
-rw-r--r--ydb/core/protos/flat_scheme_op.proto4
-rw-r--r--ydb/core/tx/datashard/change_sender_cdc_stream.cpp6
-rw-r--r--ydb/core/tx/datashard/datashard_user_table.cpp2
-rw-r--r--ydb/core/tx/datashard/datashard_ut_change_exchange.cpp4
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp8
-rw-r--r--ydb/core/tx/schemeshard/ut_cdc_stream.cpp8
-rw-r--r--ydb/core/tx/schemeshard/ut_cdc_stream_reboots.cpp4
-rw-r--r--ydb/core/ydb_convert/table_description.cpp8
-rw-r--r--ydb/public/api/protos/ydb_table.proto2
-rw-r--r--ydb/public/sdk/cpp/client/ydb_table/table.cpp8
-rw-r--r--ydb/public/sdk/cpp/client/ydb_table/table_enum.h2
13 files changed, 36 insertions, 36 deletions
diff --git a/ydb/core/kqp/provider/yql_kikimr_exec.cpp b/ydb/core/kqp/provider/yql_kikimr_exec.cpp
index cfe0bd90c83..684a6cd207d 100644
--- a/ydb/core/kqp/provider/yql_kikimr_exec.cpp
+++ b/ydb/core/kqp/provider/yql_kikimr_exec.cpp
@@ -1291,8 +1291,8 @@ public:
if (to_lower(format) == "json") {
add_changefeed->set_format(Ydb::Table::ChangefeedFormat::FORMAT_JSON);
- } else if (to_lower(format) == "document_table_json") {
- add_changefeed->set_format(Ydb::Table::ChangefeedFormat::FORMAT_DOCUMENT_TABLE_JSON);
+ } else if (to_lower(format) == "dynamodb_streams_json") {
+ add_changefeed->set_format(Ydb::Table::ChangefeedFormat::FORMAT_DYNAMODB_STREAMS_JSON);
} else {
ctx.AddError(TIssue(ctx.GetPosition(setting.Name().Pos()),
TStringBuilder() << "Unknown changefeed format: " << format));
diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp
index 7dfe0346f96..412cfc9b2d3 100644
--- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp
+++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp
@@ -2656,8 +2656,8 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
switch (format) {
case EChangefeedFormat::Json:
return "JSON";
- case EChangefeedFormat::DocumentTableJson:
- return "DOCUMENT_TABLE_JSON";
+ case EChangefeedFormat::DynamoDBStreamsJson:
+ return "DYNAMODB_STREAMS_JSON";
case EChangefeedFormat::Unknown:
UNIT_ASSERT(false);
return "";
@@ -2675,7 +2675,7 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
.AddNullableColumn("Value", EPrimitiveType::String)
.SetPrimaryKeyColumn("Key");
- if (format == EChangefeedFormat::DocumentTableJson) {
+ if (format == EChangefeedFormat::DynamoDBStreamsJson) {
builder.AddAttribute("__document_api_version", "1");
}
@@ -2684,7 +2684,7 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
}
auto execOpts = TExecSchemeQuerySettings();
- if (format == EChangefeedFormat::DocumentTableJson) {
+ if (format == EChangefeedFormat::DynamoDBStreamsJson) {
execOpts.RequestType("_document_api_request");
}
@@ -2729,7 +2729,7 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
switch (format) {
case EChangefeedFormat::Unknown:
continue;
- case EChangefeedFormat::DocumentTableJson:
+ case EChangefeedFormat::DynamoDBStreamsJson:
if (mode == EChangefeedMode::Updates) {
continue;
}
@@ -2859,7 +2859,7 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
auto query = R"(
--!syntax_v1
ALTER TABLE `/Root/document-table` ADD CHANGEFEED `feed` WITH (
- MODE = 'UPDATES', FORMAT = 'DOCUMENT_TABLE_JSON'
+ MODE = 'UPDATES', FORMAT = 'DYNAMODB_STREAMS_JSON'
);
)";
diff --git a/ydb/core/protos/flat_scheme_op.proto b/ydb/core/protos/flat_scheme_op.proto
index 6f2009058cc..e218a7b5119 100644
--- a/ydb/core/protos/flat_scheme_op.proto
+++ b/ydb/core/protos/flat_scheme_op.proto
@@ -715,7 +715,7 @@ enum ECdcStreamFormat {
ECdcStreamFormatInvalid = 0;
ECdcStreamFormatProto = 1;
ECdcStreamFormatJson = 2;
- ECdcStreamFormatDocApiJson = 3;
+ ECdcStreamFormatDynamoDBStreamsJson = 3;
}
message TCdcStreamDescription {
@@ -727,7 +727,7 @@ message TCdcStreamDescription {
optional ECdcStreamState State = 4;
optional uint64 SchemaVersion = 5;
repeated TUserAttribute UserAttributes = 8;
- // AwsRegion used to mark records in DynamoDB-compatible mode (FormatDocApiJson)
+ // AwsRegion used to mark records in DynamoDB-compatible mode (FormatDynamoDBStreamsJson)
optional string AwsRegion = 9;
}
diff --git a/ydb/core/tx/datashard/change_sender_cdc_stream.cpp b/ydb/core/tx/datashard/change_sender_cdc_stream.cpp
index e1df72d2733..552e1901783 100644
--- a/ydb/core/tx/datashard/change_sender_cdc_stream.cpp
+++ b/ydb/core/tx/datashard/change_sender_cdc_stream.cpp
@@ -105,9 +105,9 @@ class TCdcChangeSenderPartition: public TActorBootstrapped<TCdcChangeSenderParti
}
case NKikimrSchemeOp::ECdcStreamFormatJson:
- case NKikimrSchemeOp::ECdcStreamFormatDocApiJson: {
+ case NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson: {
NJson::TJsonValue json;
- if (Stream.Format == NKikimrSchemeOp::ECdcStreamFormatDocApiJson) {
+ if (Stream.Format == NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson) {
record.SerializeToDocApiJson(json, TChangeRecord::TDocApiJsonOptions{
.AwsRegion = Stream.AwsRegion,
.StreamMode = Stream.Mode,
@@ -697,7 +697,7 @@ class TCdcChangeSenderMain
}
case NKikimrSchemeOp::ECdcStreamFormatJson:
- case NKikimrSchemeOp::ECdcStreamFormatDocApiJson: {
+ case NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson: {
using namespace NKikimr::NDataStreams::V1;
const auto hashKey = HexBytesToDecimal(record.GetPartitionKey() /* MD5 */);
return ShardFromDecimal(hashKey, KeyDesc->Partitions.size());
diff --git a/ydb/core/tx/datashard/datashard_user_table.cpp b/ydb/core/tx/datashard/datashard_user_table.cpp
index d92ebe478dd..7f5e3a636fb 100644
--- a/ydb/core/tx/datashard/datashard_user_table.cpp
+++ b/ydb/core/tx/datashard/datashard_user_table.cpp
@@ -114,7 +114,7 @@ bool TUserTable::HasAsyncIndexes() const {
static bool IsJsonCdcStream(TUserTable::TCdcStream::EFormat format) {
switch (format) {
case TUserTable::TCdcStream::EFormat::ECdcStreamFormatJson:
- case TUserTable::TCdcStream::EFormat::ECdcStreamFormatDocApiJson:
+ case TUserTable::TCdcStream::EFormat::ECdcStreamFormatDynamoDBStreamsJson:
return true;
default:
return false;
diff --git a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp
index 173761d5a93..4f5d7c1ddef 100644
--- a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp
+++ b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp
@@ -1231,7 +1231,7 @@ Y_UNIT_TEST_SUITE(Cdc) {
}
Y_UNIT_TEST_TRIPLET(DocApi, PqRunner, YdsRunner, TopicRunner) {
- TRunner::Read(DocApiTable(), KeysOnly(NKikimrSchemeOp::ECdcStreamFormatDocApiJson), {R"(
+ TRunner::Read(DocApiTable(), KeysOnly(NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson), {R"(
UPSERT INTO `/Root/Table` (__Hash, id_shard, id_sort, __RowData) VALUES (
1, "10", "100", JsonDocument('{"M":{"color":{"S":"pink"},"weight":{"N":"4.5"}}}')
);
@@ -1254,7 +1254,7 @@ Y_UNIT_TEST_SUITE(Cdc) {
}), false),
}, false /* do not check key */);
- TRunner::Read(DocApiTable(), NewAndOldImages(NKikimrSchemeOp::ECdcStreamFormatDocApiJson), {R"(
+ TRunner::Read(DocApiTable(), NewAndOldImages(NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson), {R"(
UPSERT INTO `/Root/Table` (__Hash, id_shard, id_sort, __RowData, extra) VALUES (
1, "10", "100", JsonDocument('{"M":{"color":{"S":"pink"},"weight":{"N":"4.5"}}}'), true
);
diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp
index 5d541b0a458..b561fee0229 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp
@@ -179,9 +179,9 @@ public:
case NKikimrSchemeOp::ECdcStreamModeNewAndOldImages:
break;
case NKikimrSchemeOp::ECdcStreamModeUpdate:
- if (streamDesc.GetFormat() == NKikimrSchemeOp::ECdcStreamFormatDocApiJson) {
+ if (streamDesc.GetFormat() == NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson) {
result->SetError(NKikimrScheme::StatusInvalidParameter,
- "DocApiJson format incompatible with specified stream mode");
+ "DYNAMODB_STREAMS_JSON format incompatible with specified stream mode");
return result;
}
break;
@@ -200,10 +200,10 @@ public:
return result;
}
break;
- case NKikimrSchemeOp::ECdcStreamFormatDocApiJson:
+ case NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson:
if (tablePath.Base()->DocumentApiVersion < 1) {
result->SetError(NKikimrScheme::StatusInvalidParameter,
- "DocApiJson format incompatible with non-document table");
+ "DYNAMODB_STREAMS_JSON format incompatible with non-document table");
return result;
}
break;
diff --git a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp
index b61ac1c07ca..a67dc69f3fe 100644
--- a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp
+++ b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp
@@ -292,7 +292,7 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
StreamDescription {
Name: "Stream"
Mode: ECdcStreamModeNewAndOldImages
- Format: ECdcStreamFormatDocApiJson
+ Format: ECdcStreamFormatDynamoDBStreamsJson
}
)", {NKikimrScheme::StatusInvalidParameter});
@@ -302,7 +302,7 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
StreamDescription {
Name: "Stream"
Mode: ECdcStreamModeUpdate
- Format: ECdcStreamFormatDocApiJson
+ Format: ECdcStreamFormatDynamoDBStreamsJson
}
)", {NKikimrScheme::StatusInvalidParameter});
@@ -323,7 +323,7 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
StreamDescription {
Name: "Stream"
Mode: ECdcStreamModeNewAndOldImages
- Format: ECdcStreamFormatDocApiJson
+ Format: ECdcStreamFormatDynamoDBStreamsJson
AwsRegion: "ru-central1"
}
)");
@@ -332,7 +332,7 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
TestDescribeResult(DescribePrivatePath(runtime, "/MyRoot/DocumentTable/Stream"), {
NLs::PathExist,
NLs::StreamMode(NKikimrSchemeOp::ECdcStreamModeNewAndOldImages),
- NLs::StreamFormat(NKikimrSchemeOp::ECdcStreamFormatDocApiJson),
+ NLs::StreamFormat(NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson),
NLs::StreamAwsRegion("ru-central1"),
});
}
diff --git a/ydb/core/tx/schemeshard/ut_cdc_stream_reboots.cpp b/ydb/core/tx/schemeshard/ut_cdc_stream_reboots.cpp
index ed6640335de..eddb1781bdb 100644
--- a/ydb/core/tx/schemeshard/ut_cdc_stream_reboots.cpp
+++ b/ydb/core/tx/schemeshard/ut_cdc_stream_reboots.cpp
@@ -85,7 +85,7 @@ Y_UNIT_TEST_SUITE(TCdcStreamWithRebootsTests) {
StreamDescription {
Name: "Stream"
Mode: ECdcStreamModeNewAndOldImages
- Format: ECdcStreamFormatDocApiJson
+ Format: ECdcStreamFormatDynamoDBStreamsJson
AwsRegion: "ru-central1"
}
)");
@@ -96,7 +96,7 @@ Y_UNIT_TEST_SUITE(TCdcStreamWithRebootsTests) {
TestDescribeResult(DescribePrivatePath(runtime, "/MyRoot/Table/Stream"), {
NLs::PathExist,
NLs::StreamMode(NKikimrSchemeOp::ECdcStreamModeNewAndOldImages),
- NLs::StreamFormat(NKikimrSchemeOp::ECdcStreamFormatDocApiJson),
+ NLs::StreamFormat(NKikimrSchemeOp::ECdcStreamFormatDynamoDBStreamsJson),
NLs::StreamAwsRegion("ru-central1"),
});
}
diff --git a/ydb/core/ydb_convert/table_description.cpp b/ydb/core/ydb_convert/table_description.cpp
index 85738793a09..9d903c8dc9c 100644
--- a/ydb/core/ydb_convert/table_description.cpp
+++ b/ydb/core/ydb_convert/table_description.cpp
@@ -466,8 +466,8 @@ void FillChangefeedDescription(Ydb::Table::DescribeTableResult& out,
case NKikimrSchemeOp::ECdcStreamFormat::ECdcStreamFormatJson:
changefeed->set_format(Ydb::Table::ChangefeedFormat::FORMAT_JSON);
break;
- case NKikimrSchemeOp::ECdcStreamFormat::ECdcStreamFormatDocApiJson:
- changefeed->set_format(Ydb::Table::ChangefeedFormat::FORMAT_DOCUMENT_TABLE_JSON);
+ case NKikimrSchemeOp::ECdcStreamFormat::ECdcStreamFormatDynamoDBStreamsJson:
+ changefeed->set_format(Ydb::Table::ChangefeedFormat::FORMAT_DYNAMODB_STREAMS_JSON);
break;
default:
break;
@@ -511,8 +511,8 @@ bool FillChangefeedDescription(NKikimrSchemeOp::TCdcStreamDescription& out,
case Ydb::Table::ChangefeedFormat::FORMAT_JSON:
out.SetFormat(NKikimrSchemeOp::ECdcStreamFormat::ECdcStreamFormatJson);
break;
- case Ydb::Table::ChangefeedFormat::FORMAT_DOCUMENT_TABLE_JSON:
- out.SetFormat(NKikimrSchemeOp::ECdcStreamFormat::ECdcStreamFormatDocApiJson);
+ case Ydb::Table::ChangefeedFormat::FORMAT_DYNAMODB_STREAMS_JSON:
+ out.SetFormat(NKikimrSchemeOp::ECdcStreamFormat::ECdcStreamFormatDynamoDBStreamsJson);
break;
default:
status = Ydb::StatusIds::BAD_REQUEST;
diff --git a/ydb/public/api/protos/ydb_table.proto b/ydb/public/api/protos/ydb_table.proto
index ed7b6dcaefa..78c17a0611f 100644
--- a/ydb/public/api/protos/ydb_table.proto
+++ b/ydb/public/api/protos/ydb_table.proto
@@ -140,7 +140,7 @@ message ChangefeedFormat {
// Change record in JSON format for common (row oriented) tables
FORMAT_JSON = 1;
// Change record in JSON format for document (DynamoDB-compatible) tables
- FORMAT_DOCUMENT_TABLE_JSON = 2;
+ FORMAT_DYNAMODB_STREAMS_JSON = 2;
}
}
diff --git a/ydb/public/sdk/cpp/client/ydb_table/table.cpp b/ydb/public/sdk/cpp/client/ydb_table/table.cpp
index ed14768f040..305f60fde65 100644
--- a/ydb/public/sdk/cpp/client/ydb_table/table.cpp
+++ b/ydb/public/sdk/cpp/client/ydb_table/table.cpp
@@ -4452,8 +4452,8 @@ TChangefeedDescription TChangefeedDescription::FromProto(const TProto& proto) {
case Ydb::Table::ChangefeedFormat::FORMAT_JSON:
format = EChangefeedFormat::Json;
break;
- case Ydb::Table::ChangefeedFormat::FORMAT_DOCUMENT_TABLE_JSON:
- format = EChangefeedFormat::DocumentTableJson;
+ case Ydb::Table::ChangefeedFormat::FORMAT_DYNAMODB_STREAMS_JSON:
+ format = EChangefeedFormat::DynamoDBStreamsJson;
break;
default:
format = EChangefeedFormat::Unknown;
@@ -4518,8 +4518,8 @@ void TChangefeedDescription::SerializeTo(Ydb::Table::Changefeed& proto) const {
case EChangefeedFormat::Json:
proto.set_format(Ydb::Table::ChangefeedFormat::FORMAT_JSON);
break;
- case EChangefeedFormat::DocumentTableJson:
- proto.set_format(Ydb::Table::ChangefeedFormat::FORMAT_DOCUMENT_TABLE_JSON);
+ case EChangefeedFormat::DynamoDBStreamsJson:
+ proto.set_format(Ydb::Table::ChangefeedFormat::FORMAT_DYNAMODB_STREAMS_JSON);
break;
case EChangefeedFormat::Unknown:
break;
diff --git a/ydb/public/sdk/cpp/client/ydb_table/table_enum.h b/ydb/public/sdk/cpp/client/ydb_table/table_enum.h
index 805c6c0b8cf..516acd49346 100644
--- a/ydb/public/sdk/cpp/client/ydb_table/table_enum.h
+++ b/ydb/public/sdk/cpp/client/ydb_table/table_enum.h
@@ -41,7 +41,7 @@ enum class EChangefeedMode {
enum class EChangefeedFormat {
Json /* "JSON" */,
- DocumentTableJson /* "DOCUMENT_TABLE_JSON" */,
+ DynamoDBStreamsJson /* "DYNAMODB_STREAMS_JSON" */,
Unknown = std::numeric_limits<int>::max()
};