OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Datum.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
23 #include <algorithm>
24 #include <cassert>
25 #include <cctype>
26 #include <charconv>
27 #include <cmath>
28 #include <cstdio>
29 #include <cstdlib>
30 #include <limits>
31 #include <stdexcept>
32 #include <string>
33 
34 #include "DateConverters.h"
35 #include "DateTimeParser.h"
36 #include "Logger/Logger.h"
38 #include "StringTransform.h"
39 #include "misc.h"
40 #include "sqltypes.h"
41 
42 std::string SQLTypeInfo::type_name[kSQLTYPE_LAST] = {"NULL",
43  "BOOLEAN",
44  "CHAR",
45  "VARCHAR",
46  "NUMERIC",
47  "DECIMAL",
48  "INTEGER",
49  "SMALLINT",
50  "FLOAT",
51  "DOUBLE",
52  "TIME",
53  "TIMESTAMP",
54  "BIGINT",
55  "TEXT",
56  "DATE",
57  "ARRAY",
58  "INTERVAL_DAY_TIME",
59  "INTERVAL_YEAR_MONTH",
60  "POINT",
61  "LINESTRING",
62  "POLYGON",
63  "MULTIPOLYGON",
64  "TINYINT",
65  "GEOMETRY",
66  "GEOGRAPHY",
67  "EVAL_CONTEXT_TYPE",
68  "VOID",
69  "CURSOR",
70  "COLUMN",
71  "COLUMN_LIST",
72  "MULTILINESTRING",
73  "MULTIPOINT"};
75  {"NONE", "FIXED", "RL", "DIFF", "DICT", "SPARSE", "COMPRESSED", "DAYS"};
76 
77 namespace {
78 // Return decimal_value * 10^dscale
79 int64_t convert_decimal_value_to_scale_internal(const int64_t decimal_value,
80  int const dscale) {
81  constexpr int max_scale = sql_constants::kMaxRepresentableNumericPrecision; // 19
82  constexpr auto pow10 = shared::powersOf<uint64_t, max_scale + 1>(10);
83  if (dscale < 0) {
84  if (dscale < -max_scale) {
85  return 0; // +/- 0.09223372036854775807 rounds to 0
86  }
87  uint64_t const u = std::abs(decimal_value);
88  uint64_t const pow = pow10[-dscale];
89  uint64_t div = u / pow;
90  uint64_t rem = u % pow;
91  div += pow / 2 <= rem;
92  return decimal_value < 0 ? -div : div;
93  } else if (dscale < max_scale) {
94  int64_t retval;
95 #ifdef _WIN32
96  return decimal_value * pow10[dscale];
97 #else
98  if (!__builtin_mul_overflow(decimal_value, pow10[dscale], &retval)) {
99  return retval;
100  }
101 #endif
102  }
103  if (decimal_value == 0) {
104  return 0;
105  }
106  throw std::runtime_error("Overflow in DECIMAL-to-DECIMAL conversion.");
107 }
108 } // namespace
109 
110 int64_t parse_numeric(const std::string_view s, SQLTypeInfo& ti) {
111  // if we are given a dimension, first parse to the maximum precision of the string
112  // and then convert to the correct size
113  if (ti.get_dimension() != 0) {
114  SQLTypeInfo ti_string(kNUMERIC, 0, 0, false);
115  return convert_decimal_value_to_scale(parse_numeric(s, ti_string), ti_string, ti);
116  }
117  size_t dot = s.find_first_of('.', 0);
118  std::string before_dot;
119  std::string after_dot;
120  if (dot != std::string::npos) {
121  // make .99 as 0.99, or std::stoll below throws exception 'std::invalid_argument'
122  before_dot = (0 == dot) ? "0" : s.substr(0, dot);
123  after_dot = s.substr(dot + 1);
124  } else {
125  before_dot = s;
126  after_dot = "0";
127  }
128  const bool is_negative = before_dot.find_first_of('-', 0) != std::string::npos;
129  const int64_t sign = is_negative ? -1 : 1;
130  int64_t result;
131  result = std::abs(std::stoll(before_dot));
132  int64_t fraction = 0;
133  const size_t before_dot_digits = before_dot.length() - (is_negative ? 1 : 0);
134 
135  constexpr int max_digits = std::numeric_limits<int64_t>::digits10;
136  if (!after_dot.empty()) {
137  int64_t next_digit = 0;
138  // After dot will be used to scale integer part so make sure it wont overflow
139  if (after_dot.size() + before_dot_digits > max_digits) {
140  if (before_dot_digits >= max_digits) {
141  after_dot = "0";
142  } else {
143  next_digit = std::stoll(after_dot.substr(max_digits - before_dot_digits, 1));
144  after_dot = after_dot.substr(0, max_digits - before_dot_digits);
145  }
146  }
147  fraction = std::stoll(after_dot);
148  fraction += next_digit >= 5 ? 1 : 0;
149  }
150 
151  // set the type info based on the literal string
152  ti.set_scale(static_cast<int>(after_dot.length()));
153  ti.set_dimension(static_cast<int>(before_dot_digits + ti.get_scale()));
154  ti.set_notnull(false);
155  if (ti.get_scale()) {
156  result = convert_decimal_value_to_scale_internal(result, ti.get_scale());
157  }
158  result += fraction;
159 
160  return result * sign;
161 }
162 
163 namespace {
164 
165 // Equal to NULL value for nullable types.
166 template <typename T>
167 T minValue(unsigned const fieldsize) {
168  static_assert(std::is_signed_v<T>);
169  return T(-1) << (fieldsize - 1);
170 }
171 
172 template <typename T>
173 T maxValue(unsigned const fieldsize) {
174  return ~minValue<T>(fieldsize);
175 }
176 
177 std::string toString(SQLTypeInfo const& ti, unsigned const fieldsize) {
178  return ti.get_type_name() + '(' + std::to_string(fieldsize) + ')';
179 }
180 
181 // GCC 10 does not support std::from_chars w/ double, so strtold() is used instead.
182 // Convert s to long double then round to integer type T.
183 // It's not assumed that long double is any particular size; it is to be nice to
184 // users who use floating point values where integers are expected. Some platforms
185 // may be more accommodating with larger long doubles than others.
186 template <typename T, typename U = long double>
187 T parseFloatAsInteger(std::string_view s, SQLTypeInfo const& ti) {
188  // Use stack memory if s is small enough before resorting to dynamic memory.
189  constexpr size_t bufsize = 64;
190  char c_str[bufsize];
191  std::string str;
192  char const* str_begin;
193  char* str_end;
194  if (s.size() < bufsize) {
195  s.copy(c_str, s.size());
196  c_str[s.size()] = '\0';
197  str_begin = c_str;
198  } else {
199  str = s;
200  str_begin = str.c_str();
201  }
202  U value = strtold(str_begin, &str_end);
203  if (str_begin == str_end) {
204  throw std::runtime_error("Unable to parse " + std::string(s) + " to " +
205  ti.get_type_name());
206  } else if (str_begin + s.size() != str_end) {
207  throw std::runtime_error(std::string("Unexpected character \"") + *str_end +
208  "\" encountered in " + ti.get_type_name() + " value " +
209  std::string(s));
210  }
211  value = std::round(value);
212  if (!std::isfinite(value)) {
213  throw std::runtime_error("Invalid conversion from \"" + std::string(s) + "\" to " +
214  ti.get_type_name());
215  } else if (value < static_cast<U>(std::numeric_limits<T>::min()) ||
216  static_cast<U>(std::numeric_limits<T>::max()) < value) {
217  throw std::runtime_error("Integer " + std::string(s) + " is out of range for " +
218  ti.get_type_name());
219  }
220  return static_cast<T>(value);
221 }
222 
223 // String ends in either "." or ".0".
224 inline bool hasCommonSuffix(char const* const ptr, char const* const end) {
225  return *ptr == '.' && (ptr + 1 == end || (ptr[1] == '0' && ptr + 2 == end));
226 }
227 
228 template <typename T>
229 T parseInteger(std::string_view s, SQLTypeInfo const& ti) {
230  T retval{0};
231  char const* const end = s.data() + s.size();
232  auto [ptr, error_code] = std::from_chars(s.data(), end, retval);
233  if (ptr != end) {
234  if (error_code != std::errc() || !hasCommonSuffix(ptr, end)) {
235  retval = parseFloatAsInteger<T>(s, ti);
236  }
237  } else if (error_code != std::errc()) {
238  if (error_code == std::errc::result_out_of_range) {
239  throw std::runtime_error("Integer " + std::string(s) + " is out of range for " +
240  ti.get_type_name());
241  }
242  throw std::runtime_error("Invalid conversion from \"" + std::string(s) + "\" to " +
243  ti.get_type_name());
244  }
245  // Bounds checking based on SQLTypeInfo.
246  unsigned const fieldsize =
247  ti.get_compression() == kENCODING_FIXED ? ti.get_comp_param() : 8 * sizeof(T);
248  if (fieldsize < 8 * sizeof(T)) {
249  if (maxValue<T>(fieldsize) < retval) {
250  throw std::runtime_error("Integer " + std::string(s) +
251  " exceeds maximum value for " + toString(ti, fieldsize));
252  } else if (ti.get_notnull()) {
253  if (retval < minValue<T>(fieldsize)) {
254  throw std::runtime_error("Integer " + std::string(s) +
255  " exceeds minimum value for " + toString(ti, fieldsize));
256  }
257  } else {
258  if (retval <= minValue<T>(fieldsize)) {
259  throw std::runtime_error("Integer " + std::string(s) +
260  " exceeds minimum value for nullable " +
261  toString(ti, fieldsize));
262  }
263  }
264  } else if (!ti.get_notnull() && retval == std::numeric_limits<T>::min()) {
265  throw std::runtime_error("Integer " + std::string(s) +
266  " exceeds minimum value for nullable " +
267  toString(ti, fieldsize));
268  }
269  return retval;
270 }
271 
272 } // namespace
273 
274 /*
275  * @brief convert string to a datum
276  */
277 Datum StringToDatum(std::string_view s, SQLTypeInfo& ti) {
278  Datum d;
279  try {
280  switch (ti.get_type()) {
281  case kARRAY:
282  case kCOLUMN:
283  case kCOLUMN_LIST:
284  break;
285  case kBOOLEAN:
286  if (s == "t" || s == "T" || s == "1" || to_upper(std::string(s)) == "TRUE") {
287  d.boolval = true;
288  } else if (s == "f" || s == "F" || s == "0" ||
289  to_upper(std::string(s)) == "FALSE") {
290  d.boolval = false;
291  } else {
292  throw std::runtime_error("Invalid string for boolean " + std::string(s));
293  }
294  break;
295  case kNUMERIC:
296  case kDECIMAL:
297  d.bigintval = parse_numeric(s, ti);
298  break;
299  case kBIGINT:
300  d.bigintval = parseInteger<int64_t>(s, ti);
301  break;
302  case kINT:
303  d.intval = parseInteger<int32_t>(s, ti);
304  break;
305  case kSMALLINT:
306  d.smallintval = parseInteger<int16_t>(s, ti);
307  break;
308  case kTINYINT:
309  d.tinyintval = parseInteger<int8_t>(s, ti);
310  break;
311  case kFLOAT:
312  d.floatval = std::stof(std::string(s));
313  break;
314  case kDOUBLE:
315  d.doubleval = std::stod(std::string(s));
316  break;
317  case kTIME:
318  d.bigintval = dateTimeParse<kTIME>(s, ti.get_dimension());
319  break;
320  case kTIMESTAMP:
321  d.bigintval = dateTimeParse<kTIMESTAMP>(s, ti.get_dimension());
322  break;
323  case kDATE:
324  d.bigintval = dateTimeParse<kDATE>(s, ti.get_dimension());
325  break;
326  case kPOINT:
327  case kMULTIPOINT:
328  case kLINESTRING:
329  case kMULTILINESTRING:
330  case kPOLYGON:
331  case kMULTIPOLYGON:
332  throw std::runtime_error("Internal error: geometry type in StringToDatum.");
333  default:
334  throw std::runtime_error("Internal error: invalid type in StringToDatum: " +
335  ti.get_type_name());
336  }
337  } catch (const std::invalid_argument&) {
338  throw std::runtime_error("Invalid conversion from string to " + ti.get_type_name());
339  } catch (const std::out_of_range&) {
340  throw std::runtime_error("Got out of range error during conversion from string to " +
341  ti.get_type_name());
342  }
343  return d;
344 }
345 
346 bool DatumEqual(const Datum a, const Datum b, const SQLTypeInfo& ti) {
347  switch (ti.get_type()) {
348  case kBOOLEAN:
349  return a.boolval == b.boolval;
350  case kBIGINT:
351  case kNUMERIC:
352  case kDECIMAL:
353  return a.bigintval == b.bigintval;
354  case kINT:
355  return a.intval == b.intval;
356  case kSMALLINT:
357  return a.smallintval == b.smallintval;
358  case kTINYINT:
359  return a.tinyintval == b.tinyintval;
360  case kFLOAT:
361  return a.floatval == b.floatval;
362  case kDOUBLE:
363  return a.doubleval == b.doubleval;
364  case kTIME:
365  case kTIMESTAMP:
366  case kDATE:
367  case kINTERVAL_DAY_TIME:
369  return a.bigintval == b.bigintval;
370  case kTEXT:
371  case kVARCHAR:
372  case kCHAR:
373  case kPOINT:
374  case kMULTIPOINT:
375  case kLINESTRING:
376  case kMULTILINESTRING:
377  case kPOLYGON:
378  case kMULTIPOLYGON:
379  if (ti.get_compression() == kENCODING_DICT) {
380  return a.intval == b.intval;
381  }
382  if (a.stringval == nullptr && b.stringval == nullptr) {
383  return true;
384  }
385  if (a.stringval == nullptr || b.stringval == nullptr) {
386  return false;
387  }
388  return *a.stringval == *b.stringval;
389  default:
390  return false;
391  }
392  return false;
393 }
394 
395 /*
396  * @brief convert datum to string
397  */
398 std::string DatumToString(Datum d, const SQLTypeInfo& ti) {
399  constexpr size_t buf_size = 64;
400  char buf[buf_size]; // Hold "2000-03-01 12:34:56.123456789" and large years.
401  switch (ti.get_type()) {
402  case kBOOLEAN:
403  if (d.boolval) {
404  return "t";
405  }
406  return "f";
407  case kNUMERIC:
408  case kDECIMAL: {
409  double v = (double)d.bigintval / pow(10, ti.get_scale());
410  int size = snprintf(buf, buf_size, "%*.*f", ti.get_dimension(), ti.get_scale(), v);
411  CHECK_LE(0, size) << v << ' ' << ti.to_string();
412  CHECK_LT(size_t(size), buf_size) << v << ' ' << ti.to_string();
413  return buf;
414  }
415  case kINT:
416  return std::to_string(d.intval);
417  case kSMALLINT:
418  return std::to_string(d.smallintval);
419  case kTINYINT:
420  return std::to_string(d.tinyintval);
421  case kBIGINT:
422  return std::to_string(d.bigintval);
423  case kFLOAT:
424  return std::to_string(d.floatval);
425  case kDOUBLE:
426  return std::to_string(d.doubleval);
427  case kTIME: {
428  size_t const len = shared::formatHMS(buf, buf_size, d.bigintval);
429  CHECK_EQ(8u, len); // 8 == strlen("HH:MM:SS")
430  return buf;
431  }
432  case kTIMESTAMP: {
433  unsigned const dim = ti.get_dimension(); // assumes dim <= 9
434  size_t const len = shared::formatDateTime(buf, buf_size, d.bigintval, dim);
435  CHECK_LE(19u + bool(dim) + dim, len); // 19 = strlen("YYYY-MM-DD HH:MM:SS")
436  return buf;
437  }
438  case kDATE: {
439  size_t const len = shared::formatDate(buf, buf_size, d.bigintval);
440  CHECK_LE(10u, len); // 10 == strlen("YYYY-MM-DD")
441  return buf;
442  }
443  case kINTERVAL_DAY_TIME:
444  return std::to_string(d.bigintval) + " ms (day-time interval)";
446  return std::to_string(d.bigintval) + " month(s) (year-month interval)";
447  case kTEXT:
448  case kVARCHAR:
449  case kCHAR:
450  if (d.stringval == nullptr) {
451  return "NULL";
452  }
453  return *d.stringval;
454  default:
455  throw std::runtime_error("Internal error: invalid type " + ti.get_type_name() +
456  " in DatumToString.");
457  }
458  return "";
459 }
460 
461 int64_t extract_int_type_from_datum(const Datum datum, const SQLTypeInfo& ti) {
462  const auto type = ti.is_decimal() ? decimal_to_int_type(ti) : ti.get_type();
463  switch (type) {
464  case kBOOLEAN:
465  return datum.tinyintval;
466  case kTINYINT:
467  return datum.tinyintval;
468  case kSMALLINT:
469  return datum.smallintval;
470  case kCHAR:
471  case kVARCHAR:
472  case kTEXT:
474  case kINT:
475  return datum.intval;
476  case kBIGINT:
477  return datum.bigintval;
478  case kTIME:
479  case kTIMESTAMP:
480  case kDATE:
481  return datum.bigintval;
482  default:
483  abort();
484  }
485 }
486 
487 double extract_fp_type_from_datum(const Datum datum, const SQLTypeInfo& ti) {
488  const auto type = ti.get_type();
489  switch (type) {
490  case kFLOAT:
491  return datum.floatval;
492  case kDOUBLE:
493  return datum.doubleval;
494  default:
495  abort();
496  }
497 }
498 
500  return get_int_type_by_size(ti.get_size());
501 }
502 
505  switch (ti.get_size()) {
506  case 1:
507  return kTINYINT;
508  case 2:
509  return kSMALLINT;
510  case 4:
511  return kINT;
512  default:
513  UNREACHABLE() << "Unexpected string dictionary encoding size: " << ti.get_size();
514  }
515  return kNULLT;
516 }
517 
518 int8_t* append_datum(int8_t* buf, const Datum& d, const SQLTypeInfo& ti) {
519  SQLTypes type;
520  if (ti.is_dict_encoded_string()) {
521  type = string_dict_to_int_type(ti);
522  } else {
523  type = ti.get_type();
524  }
525  switch (type) {
526  case kBOOLEAN:
527  *(int8_t*)buf = d.boolval;
528  return buf + sizeof(int8_t);
529  case kNUMERIC:
530  case kDECIMAL:
531  case kBIGINT:
532  *(int64_t*)buf = d.bigintval;
533  return buf + sizeof(int64_t);
534  case kINT:
535  *(int32_t*)buf = d.intval;
536  return buf + sizeof(int32_t);
537  case kSMALLINT:
538  *(int16_t*)buf = d.smallintval;
539  return buf + sizeof(int16_t);
540  case kTINYINT:
541  *(int8_t*)buf = d.tinyintval;
542  return buf + sizeof(int8_t);
543  case kFLOAT:
544  *(float*)buf = d.floatval;
545  return buf + sizeof(float);
546  case kDOUBLE:
547  *(double*)buf = d.doubleval;
548  return buf + sizeof(double);
549  case kTIME:
550  case kTIMESTAMP:
551  case kDATE:
552  *reinterpret_cast<int64_t*>(buf) = d.bigintval;
553  return buf + sizeof(int64_t);
554  default:
555  UNREACHABLE() << "Unexpected type: " << type;
556  return nullptr;
557  }
558 }
559 
560 // Return decimal_value * 10^dscale
561 // where dscale = new_type_info.get_scale() - type_info.get_scale()
562 int64_t convert_decimal_value_to_scale(const int64_t decimal_value,
563  const SQLTypeInfo& type_info,
564  const SQLTypeInfo& new_type_info) {
565  int const dscale = new_type_info.get_scale() - type_info.get_scale();
566  return convert_decimal_value_to_scale_internal(decimal_value, dscale);
567 }
int8_t tinyintval
Definition: sqltypes.h:232
static constexpr int32_t kMaxRepresentableNumericPrecision
Definition: sqltypes.h:47
#define CHECK_EQ(x, y)
Definition: Logger.h:230
HOST DEVICE int get_size() const
Definition: sqltypes.h:414
int8_t * append_datum(int8_t *buf, const Datum &d, const SQLTypeInfo &ti)
Definition: Datum.cpp:518
std::string DatumToString(Datum d, const SQLTypeInfo &ti)
Definition: Datum.cpp:398
Definition: sqltypes.h:63
T parseInteger(std::string_view s, SQLTypeInfo const &ti)
Definition: Datum.cpp:229
T maxValue(unsigned const fieldsize)
Definition: Datum.cpp:173
SQLTypes
Definition: sqltypes.h:52
int64_t parse_numeric(const std::string_view s, SQLTypeInfo &ti)
Definition: Datum.cpp:110
HOST DEVICE int get_scale() const
Definition: sqltypes.h:409
int8_t boolval
Definition: sqltypes.h:231
#define UNREACHABLE()
Definition: Logger.h:266
Constants for Builtin SQL Types supported by HEAVY.AI.
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:404
int32_t intval
Definition: sqltypes.h:234
std::string to_string(char const *&&v)
size_t formatHMS(char *buf, size_t const max, int64_t const unixtime)
Definition: misc.cpp:96
constexpr double a
Definition: Utm.h:32
float floatval
Definition: sqltypes.h:236
std::string to_string() const
Definition: sqltypes.h:568
T minValue(unsigned const fieldsize)
Definition: Datum.cpp:167
bool DatumEqual(const Datum a, const Datum b, const SQLTypeInfo &ti)
Definition: Datum.cpp:346
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:1034
int64_t extract_int_type_from_datum(const Datum datum, const SQLTypeInfo &ti)
Definition: Datum.cpp:461
void set_scale(int s)
Definition: sqltypes.h:519
int64_t bigintval
Definition: sqltypes.h:235
int16_t smallintval
Definition: sqltypes.h:233
Datum StringToDatum(std::string_view s, SQLTypeInfo &ti)
Definition: Datum.cpp:277
std::string * stringval
Definition: sqltypes.h:240
std::string to_upper(const std::string &str)
SQLTypes decimal_to_int_type(const SQLTypeInfo &ti)
Definition: Datum.cpp:499
size_t formatDate(char *buf, size_t const max, int64_t const unixtime)
Definition: misc.cpp:27
#define CHECK_LT(x, y)
Definition: Logger.h:232
Definition: sqltypes.h:66
Definition: sqltypes.h:67
static std::string comp_name[kENCODING_LAST]
Definition: sqltypes.h:1035
#define CHECK_LE(x, y)
Definition: Logger.h:233
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:412
int64_t convert_decimal_value_to_scale(const int64_t decimal_value, const SQLTypeInfo &type_info, const SQLTypeInfo &new_type_info)
Definition: Datum.cpp:562
void set_dimension(int d)
Definition: sqltypes.h:516
SQLTypes get_int_type_by_size(size_t const nbytes)
Definition: sqltypes.h:1203
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:406
std::string get_type_name() const
Definition: sqltypes.h:528
size_t formatDateTime(char *buf, size_t const max, int64_t const timestamp, int const dimension, bool use_iso_format)
Definition: misc.cpp:45
Definition: sqltypes.h:55
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:413
void set_notnull(bool n)
Definition: sqltypes.h:521
#define CHECK(condition)
Definition: Logger.h:222
int64_t convert_decimal_value_to_scale_internal(const int64_t decimal_value, int const dscale)
Definition: Datum.cpp:79
double extract_fp_type_from_datum(const Datum datum, const SQLTypeInfo &ti)
Definition: Datum.cpp:487
bool is_dict_encoded_string() const
Definition: sqltypes.h:652
Definition: sqltypes.h:59
bool hasCommonSuffix(char const *const ptr, char const *const end)
Definition: Datum.cpp:224
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:411
bool is_decimal() const
Definition: sqltypes.h:603
T parseFloatAsInteger(std::string_view s, SQLTypeInfo const &ti)
Definition: Datum.cpp:187
double doubleval
Definition: sqltypes.h:237
SQLTypes string_dict_to_int_type(const SQLTypeInfo &ti)
Definition: Datum.cpp:503