17 #ifndef TARGET_VALUE_CONVERTERS_H_
18 #define TARGET_VALUE_CONVERTERS_H_
20 #include "../Catalog/Catalog.h"
21 #include "../QueryEngine/TargetMetaInfo.h"
22 #include "../QueryEngine/TargetValue.h"
23 #include "../Shared/sqldefs.h"
24 #include "../Shared/sqltypes.h"
26 template <
typename RETURN_TYPE>
29 const RETURN_TYPE*
operator()(RETURN_TYPE
const& operand)
const {
return &operand; }
31 const RETURN_TYPE*
operator()(
void* operand)
const {
return nullptr; }
35 throw std::runtime_error(
"Unexpected data type");
39 template <
typename RETURN_TYPE,
typename SOURCE_TYPE>
41 const SOURCE_TYPE* boost_variant,
43 return boost::apply_visitor(accessor, *boost_variant);
46 template <
typename TARGET_TYPE>
void operator()(TARGET_TYPE *p)
TargetValueConverter(const ColumnDescriptor *cd)
const ColumnDescriptor * column_descriptor_
virtual void convertToColumnarFormat(size_t row, const TargetValue *value)=0
boost_variant_accessor< ScalarTargetValue > SCALAR_TARGET_VALUE_ACCESSOR
const RETURN_TYPE * operator()(void *operand) const
boost_variant_accessor< NullableString > NULLABLE_STRING_ACCESSOR
virtual void finalizeDataBlocksForInsertData()
virtual void allocateColumnarData(size_t num_rows)=0
virtual void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData &insertData)=0
boost_variant_accessor< std::string > STRING_ACCESSOR
virtual ~TargetValueConverter()
specifies the content in-memory of a row in the column metadata table
const RETURN_TYPE * checked_get(size_t row, const SOURCE_TYPE *boost_variant, boost_variant_accessor< RETURN_TYPE > &accessor)
const RETURN_TYPE * operator()(T const &operand) const
boost_variant_accessor< GeoTargetValue > GEO_TARGET_VALUE_ACCESSOR
The data to be inserted using the fragment manager.
boost_variant_accessor< ArrayTargetValue > ARRAY_TARGET_VALUE_ACCESSOR
const RETURN_TYPE * operator()(RETURN_TYPE const &operand) const
boost::variant< ScalarTargetValue, ArrayTargetValue, GeoTargetValue, GeoTargetValuePtr > TargetValue