Skip to content

Commit

Permalink
Auto stash before merge of "many_phases_select" and "origin/many_phas…
Browse files Browse the repository at this point in the history
…es_select"

fix
  • Loading branch information
ivanmorozov333 committed Jan 17, 2024
2 parents 56d13ea + 1bcd1bf commit b40c765
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions ydb/core/tx/columnshard/engines/portions/portion_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ class TPortionInfo {
TSerializationStats GetSerializationStat(const ISnapshotSchema& schema) const {
TSerializationStats result;
for (auto&& i : Records) {
result.AddStat(i.GetSerializationStat(schema.GetFieldByColumnIdVerified(i.ColumnId)->name()));
if (schema.GetFieldByColumnIdOptional(i.ColumnId)) {
result.AddStat(i.GetSerializationStat(schema.GetFieldByColumnIdVerified(i.ColumnId)->name()));
}
}
return result;
}
Expand Down Expand Up @@ -149,8 +151,7 @@ class TPortionInfo {
: PathId(pathId)
, Portion(portionId)
, MinSnapshot(minSnapshot)
, BlobsOperator(blobsOperator)
{
, BlobsOperator(blobsOperator) {
}

TString DebugString(const bool withDetails = false) const;
Expand Down Expand Up @@ -397,22 +398,30 @@ class TPortionInfo {
public:
TAssembleBlobInfo(const ui32 rowsCount)
: NullRowsCount(rowsCount) {

AFL_VERIFY(NullRowsCount);
}

TAssembleBlobInfo(const TString& data)
: Data(data) {

AFL_VERIFY(!!Data);
}

ui32 GetNullRowsCount() const noexcept {
return NullRowsCount;
return NullRowsCount;
}

const TString& GetData() const noexcept {
return Data;
}

bool IsBlob() const {
return !NullRowsCount && !!Data;
}

bool IsNull() const {
return NullRowsCount && !Data;
}

std::shared_ptr<arrow::RecordBatch> BuildRecordBatch(const TColumnLoader& loader) const;
};

Expand All @@ -435,8 +444,7 @@ class TPortionInfo {

TPreparedColumn(std::vector<TAssembleBlobInfo>&& blobs, const std::shared_ptr<TColumnLoader>& loader)
: Loader(loader)
, Blobs(std::move(blobs))
{
, Blobs(std::move(blobs)) {
Y_ABORT_UNLESS(Loader);
Y_ABORT_UNLESS(Loader->GetExpectedSchema()->num_fields() == 1);
}
Expand Down Expand Up @@ -503,8 +511,7 @@ class TPortionInfo {
TPreparedBatchData(std::vector<TPreparedColumn>&& columns, std::shared_ptr<arrow::Schema> schema, const size_t rowsCount)
: Columns(std::move(columns))
, Schema(schema)
, RowsCount(rowsCount)
{
, RowsCount(rowsCount) {
}

std::shared_ptr<arrow::RecordBatch> Assemble(const TAssembleOptions& options = {}) const;
Expand All @@ -523,8 +530,7 @@ class TPortionInfo {
: ColumnId(resultLoader->GetColumnId())
, NumRows(numRows)
, DataLoader(dataLoader)
, ResultLoader(resultLoader)
{
, ResultLoader(resultLoader) {
AFL_VERIFY(ResultLoader);
if (DataLoader) {
AFL_VERIFY(ResultLoader->GetColumnId() == DataLoader->GetColumnId());
Expand Down Expand Up @@ -596,8 +602,8 @@ class TPortionInfo {
}

std::shared_ptr<arrow::RecordBatch> AssembleInBatch(const ISnapshotSchema& dataSchema,
const ISnapshotSchema& resultSchema,
THashMap<TBlobRange, TString>& data) const {
const ISnapshotSchema& resultSchema,
THashMap<TBlobRange, TString>& data) const {
auto batch = PrepareForAssemble(dataSchema, resultSchema, data).Assemble();
Y_ABORT_UNLESS(batch->Validate().ok());
return batch;
Expand Down

0 comments on commit b40c765

Please sign in to comment.