OmniSciDB  04ee39c94c
anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string > Struct Template Reference

#include <ArrowImporter.h>

+ Inheritance diagram for anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >:
+ Collaboration diagram for anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >:

Public Types

using VALUE_TYPE = std::string
 

Public Member Functions

 ArrowValue (const DataBufferBase &data, const VALUE_TYPE &v)
 
 operator const bool () const
 
template<typename DATA_TYPE , typename = enable_if_integral_not_bool<DATA_TYPE>>
 operator const DATA_TYPE () const
 
template<typename DATA_TYPE , typename = enable_if_floating<DATA_TYPE>>
 operator DATA_TYPE () const
 
 operator const std::string () const
 
- Public Member Functions inherited from anonymous_namespace{ArrowImporter.h}::ArrowValueBase< std::string >
 ArrowValueBase (const DataBufferBase &data, const std::string &v)
 
int64_t resolve_time (const std::string &v, std::enable_if_t< enabled > *=0) const
 
int64_t resolve_time (const std::string &v, std::enable_if_t<!enabled > *=0) const
 

Additional Inherited Members

- Public Attributes inherited from anonymous_namespace{ArrowImporter.h}::ArrowValueBase< std::string >
const DataBufferBasedata
 
const std::string v
 
const int32_t dimension
 

Detailed Description

template<>
struct anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >

Definition at line 409 of file ArrowImporter.h.

Member Typedef Documentation

◆ VALUE_TYPE

using anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::VALUE_TYPE = std::string

Definition at line 410 of file ArrowImporter.h.

Constructor & Destructor Documentation

◆ ArrowValue()

anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::ArrowValue ( const DataBufferBase data,
const VALUE_TYPE v 
)
inline

Definition at line 411 of file ArrowImporter.h.

Member Function Documentation

◆ operator const bool()

anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::operator const bool ( ) const
inlineexplicit

Definition at line 413 of file ArrowImporter.h.

References anonymous_namespace{ArrowImporter.h}::data_conversion_error(), kBOOLEAN, StringToDatum(), and v().

413  {
414  if (v.size() == 0) {
415  return inline_int_null_value<int8_t>();
416  }
417  try {
418  SQLTypeInfo ti(kBOOLEAN);
419  auto datum = StringToDatum(v, ti);
420  return datum.boolval;
421  } catch (...) {
423  return false;
424  }
425  }
void data_conversion_error(const VALUE_TYPE v, const ColumnDescriptor *cd, Importer_NS::BadRowsTracker *const bad_rows_tracker)
Importer_NS::BadRowsTracker *const bad_rows_tracker
Datum StringToDatum(const std::string &s, SQLTypeInfo &ti)
Definition: Datum.cpp:90
+ Here is the call graph for this function:

◆ operator const DATA_TYPE()

template<typename DATA_TYPE , typename = enable_if_integral_not_bool<DATA_TYPE>>
anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::operator const DATA_TYPE ( ) const
inlineexplicit

Definition at line 427 of file ArrowImporter.h.

References anonymous_namespace{ArrowImporter.h}::data_conversion_error(), inline_fixed_encoding_null_val(), StringToDatum(), and v().

427  {
428  if (v.size() == 0) {
430  }
431  try {
432  auto ti = data.cd->columnType;
433  auto datum = StringToDatum(v, ti);
434  return datum.bigintval;
435  } catch (...) {
437  return 0;
438  }
439  }
void data_conversion_error(const VALUE_TYPE v, const ColumnDescriptor *cd, Importer_NS::BadRowsTracker *const bad_rows_tracker)
Importer_NS::BadRowsTracker *const bad_rows_tracker
Datum StringToDatum(const std::string &s, SQLTypeInfo &ti)
Definition: Datum.cpp:90
int64_t inline_fixed_encoding_null_val(const SQL_TYPE_INFO &ti)
SQLTypeInfo columnType
+ Here is the call graph for this function:

◆ operator const std::string()

anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::operator const std::string ( ) const
inlineexplicit

Definition at line 444 of file ArrowImporter.h.

References v().

+ Here is the call graph for this function:

◆ operator DATA_TYPE()

template<typename DATA_TYPE , typename = enable_if_floating<DATA_TYPE>>
anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::operator DATA_TYPE ( ) const
inlineexplicit

Definition at line 441 of file ArrowImporter.h.

References v().

441  {
442  return atof(v.data());
443  }
+ Here is the call graph for this function:

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