inline void iterateUnaryInl(AggregationStateSum *state, const TypedValue &value) const { DCHECK(value.isPlausibleInstanceOf(argument_type_.getSignature())); if (value.isNull()) return; SpinMutexLock lock(state->mutex_); state->sum_ = fast_operator_->applyToTypedValues(state->sum_, value); state->null_ = false; }
/** * @brief Overwrite the value at the specified position with the supplied * TypedValue. * @warning You must call prepareForPositionalWrites() BEFORE calling this * method. * @warning Do NOT use positional writes in combination with appends. * @warning It is intended that this and other positional write methods * should be called exactly once for each position (if this is * violated, NULLs may not be tracked properly). * * @param position The position of the value in this NativeColumnVector to * overwrite. * @param value A TypedValue to write into this NativeColumnVector. **/ inline void positionalWriteTypedValue(const std::size_t position, const TypedValue &value) { DCHECK_LT(position, actual_length_); DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); if (null_bitmap_ && value.isNull()) { null_bitmap_->setBit(position, true); } else { DCHECK(!value.isNull()); value.copyInto(static_cast<char*>(values_) + (position * type_length_)); } }
/** * @brief Append a TypedValue to this NativeColumnVector. * * @param value A value to append to this NativeColumnVector. **/ inline void appendTypedValue(const TypedValue &value) { DCHECK_LT(actual_length_, reserved_length_); DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); if (null_bitmap_ && value.isNull()) { null_bitmap_->setBit(actual_length_, true); } else { DCHECK(!value.isNull()); value.copyInto(static_cast<char*>(values_) + (actual_length_ * type_length_)); } ++actual_length_; }
/** * @brief Fill this entire ColumnVector with copies of value. * * @param value A value to fill this ColumnVector with. **/ inline void fillWithValue(const TypedValue &value) { DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); if (value.isNull()) { fillWithNulls(); } else { if (null_bitmap_) { null_bitmap_->clear(); } for (std::size_t pos = 0; pos < reserved_length_; ++pos) { value.copyInto(static_cast<char*>(values_) + (pos * type_length_)); } actual_length_ = reserved_length_; } }
/** * @brief Overwrite the value at the specified position with the supplied * TypedValue. * @warning You must call prepareForPositionalWrites() BEFORE calling this * method. * @warning Do NOT use positional writes in combination with appends. * * @param position The position of the value in this IndirectColumnVector to * overwrite. * @param value A TypedValue to write into this IndirectColumnVector. **/ inline void positionalWriteTypedValue(const std::size_t position, const TypedValue &value) { DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); DCHECK_LT(position, values_.size()); values_[position] = value; }
/** * @brief Fill this entire ColumnVector with copies of value. * * @param value A value to fill this ColumnVector with. **/ inline void fillWithValue(const TypedValue &value) { DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); values_.assign(reserved_length_, value); }
/** * @brief Append a TypedValue to this IndirectColumnVector. * * @param value A value to append to this NativeColumnVector. **/ inline void appendTypedValue(const TypedValue &value) { DCHECK(value.isPlausibleInstanceOf(type_.getSignature())); DCHECK_LT(values_.size(), reserved_length_); values_.emplace_back(value); }