OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DateDaysEncoder< T, V > Class Template Reference

#include <DateDaysEncoder.h>

+ Inheritance diagram for DateDaysEncoder< T, V >:
+ Collaboration diagram for DateDaysEncoder< T, V >:

Public Member Functions

 DateDaysEncoder (Data_Namespace::AbstractBuffer *buffer)
 
size_t getNumElemsForBytesEncodedDataAtIndices (const int8_t *index_data, const std::vector< size_t > &selected_idx, const size_t byte_limit) override
 
std::shared_ptr< ChunkMetadataappendEncodedDataAtIndices (const int8_t *, int8_t *data, const std::vector< size_t > &selected_idx) override
 
std::shared_ptr< ChunkMetadataappendEncodedData (const int8_t *, int8_t *data, const size_t start_idx, const size_t num_elements) override
 
std::shared_ptr< ChunkMetadataappendData (int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1) override
 
void getMetadata (const std::shared_ptr< ChunkMetadata > &chunkMetadata) override
 
std::shared_ptr< ChunkMetadatagetMetadata (const SQLTypeInfo &ti) override
 
void updateStats (const int64_t val, const bool is_null) override
 
void updateStats (const double val, const bool is_null) override
 
void updateStats (const int8_t *const src_data, const size_t num_elements) override
 
void updateStats (const std::vector< std::string > *const src_data, const size_t start_idx, const size_t num_elements) override
 
void updateStats (const std::vector< ArrayDatum > *const src_data, const size_t start_idx, const size_t num_elements) override
 
void reduceStats (const Encoder &that) override
 
void copyMetadata (const Encoder *copyFromEncoder) override
 
void writeMetadata (FILE *f) override
 
void readMetadata (FILE *f) override
 
bool resetChunkStats (const ChunkStats &stats) override
 : Reset chunk level stats (min, max, nulls) using new values from the argument. More...
 
void resetChunkStats () override
 
- Public Member Functions inherited from Encoder
 Encoder (Data_Namespace::AbstractBuffer *buffer)
 
virtual ~Encoder ()
 
virtual void updateStatsEncoded (const int8_t *const dst_data, const size_t num_elements)
 
size_t getNumElems () const
 
void setNumElems (const size_t num_elems)
 

Public Attributes

dataMin
 
dataMax
 
bool has_nulls
 

Private Member Functions

std::shared_ptr< ChunkMetadataappendEncodedOrUnencodedData (int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating, const int64_t offset, const bool is_encoded)
 
void updateStatsWithAlreadyEncoded (const V &encoded_data)
 
encodeDataAndUpdateStats (const T &unencoded_data)
 

Additional Inherited Members

- Static Public Member Functions inherited from Encoder
static EncoderCreate (Data_Namespace::AbstractBuffer *buffer, const SQLTypeInfo sqlType)
 
- Protected Attributes inherited from Encoder
size_t num_elems_
 
Data_Namespace::AbstractBufferbuffer_
 
DecimalOverflowValidator decimal_overflow_validator_
 
DateDaysOverflowValidator date_days_overflow_validator_
 

Detailed Description

template<typename T, typename V>
class DateDaysEncoder< T, V >

Definition at line 31 of file DateDaysEncoder.h.

Constructor & Destructor Documentation

template<typename T, typename V>
DateDaysEncoder< T, V >::DateDaysEncoder ( Data_Namespace::AbstractBuffer buffer)
inline

Definition at line 33 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::resetChunkStats().

33  : Encoder(buffer) {
35  }
void resetChunkStats() override
Encoder(Data_Namespace::AbstractBuffer *buffer)
Definition: Encoder.cpp:225

+ Here is the call graph for this function:

Member Function Documentation

template<typename T, typename V>
std::shared_ptr<ChunkMetadata> DateDaysEncoder< T, V >::appendData ( int8_t *&  src_data,
const size_t  num_elems_to_append,
const SQLTypeInfo ti,
const bool  replicating = false,
const int64_t  offset = -1 
)
inlineoverridevirtual

