-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove blob columns not present in current scheme
- Loading branch information
Showing
15 changed files
with
161 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#pragma once | ||
|
||
#include <ydb/library/actors/core/log.h> | ||
|
||
#include <util/system/types.h> | ||
|
||
#include <vector> | ||
|
||
namespace NKikimr::NArrow::NUtil { | ||
|
||
template <typename T> | ||
class TDefaultErasePolicy { | ||
public: | ||
void OnEraseItem(const T& /*item*/) const { | ||
} | ||
void OnMoveItem(const T& /*item*/, const ui64 /*new_index*/) const { | ||
} | ||
}; | ||
|
||
template <typename T, typename ErasePolicy = TDefaultErasePolicy<T>> | ||
void EraseItems(std::vector<T>& container, const std::vector<ui32>& idxsToErase, const ErasePolicy& policy = TDefaultErasePolicy<T>()) { | ||
if (idxsToErase.empty()) { | ||
return; | ||
} | ||
AFL_VERIFY(idxsToErase.front() < container.size()); | ||
|
||
auto itNextEraseIdx = idxsToErase.begin(); | ||
ui64 writeIdx = idxsToErase.front(); | ||
ui64 readIdx = idxsToErase.front(); | ||
while (readIdx != container.size()) { | ||
AFL_VERIFY(itNextEraseIdx != idxsToErase.end() && readIdx == *itNextEraseIdx); | ||
|
||
policy.OnEraseItem(container[readIdx]); | ||
++readIdx; | ||
++itNextEraseIdx; | ||
if (itNextEraseIdx != idxsToErase.end()) { | ||
AFL_VERIFY(*itNextEraseIdx > *std::prev(itNextEraseIdx)); | ||
AFL_VERIFY(*itNextEraseIdx < container.size()); | ||
} | ||
|
||
const ui64 nextReadIdx = itNextEraseIdx == idxsToErase.end() ? container.size() : *itNextEraseIdx; | ||
while (readIdx != nextReadIdx) { | ||
std::swap(container[writeIdx], container[readIdx]); | ||
policy.OnMoveItem(container[writeIdx], writeIdx); | ||
++writeIdx; | ||
++readIdx; | ||
} | ||
} | ||
|
||
container.resize(writeIdx); | ||
AFL_VERIFY(itNextEraseIdx == idxsToErase.end()); | ||
} | ||
|
||
} // namespace NKikimr::NArrow::NUtil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters