◆ SelectionVector() [1/6]
| duckdb::SelectionVector::SelectionVector |
( |
| ) |
|
|
inline |
8772 : sel_vector(nullptr) {
8773 }
◆ SelectionVector() [2/6]
| duckdb::SelectionVector::SelectionVector |
( |
sel_t * | sel | ) |
|
|
inlineexplicit |
8774 {
8775 Initialize(sel);
8776 }
◆ SelectionVector() [3/6]
| duckdb::SelectionVector::SelectionVector |
( |
idx_t | count | ) |
|
|
inlineexplicit |
8777 {
8778 Initialize(count);
8779 }
◆ SelectionVector() [4/6]
| duckdb::SelectionVector::SelectionVector |
( |
idx_t | start, |
|
|
idx_t | count ) |
|
inline |
8780 {
8781 Initialize(MaxValue<idx_t>(count, STANDARD_VECTOR_SIZE));
8782 for (
idx_t i = 0; i < count; i++) {
8783 set_index(i, start + i);
8784 }
8785 }
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ SelectionVector() [5/6]
| duckdb::SelectionVector::SelectionVector |
( |
const SelectionVector & | sel_vector | ) |
|
|
inline |
8786 {
8787 Initialize(sel_vector);
8788 }
◆ SelectionVector() [6/6]
8789 {
8790 Initialize(std::move(data));
8791 }
◆ operator=()
| SelectionVector & duckdb::SelectionVector::operator= |
( |
SelectionVector && | other | ) |
|
|
inlinenoexcept |
8792 {
8793 sel_vector = other.sel_vector;
8794 other.sel_vector = nullptr;
8795 selection_data = std::move(other.selection_data);
8796 return *this;
8797 }
◆ Inverted()
| idx_t duckdb::SelectionVector::Inverted |
( |
const SelectionVector & | src, |
|
|
SelectionVector & | dst, |
|
|
idx_t | source_size, |
|
|
idx_t | count ) |
|
inlinestatic |
8800 {
8803 for (
idx_t i = 0; i < count; i++) {
8804 if (src_idx < source_size && src.get_index(src_idx) == i) {
8805 src_idx++;
8806
8807 continue;
8808 }
8809
8810 dst.set_index(dst_idx++, i);
8811 }
8812 return dst_idx;
8813 }
◆ Initialize() [1/4]
| void duckdb::SelectionVector::Initialize |
( |
sel_t * | sel | ) |
|
|
inline |
8815 {
8816 selection_data.reset();
8817 sel_vector = sel;
8818 }
◆ Initialize() [2/4]
| void duckdb::SelectionVector::Initialize |
( |
idx_t | count = STANDARD_VECTOR_SIZE | ) |
|
|
inline |
8819 {
8820 selection_data = make_shared_ptr<SelectionData>(count);
8821 sel_vector =
reinterpret_cast<sel_t *
>(selection_data->owned_data.get());
8822 }
uint32_t sel_t
Type used for the selection vector.
Definition duckdb.hpp:251
◆ Initialize() [3/4]
8823 {
8824 selection_data = std::move(data);
8825 sel_vector =
reinterpret_cast<sel_t *
>(selection_data->owned_data.get());
8826 }
◆ Initialize() [4/4]
| void duckdb::SelectionVector::Initialize |
( |
const SelectionVector & | other | ) |
|
|
inline |
8827 {
8828 selection_data = other.selection_data;
8829 sel_vector = other.sel_vector;
8830 }
◆ set_index()
| void duckdb::SelectionVector::set_index |
( |
idx_t | idx, |
|
|
idx_t | loc ) |
|
inline |
8832 {
8833 sel_vector[idx] = UnsafeNumericCast<sel_t>(loc);
8834 }
◆ swap()
| void duckdb::SelectionVector::swap |
( |
idx_t | i, |
|
|
idx_t | j ) |
|
inline |
8835 {
8836 sel_t tmp = sel_vector[i];
8837 sel_vector[i] = sel_vector[j];
8838 sel_vector[j] = tmp;
8839 }
◆ get_index()
| idx_t duckdb::SelectionVector::get_index |
( |
idx_t | idx | ) |
const |
|
inline |
8840 {
8841 return sel_vector ? get_index_unsafe(idx) : idx;
8842 }
◆ get_index_unsafe()
| idx_t duckdb::SelectionVector::get_index_unsafe |
( |
idx_t | idx | ) |
const |
|
inline |
8843 {
8844 return sel_vector[idx];
8845 }
◆ data() [1/2]
| sel_t * duckdb::SelectionVector::data |
( |
| ) |
|
|
inline |
8846 {
8847 return sel_vector;
8848 }
◆ data() [2/2]
| const sel_t * duckdb::SelectionVector::data |
( |
| ) |
const |
|
inline |
8849 {
8850 return sel_vector;
8851 }
◆ sel_data()
8852 {
8853 return selection_data;
8854 }
◆ Slice()
128920 {
128921 auto data = make_buffer<SelectionData>(count);
128922 auto result_ptr =
reinterpret_cast<sel_t *
>(data->owned_data.get());
128923
128924 for (
idx_t i = 0; i < count; i++) {
128925 auto new_idx = sel.get_index(i);
128926 auto idx = this->get_index(new_idx);
128927 result_ptr[i] = UnsafeNumericCast<sel_t>(idx);
128928 }
128929 return data;
128930}
◆ SliceInPlace()
| idx_t duckdb::SelectionVector::SliceInPlace |
( |
const SelectionVector & | sel, |
|
|
idx_t | count ) |
128932 {
128933 for (
idx_t i = 0; i < count; ++i) {
128934 set_index(i, get_index(source.get_index(i)));
128935 }
128936
128937 return count;
128938}
◆ ToString()
| string duckdb::SelectionVector::ToString |
( |
idx_t | count = 0 | ) |
const |
128899 {
128900 string result =
"Selection Vector (" +
to_string(count) +
") [";
128901 for (
idx_t i = 0; i < count; i++) {
128902 if (i != 0) {
128903 result += ", ";
128904 }
128906 }
128907 result += "]";
128908 return result;
128909}
std::string to_string(const T &value)
Definition duckdb.cpp:19425
◆ Print()
| void duckdb::SelectionVector::Print |
( |
idx_t | count = 0 | ) |
const |
128915 {
128917}
static DUCKDB_API void Print(OutputStream stream, const string &str)
Print the object to the stream.
Definition duckdb.cpp:92556
◆ operator[]() [1/2]
| const sel_t & duckdb::SelectionVector::operator[] |
( |
idx_t | index | ) |
const |
|
inline |
8861 {
8862 return sel_vector[
index];
8863 }
◆ operator[]() [2/2]
| sel_t & duckdb::SelectionVector::operator[] |
( |
idx_t | index | ) |
|
|
inline |
8864 {
8865 return sel_vector[
index];
8866 }
◆ IsSet()
| bool duckdb::SelectionVector::IsSet |
( |
| ) |
const |
|
inline |
8867 {
8868 return sel_vector;
8869 }
◆ Verify()
| void duckdb::SelectionVector::Verify |
( |
idx_t | count, |
|
|
idx_t | vector_size ) const |
128940 {
128941#ifdef DEBUG
128942 D_ASSERT(vector_size >= 1);
128943 for (
idx_t i = 0; i < count; i++) {
128944 auto index = get_index(i);
128945 if (index >= vector_size) {
128946 throw InternalException(
128947 "Provided SelectionVector is invalid, index %d points to %d, which is out of range. "
128948 "the valid range (0-%d)",
128949 i, index, vector_size - 1);
128950 }
128951 }
128952#endif
128953}
◆ Sort()
| void duckdb::SelectionVector::Sort |
( |
idx_t | count | ) |
|
128911 {
128912 std::sort(sel_vector, sel_vector + count);
128913}
The documentation for this struct was generated from the following files: