aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuryalekseev <yuryalekseev@yandex-team.com>2024-07-05 14:30:04 +0300
committeryuryalekseev <yuryalekseev@yandex-team.com>2024-07-05 14:41:48 +0300
commit1d6fb2a5cf56114e8f127c0be7698c9dbe09d480 (patch)
tree0054b18b830ddec9715158fff57d165d63d1970a
parent49dfa72148d692366d88b433ff9cf95596001133 (diff)
downloadydb-1d6fb2a5cf56114e8f127c0be7698c9dbe09d480.tar.gz
Don't consider stable names when checking compatibility of input and output columns.
cbe85bb9316beddc536a69eeddac0ea6d0a98e2e
-rw-r--r--yt/yt/client/table_client/check_schema_compatibility.cpp4
-rw-r--r--yt/yt/client/table_client/check_schema_compatibility.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/yt/yt/client/table_client/check_schema_compatibility.cpp b/yt/yt/client/table_client/check_schema_compatibility.cpp
index 6e7f7ddbc7..b1e5d34bae 100644
--- a/yt/yt/client/table_client/check_schema_compatibility.cpp
+++ b/yt/yt/client/table_client/check_schema_compatibility.cpp
@@ -52,7 +52,7 @@ std::pair<ESchemaCompatibility, TError> CheckTableSchemaCompatibilityImpl(
}
if (inputColumn) {
- if (inputColumn->StableName() != outputColumn.StableName()) {
+ if (!options.IgnoreStableNamesDifference && inputColumn->StableName() != outputColumn.StableName()) {
return {
ESchemaCompatibility::Incompatible,
TError("Column %Qv has stable name %Qv in input and %Qv in output schema",
@@ -192,7 +192,7 @@ std::pair<ESchemaCompatibility, TError> CheckTableSchemaCompatibilityImpl(
for (int index = 0; index < outputKeySchema->GetColumnCount(); ++index) {
const auto& inputColumn = inputKeySchema->Columns()[index];
const auto& outputColumn = outputKeySchema->Columns()[index];
- if (inputColumn.StableName() != outputColumn.StableName()) {
+ if (!options.IgnoreStableNamesDifference && inputColumn.StableName() != outputColumn.StableName()) {
return {
ESchemaCompatibility::Incompatible,
TError("Key columns do not match: input column %v, output column %v",
diff --git a/yt/yt/client/table_client/check_schema_compatibility.h b/yt/yt/client/table_client/check_schema_compatibility.h
index 5f38be121f..8c828615f1 100644
--- a/yt/yt/client/table_client/check_schema_compatibility.h
+++ b/yt/yt/client/table_client/check_schema_compatibility.h
@@ -10,6 +10,7 @@ struct TTableSchemaCompatibilityOptions
{
bool IgnoreSortOrder;
bool ForbidExtraComputedColumns = true;
+ bool IgnoreStableNamesDifference = false;
};
// Validates that values from table with inputSchema also match outputSchema.