MCPcopy Create free account
hub / github.com/bytedance/bolt / resize

Method resize

bolt/vector/ComplexVector.cpp:675–695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675void RowVector::resize(vector_size_t newSize, bool setNotNull) {
676 const auto oldSize = size();
677 BaseVector::resize(newSize, setNotNull);
678
679 // Resize all the children.
680 for (auto& child : children_) {
681 if (child != nullptr) {
682 if (child->isLazy()) {
683 BOLT_FAIL("Resize on a lazy vector is not allowed");
684 }
685
686 // If we are just reducing the size of the vector, its safe
687 // to skip uniqueness check since effectively we are just changing
688 // the length.
689 if (newSize > oldSize) {
690 BOLT_CHECK(child.use_count() == 1, "Resizing shared child vector");
691 child->resize(newSize, setNotNull);
692 }
693 }
694 }
695}
696
697// static
698bool RowVector::isComposite(const std::shared_ptr<RowVector>& input) {

Callers 2

copyRangesImplMethod · 0.45
createInternalMethod · 0.45

Calls 3

sizeFunction · 0.85
applyToSelectedMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected