17 #ifndef THRIFT_TYPE_CONVERT_H
18 #define THRIFT_TYPE_CONVERT_H
20 #include "gen-cpp/heavy_types.h"
33 return TDatumType::BOOL;
35 return TDatumType::TINYINT;
37 return TDatumType::SMALLINT;
39 return TDatumType::INT;
41 return TDatumType::BIGINT;
43 return TDatumType::FLOAT;
46 return TDatumType::DECIMAL;
48 return TDatumType::DOUBLE;
52 return TDatumType::STR;
54 return TDatumType::TIME;
56 return TDatumType::TIMESTAMP;
58 return TDatumType::DATE;
60 return TDatumType::INTERVAL_DAY_TIME;
62 return TDatumType::INTERVAL_YEAR_MONTH;
64 return TDatumType::POINT;
66 return TDatumType::MULTIPOINT;
68 return TDatumType::LINESTRING;
70 return TDatumType::MULTILINESTRING;
72 return TDatumType::POLYGON;
74 return TDatumType::MULTIPOLYGON;
76 return TDatumType::GEOMETRY;
78 return TDatumType::GEOGRAPHY;
87 case TDatumType::BOOL:
89 case TDatumType::TINYINT:
91 case TDatumType::SMALLINT:
95 case TDatumType::BIGINT:
97 case TDatumType::FLOAT:
99 case TDatumType::DECIMAL:
101 case TDatumType::DOUBLE:
103 case TDatumType::STR:
105 case TDatumType::TIME:
107 case TDatumType::TIMESTAMP:
109 case TDatumType::DATE:
111 case TDatumType::INTERVAL_DAY_TIME:
113 case TDatumType::INTERVAL_YEAR_MONTH:
115 case TDatumType::POINT:
117 case TDatumType::MULTIPOINT:
119 case TDatumType::LINESTRING:
121 case TDatumType::MULTILINESTRING:
123 case TDatumType::POLYGON:
125 case TDatumType::MULTIPOLYGON:
127 case TDatumType::GEOMETRY:
129 case TDatumType::GEOGRAPHY:
137 #define THRIFT_ENCODING_CASE(encoding) \
138 case kENCODING_##encoding: \
139 return TEncodingType::encoding;
141 #define UNTHRIFT_ENCODING_CASE(encoding) \
142 case TEncodingType::encoding: \
143 return kENCODING_##encoding;
164 switch (tEncodingType) {
188 ti.is_array ? type :
kNULLT);
190 internal_ti.set_precision(ti.precision);
191 internal_ti.set_scale(ti.scale);
193 internal_ti.set_precision(ti.precision);
196 internal_ti.set_subtype(static_cast<SQLTypes>(ti.precision));
197 internal_ti.set_input_srid(ti.scale);
198 internal_ti.set_output_srid(ti.scale);
200 internal_ti.set_size(ti.size);
201 return internal_ti.get_type_name();
213 ti.is_array ? type :
kNULLT);
214 return internal_ti.get_compression_name();
218 const bool strip_geo_encoding =
false) {
222 const auto base_type =
static_cast<SQLTypes>(thrift_ti.precision);
230 thrift_ti.comp_param,
232 }
else if (thrift_ti.is_array) {
238 thrift_ti.comp_param,
247 thrift_ti.comp_param,
251 const auto& dict_key = thrift_ti.dict_key;
257 #endif // THRIFT_TYPE_CONVERT_H
HOST DEVICE SQLTypes get_subtype() const
#define THRIFT_ENCODING_CASE(encoding)
TDatumType::type type_to_thrift(const SQLTypeInfo &type_info)
EncodingType thrift_to_encoding(const TEncodingType::type tEncodingType)
SQLTypes thrift_to_type(const TDatumType::type &type)
HOST DEVICE SQLTypes get_type() const
bool is_subtype_dict_encoded_string() const
SQLTypeInfo type_info_from_thrift(const TTypeInfo &thrift_ti, const bool strip_geo_encoding=false)
std::string thrift_to_encoding_name(const TTypeInfo &ti)
std::string thrift_to_name(const TTypeInfo &ti)
HOST DEVICE EncodingType get_compression() const
void setStringDictKey(const shared::StringDictKey &dict_key)
#define UNTHRIFT_ENCODING_CASE(encoding)
bool is_dict_encoded_string() const
TEncodingType::type encoding_to_thrift(const SQLTypeInfo &type_info)