Append data to the chunk buffer backing this encoder.

Parameters
src_dataSource data for the append
num_elems_to_appendNumber of elements to append
tiSQL Type Info for the column TODO(adb): used?
replicatingPass one value and fill the chunk with it
offsetWrite data starting at a given offset. Default is -1 which indicates an append, an offset of 0 rewrites the chunk up to num_elems_to_append.

Implements Encoder.

Definition at line 72 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::appendEncodedOrUnencodedData().

76  {
78  src_data, num_elems_to_append, ti, replicating, offset, false);
79  }
std::shared_ptr< ChunkMetadata > appendEncodedOrUnencodedData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating, const int64_t offset, const bool is_encoded)

+ Here is the call graph for this function:

template<typename T, typename V>
std::shared_ptr<ChunkMetadata> DateDaysEncoder< T, V >::appendEncodedData ( const int8_t *  index_data,
int8_t *  data,
const size_t  start_idx,
const size_t  num_elements 
)
inlineoverridevirtual

Append encoded data to the chunk buffer backing this encoder.

Parameters
index_data- (optional) the index data of data to append
data- the data to append
start_idx- the position to start encoding from in the data array
num_elements- the number of elements to encode from the data array
Returns
updated chunk metadata for the chunk buffer backing this encoder

NOTE: index_data must be non-null for varlen encoder types.

Implements Encoder.

Definition at line 63 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::appendEncodedOrUnencodedData().

Referenced by DateDaysEncoder< T, V >::appendEncodedDataAtIndices().

66  {
67  auto current_data = data + sizeof(V) * start_idx;
69  current_data, num_elements, SQLTypeInfo{}, false, -1, true);
70  }
std::shared_ptr< ChunkMetadata > appendEncodedOrUnencodedData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating, const int64_t offset, const bool is_encoded)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T, typename V>
std::shared_ptr<ChunkMetadata> DateDaysEncoder< T, V >::appendEncodedDataAtIndices ( const int8_t *  index_data,
int8_t *  data,
const std::vector< size_t > &  selected_idx 
)
inlineoverridevirtual

Append selected encoded data to the chunk buffer backing this encoder.

Parameters
index_data- (optional) the index data of data to append
data- the data to append
selected_idx- which indices in the encoded data to append
Returns
updated chunk metadata for the chunk buffer backing this encoder

NOTE: index_data must be non-null for varlen encoder types.

Implements Encoder.

Definition at line 46 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::appendEncodedData(), and shared::execute_over_contiguous_indices().

49  {
50  std::shared_ptr<ChunkMetadata> chunk_metadata;
51  // NOTE: the use of `execute_over_contiguous_indices` is an optimization;
52  // it prevents having to copy or move the indexed data and instead performs
53  // an append over contiguous sections of indices.
55  selected_idx, [&](const size_t start_pos, const size_t end_pos) {
56  size_t elem_count = end_pos - start_pos;
57  chunk_metadata =
58  appendEncodedData(nullptr, data, selected_idx[start_pos], elem_count);
59  });
60  return chunk_metadata;
61  }
void execute_over_contiguous_indices(const std::vector< size_t > &indices, std::function< void(const size_t, const size_t)> to_execute)
Definition: Iteration.h:22
std::shared_ptr< ChunkMetadata > appendEncodedData(const int8_t *, int8_t *data, const size_t start_idx, const size_t num_elements) override

+ Here is the call graph for this function:

template<typename T, typename V>
std::shared_ptr<ChunkMetadata> DateDaysEncoder< T, V >::appendEncodedOrUnencodedData ( int8_t *&  src_data,
const size_t  num_elems_to_append,
const SQLTypeInfo ti,
const bool  replicating,
const int64_t  offset,
const bool  is_encoded 
)
inlineprivate

Definition at line 193 of file DateDaysEncoder.h.

References Data_Namespace::AbstractBuffer::append(), Encoder::buffer_, CHECK, CHECK_GE, DateDaysEncoder< T, V >::encodeDataAndUpdateStats(), DateDaysEncoder< T, V >::getMetadata(), Encoder::num_elems_, Data_Namespace::AbstractBuffer::reserve(), DateDaysEncoder< T, V >::resetChunkStats(), Data_Namespace::AbstractBuffer::size(), heavydb.dtypes::T, DateDaysEncoder< T, V >::updateStatsWithAlreadyEncoded(), and Data_Namespace::AbstractBuffer::write().

Referenced by DateDaysEncoder< T, V >::appendData(), and DateDaysEncoder< T, V >::appendEncodedData().

199  {
200  if (offset == 0 && num_elems_to_append >= num_elems_) {
201  resetChunkStats();
202  }
203 
204  CHECK(!is_encoded || !replicating); // do not support replicating of encoded data
205 
206  T* unencoded_data = reinterpret_cast<T*>(src_data);
207  std::vector<V> encoded_data;
208  V* data_to_write = nullptr;
209  if (!is_encoded) {
210  encoded_data.resize(num_elems_to_append);
211  data_to_write = encoded_data.data();
212  for (size_t i = 0; i < num_elems_to_append; ++i) {
213  size_t ri = replicating ? 0 : i;
214  encoded_data[i] = encodeDataAndUpdateStats(unencoded_data[ri]);
215  }
216  } else {
217  data_to_write = reinterpret_cast<V*>(src_data);
218  for (size_t i = 0; i < num_elems_to_append; ++i) {
219  updateStatsWithAlreadyEncoded(data_to_write[i]);
220  }
221  }
222 
223  if (offset == -1) {
224  auto append_data_size = num_elems_to_append * sizeof(V);
225  buffer_->reserve(buffer_->size() + append_data_size);
226  num_elems_ += num_elems_to_append;
227  buffer_->append(reinterpret_cast<int8_t*>(data_to_write), append_data_size);
228  if (!replicating) {
229  src_data += num_elems_to_append * sizeof(T);
230  }
231  } else {
232  num_elems_ = offset + num_elems_to_append;
233  CHECK(!replicating);
234  CHECK_GE(offset, 0);
235  buffer_->write(reinterpret_cast<int8_t*>(data_to_write),
236  num_elems_to_append * sizeof(V),
237  static_cast<size_t>(offset));
238  }
239 
240  auto chunk_metadata = std::make_shared<ChunkMetadata>();
241  getMetadata(chunk_metadata);
242  return chunk_metadata;
243  }
size_t num_elems_
Definition: Encoder.h:288
#define CHECK_GE(x, y)
Definition: Logger.h:306
void resetChunkStats() override
Data_Namespace::AbstractBuffer * buffer_
Definition: Encoder.h:290
V encodeDataAndUpdateStats(const T &unencoded_data)
virtual void write(int8_t *src, const size_t num_bytes, const size_t offset=0, const MemoryLevel src_buffer_type=CPU_LEVEL, const int src_device_id=-1)=0
void getMetadata(const std::shared_ptr< ChunkMetadata > &chunkMetadata) override
virtual void append(int8_t *src, const size_t num_bytes, const MemoryLevel src_buffer_type=CPU_LEVEL, const int device_id=-1)=0
#define CHECK(condition)
Definition: Logger.h:291
void updateStatsWithAlreadyEncoded(const V &encoded_data)
virtual void reserve(size_t num_bytes)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T, typename V>
void DateDaysEncoder< T, V >::copyMetadata ( const Encoder copyFromEncoder)
inlineoverridevirtual

Implements Encoder.

Definition at line 144 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, Encoder::getNumElems(), DateDaysEncoder< T, V >::has_nulls, and Encoder::num_elems_.

144  {
145  num_elems_ = copyFromEncoder->getNumElems();
146  auto castedEncoder = reinterpret_cast<const DateDaysEncoder<T, V>*>(copyFromEncoder);
147  dataMin = castedEncoder->dataMin;
148  dataMax = castedEncoder->dataMax;
149  has_nulls = castedEncoder->has_nulls;
150  }
size_t num_elems_
Definition: Encoder.h:288
size_t getNumElems() const
Definition: Encoder.h:284

+ Here is the call graph for this function:

template<typename T, typename V>
V DateDaysEncoder< T, V >::encodeDataAndUpdateStats ( const T &  unencoded_data)
inlineprivate

Definition at line 255 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, Encoder::date_days_overflow_validator_, DateConverters::get_epoch_days_from_seconds(), DateConverters::get_epoch_seconds_from_days(), DateDaysEncoder< T, V >::has_nulls, heavydb.dtypes::T, and DateDaysOverflowValidator::validate().

Referenced by DateDaysEncoder< T, V >::appendEncodedOrUnencodedData(), and DateDaysEncoder< T, V >::updateStats().

255  {
256  V encoded_data;
257  if (unencoded_data == std::numeric_limits<V>::min()) {
258  has_nulls = true;
259  encoded_data = static_cast<V>(unencoded_data);
260  } else {
261  date_days_overflow_validator_.validate(unencoded_data);
262  encoded_data = DateConverters::get_epoch_days_from_seconds(unencoded_data);
263  const T data = DateConverters::get_epoch_seconds_from_days(encoded_data);
264  dataMax = std::max(dataMax, data);
265  dataMin = std::min(dataMin, data);
266  }
267  return encoded_data;
268  }
int64_t get_epoch_seconds_from_days(const int64_t days)
void validate(T value)
Definition: Encoder.h:122
DateDaysOverflowValidator date_days_overflow_validator_
Definition: Encoder.h:293
int64_t get_epoch_days_from_seconds(const int64_t seconds)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T, typename V>
void DateDaysEncoder< T, V >::getMetadata ( const std::shared_ptr< ChunkMetadata > &  chunkMetadata)
inlineoverridevirtual

Reimplemented from Encoder.

Definition at line 81 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, Encoder::getMetadata(), and DateDaysEncoder< T, V >::has_nulls.

Referenced by DateDaysEncoder< T, V >::appendEncodedOrUnencodedData().

81  {
82  Encoder::getMetadata(chunkMetadata);
83  chunkMetadata->fillChunkStats(dataMin, dataMax, has_nulls);
84  }
virtual void getMetadata(const std::shared_ptr< ChunkMetadata > &chunkMetadata)
Definition: Encoder.cpp:231

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T, typename V>
std::shared_ptr<ChunkMetadata> DateDaysEncoder< T, V >::getMetadata ( const SQLTypeInfo ti)
inlineoverridevirtual

Implements Encoder.

Definition at line 87 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, and DateDaysEncoder< T, V >::has_nulls.

87  {
88  auto chunk_metadata = std::make_shared<ChunkMetadata>(ti, 0, 0, ChunkStats{});
89  chunk_metadata->fillChunkStats(dataMin, dataMax, has_nulls);
90  return chunk_metadata;
91  }
template<typename T, typename V>
size_t DateDaysEncoder< T, V >::getNumElemsForBytesEncodedDataAtIndices ( const int8_t *  index_data,
const std::vector< size_t > &  selected_idx,
const size_t  byte_limit 
)
inlineoverridevirtual

Compute the maximum number of variable length encoded elements given a byte limit

Parameters
index_data- (optional) index data for the encoded type
selected_idx- which indices in the encoded data to consider
byte_limit- byte limit that must be respected
Returns
the number of elements

NOTE: optional parameters above may be ignored by the implementation, but may or may not be required depending on the encoder type backing the implementation.

Implements Encoder.

Definition at line 37 of file DateDaysEncoder.h.

References UNREACHABLE.

39  {
40  UNREACHABLE()
41  << "getNumElemsForBytesEncodedDataAtIndices unexpectedly called for non varlen"
42  " encoder";
43  return {};
44  }
#define UNREACHABLE()
Definition: Logger.h:338
template<typename T, typename V>
void DateDaysEncoder< T, V >::readMetadata ( FILE *  f)
inlineoverridevirtual

