Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 committed Jan 17, 2024
1 parent 574f3ab commit 56d13ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 7 additions & 1 deletion ydb/core/tx/columnshard/engines/scheme/abstract_scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ std::shared_ptr<arrow::Field> ISnapshotSchema::GetFieldByIndex(const int index)
}
return schema->field(index);
}
std::shared_ptr<arrow::Field> ISnapshotSchema::GetFieldByColumnId(const ui32 columnId) const {
std::shared_ptr<arrow::Field> ISnapshotSchema::GetFieldByColumnIdOptional(const ui32 columnId) const {
return GetFieldByIndex(GetFieldIndex(columnId));
}

Expand Down Expand Up @@ -110,4 +110,10 @@ ui32 ISnapshotSchema::GetColumnId(const std::string& columnName) const {
return *id;
}

std::shared_ptr<arrow::Field> ISnapshotSchema::GetFieldByColumnIdVerified(const ui32 columnId) const {
auto result = GetFieldByColumnIdOptional(columnId);
AFL_VERIFY(result)("event", "unknown_column")("column_id", columnId)("schema", DebugString());
return result;
}

}
8 changes: 2 additions & 6 deletions ydb/core/tx/columnshard/engines/scheme/abstract_scheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,8 @@ class ISnapshotSchema {

ui32 GetColumnId(const std::string& columnName) const;
std::shared_ptr<arrow::Field> GetFieldByIndex(const int index) const;
std::shared_ptr<arrow::Field> GetFieldByColumnId(const ui32 columnId) const;
std::shared_ptr<arrow::Field> GetFieldByColumnIdVerified(const ui32 columnId) const {
auto result = GetFieldByColumnId(columnId);
Y_ABORT_UNLESS(result);
return result;
}
std::shared_ptr<arrow::Field> GetFieldByColumnIdOptional(const ui32 columnId) const;
std::shared_ptr<arrow::Field> GetFieldByColumnIdVerified(const ui32 columnId) const;

TString DebugString() const {
return DoDebugString();
Expand Down

0 comments on commit 56d13ea

Please sign in to comment.