30 namespace data_conversion {
55 auto chunk_metadata = std::make_shared<ChunkMetadata>();
57 chunk_metadata->sqlType = dst_type_info;
58 chunk_metadata->chunkStats.has_nulls =
has_nulls_;
61 return chunk_metadata;
72 template <
typename DataType>
73 bool isNull(
const DataType& typed_value) {
74 if constexpr (std::is_arithmetic<DataType>::value) {
75 auto null = foreign_storage::get_null_value<DataType>();
76 if (typed_value == null) {
79 }
else if constexpr (std::is_same<DataType, std::string>::value ||
80 std::is_same<DataType, std::string_view>::value) {
81 if (typed_value.empty()) {
95 template <
typename DataType_,
typename MetadataType_ = DataType_>
103 min_ = std::numeric_limits<MetadataType>::max();
104 max_ = std::numeric_limits<MetadataType>::lowest();
116 if constexpr (std::is_arithmetic<DataType>::value) {
117 auto null = foreign_storage::get_null_value<DataType>();
119 }
else if constexpr (std::is_same<DataType, std::string>::value ||
120 std::is_same<DataType, std::string_view>::value) {
121 return std::string{};
128 const bool is_date_in_days =
false) {
129 if (is_date_in_days) {
132 min_ = std::min<MetadataType>(
min_, to_compare);
133 max_ = std::max<MetadataType>(
max_, to_compare);
135 min_ = std::min<MetadataType>(
min_, typed_value);
136 max_ = std::max<MetadataType>(
max_, typed_value);
void initializeDeleteBuffer(const size_t size_hint)
void updateMetadataStats(const DataType &typed_value, const bool is_date_in_days=false)
virtual void encodeAndAppendData(const int8_t *data, const size_t num_elements)=0
BaseConvertEncoder(const bool error_tracking_enabled)
virtual std::shared_ptr< ChunkMetadata > getMetadata(const Chunk_NS::Chunk &chunk) const
This file contains the class specification and related data structures for Catalog.
const ColumnDescriptor * getColumnDesc() const
int64_t get_epoch_seconds_from_days(const int64_t days)
This file contains the class specification and related data structures for SysCatalog.
bool isNull(const DataType &typed_value)
std::optional< std::vector< bool > > delete_buffer_
virtual ~BaseConvertEncoder()
AbstractBuffer * getBuffer() const
MetadataType MetadataType
TypedBaseConvertEncoder(const bool error_tracking_enabled)
std::shared_ptr< ChunkMetadata > getMetadata(const Chunk_NS::Chunk &chunk) const override
bool g_enable_watchdog false
virtual void finalize(const size_t rows_appended)
const bool error_tracking_enabled_