Implements Encoder.

Definition at line 160 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, DateDaysEncoder< T, V >::has_nulls, Encoder::num_elems_, and heavydb.dtypes::T.

160  {
161  // assumes pointer is already in right place
162  fread((int8_t*)&num_elems_, sizeof(size_t), 1, f);
163  fread((int8_t*)&dataMin, 1, sizeof(T), f);
164  fread((int8_t*)&dataMax, 1, sizeof(T), f);
165  fread((int8_t*)&has_nulls, 1, sizeof(bool), f);
166  }
size_t num_elems_
Definition: Encoder.h:288
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
template<typename T, typename V>
void DateDaysEncoder< T, V >::reduceStats ( const Encoder that)
inlineoverridevirtual

Implements Encoder.

Definition at line 135 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, and DateDaysEncoder< T, V >::has_nulls.

135  {
136  const auto that_typed = static_cast<const DateDaysEncoder<T, V>&>(that);
137  if (that_typed.has_nulls) {
138  has_nulls = true;
139  }
140  dataMin = std::min(dataMin, that_typed.dataMin);
141  dataMax = std::max(dataMax, that_typed.dataMax);
142  }
template<typename T, typename V>
bool DateDaysEncoder< T, V >::resetChunkStats ( const ChunkStats )
inlineoverridevirtual

: Reset chunk level stats (min, max, nulls) using new values from the argument.

Returns
: True if an update occurred and the chunk needs to be flushed. False otherwise. Default false if metadata update is unsupported. Only reset chunk stats if the incoming stats differ from the current stats.

Reimplemented from Encoder.

Definition at line 168 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, ChunkStats::has_nulls, DateDaysEncoder< T, V >::has_nulls, ChunkStats::max, and ChunkStats::min.

168  {
169  const auto new_min = DatumFetcher::getDatumVal<T>(stats.min);
170  const auto new_max = DatumFetcher::getDatumVal<T>(stats.max);
171 
172  if (dataMin == new_min && dataMax == new_max && has_nulls == stats.has_nulls) {
173  return false;
174  }
175 
176  dataMin = new_min;
177  dataMax = new_max;
178  has_nulls = stats.has_nulls;
179  return true;
180  }
dictionary stats
Definition: report.py:116
template<typename T, typename V>
void DateDaysEncoder< T, V >::resetChunkStats ( )
inlineoverridevirtual

Resets chunk metadata stats to their default values.

Implements Encoder.

Definition at line 182 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, and DateDaysEncoder< T, V >::has_nulls.

Referenced by DateDaysEncoder< T, V >::appendEncodedOrUnencodedData(), and DateDaysEncoder< T, V >::DateDaysEncoder().

182  {
183  dataMin = std::numeric_limits<T>::max();
184  dataMax = std::numeric_limits<T>::lowest();
185  has_nulls = false;
186  }

+ Here is the caller graph for this function:

template<typename T, typename V>
void DateDaysEncoder< T, V >::updateStats ( const int64_t  val,
const bool  is_null 
)
inlineoverridevirtual

Implements Encoder.

Definition at line 94 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, DateDaysEncoder< T, V >::has_nulls, and heavydb.dtypes::T.

94  {
95  if (is_null) {
96  has_nulls = true;
97  } else {
98  const auto data = static_cast<T>(val);
99  dataMin = std::min(dataMin, data);
100  dataMax = std::max(dataMax, data);
101  }
102  }
CONSTEXPR DEVICE bool is_null(const T &value)
template<typename T, typename V>
void DateDaysEncoder< T, V >::updateStats ( const double  val,
const bool  is_null 
)
inlineoverridevirtual

Implements Encoder.

Definition at line 105 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, DateDaysEncoder< T, V >::has_nulls, and heavydb.dtypes::T.

105  {
106  if (is_null) {
107  has_nulls = true;
108  } else {
109  const auto data = static_cast<T>(val);
110  dataMin = std::min(dataMin, data);
111  dataMax = std::max(dataMax, data);
112  }
113  }
CONSTEXPR DEVICE bool is_null(const T &value)
template<typename T, typename V>
void DateDaysEncoder< T, V >::updateStats ( const int8_t *const  src_data,
const size_t  num_elements 
)
inlineoverridevirtual

Update statistics for data without appending.

Parameters
src_data- the data with which to update statistics
num_elements- the number of elements to scan in the data

Implements Encoder.

Definition at line 115 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::encodeDataAndUpdateStats(), and heavydb.dtypes::T.

115  {
116  const T* unencoded_data = reinterpret_cast<const T*>(src_data);
117  for (size_t i = 0; i < num_elements; ++i) {
118  encodeDataAndUpdateStats(unencoded_data[i]);
119  }
120  }
V encodeDataAndUpdateStats(const T &unencoded_data)

+ Here is the call graph for this function:

template<typename T, typename V>
void DateDaysEncoder< T, V >::updateStats ( const std::vector< std::string > *const  src_data,
const size_t  start_idx,
const size_t  num_elements 
)
inlineoverridevirtual

Update statistics for string data without appending.

Parameters
src_data- the string data with which to update statistics
start_idx- the offset into src_data to start the update
num_elements- the number of elements to scan in the string data

Implements Encoder.

Definition at line 122 of file DateDaysEncoder.h.

References UNREACHABLE.

124  {
125  UNREACHABLE();
126  }
#define UNREACHABLE()
Definition: Logger.h:338
template<typename T, typename V>
void DateDaysEncoder< T, V >::updateStats ( const std::vector< ArrayDatum > *const  src_data,
const size_t  start_idx,
const size_t  num_elements 
)
inlineoverridevirtual

Update statistics for array data without appending.

Parameters
src_data- the array data with which to update statistics
start_idx- the offset into src_data to start the update
num_elements- the number of elements to scan in the array data

Implements Encoder.

Definition at line 128 of file DateDaysEncoder.h.

References UNREACHABLE.

130  {
131  UNREACHABLE();
132  }
#define UNREACHABLE()
Definition: Logger.h:338
template<typename T, typename V>
void DateDaysEncoder< T, V >::updateStatsWithAlreadyEncoded ( const V &  encoded_data)
inlineprivate

Definition at line 245 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, DateConverters::get_epoch_seconds_from_days(), DateDaysEncoder< T, V >::has_nulls, and heavydb.dtypes::T.

Referenced by DateDaysEncoder< T, V >::appendEncodedOrUnencodedData().

245  {
246  if (encoded_data == std::numeric_limits<V>::min()) {
247  has_nulls = true;
248  } else {
249  const T data = DateConverters::get_epoch_seconds_from_days(encoded_data);
250  dataMax = std::max(dataMax, data);
251  dataMin = std::min(dataMin, data);
252  }
253  }
int64_t get_epoch_seconds_from_days(const int64_t days)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T, typename V>
void DateDaysEncoder< T, V >::writeMetadata ( FILE *  f)
inlineoverridevirtual

Implements Encoder.

Definition at line 152 of file DateDaysEncoder.h.

References DateDaysEncoder< T, V >::dataMax, DateDaysEncoder< T, V >::dataMin, DateDaysEncoder< T, V >::has_nulls, Encoder::num_elems_, and heavydb.dtypes::T.

152  {
153  // assumes pointer is already in right place
154  fwrite((int8_t*)&num_elems_, sizeof(size_t), 1, f);
155  fwrite((int8_t*)&dataMin, sizeof(T), 1, f);
156  fwrite((int8_t*)&dataMax, sizeof(T), 1, f);
157  fwrite((int8_t*)&has_nulls, sizeof(bool), 1, f);
158  }
size_t num_elems_
Definition: Encoder.h:288
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)

Member Data Documentation


The documentation for this class was generated from the following file: