41 auto dst_type_info = param.geo_chunks.size()
42 ? param.geo_chunks.begin()->getColumnDesc()->columnType
43 : param.dst_chunk.getColumnDesc()->columnType;
44 if (dst_type_info.is_dict_encoded_string()) {
45 switch (dst_type_info.get_size()) {
47 return std::make_unique<StringViewToStringDictEncoder<uint8_t>>(
48 param.dst_chunk, error_tracking_enabled);
50 return std::make_unique<StringViewToStringDictEncoder<uint16_t>>(
51 param.dst_chunk, error_tracking_enabled);
53 return std::make_unique<StringViewToStringDictEncoder<int32_t>>(
54 param.dst_chunk, error_tracking_enabled);
58 }
else if (dst_type_info.is_none_encoded_string()) {
59 return std::make_unique<StringViewToStringNoneEncoder>(param.dst_chunk,
60 error_tracking_enabled);
61 }
else if (dst_type_info.is_date_in_days()) {
62 switch (dst_type_info.get_comp_param()) {
65 return std::make_unique<StringViewToScalarEncoder<int32_t, int64_t>>(
66 param.dst_chunk, error_tracking_enabled);
68 return std::make_unique<StringViewToScalarEncoder<int16_t, int64_t>>(
69 param.dst_chunk, error_tracking_enabled);
73 }
else if (dst_type_info.is_integer() || dst_type_info.is_boolean() ||
74 dst_type_info.is_fp() || dst_type_info.is_decimal() ||
75 dst_type_info.is_time_or_date()) {
77 switch (dst_type_info.get_type()) {
80 return std::make_unique<StringViewToScalarEncoder<int8_t>>(
81 param.dst_chunk, error_tracking_enabled);
83 return std::make_unique<StringViewToScalarEncoder<int16_t>>(
84 param.dst_chunk, error_tracking_enabled);
86 return std::make_unique<StringViewToScalarEncoder<int32_t>>(
87 param.dst_chunk, error_tracking_enabled);
94 return std::make_unique<StringViewToScalarEncoder<int64_t>>(
95 param.dst_chunk, error_tracking_enabled);
97 return std::make_unique<StringViewToScalarEncoder<float>>(
98 param.dst_chunk, error_tracking_enabled);
100 return std::make_unique<StringViewToScalarEncoder<double>>(
101 param.dst_chunk, error_tracking_enabled);
106 switch (dst_type_info.get_type()) {
108 switch (dst_type_info.get_comp_param()) {
110 return std::make_unique<StringViewToScalarEncoder<int8_t, int16_t>>(
111 param.dst_chunk, error_tracking_enabled);
117 switch (dst_type_info.get_comp_param()) {
119 return std::make_unique<StringViewToScalarEncoder<int8_t, int32_t>>(
120 param.dst_chunk, error_tracking_enabled);
122 return std::make_unique<StringViewToScalarEncoder<int16_t, int32_t>>(
123 param.dst_chunk, error_tracking_enabled);
131 switch (dst_type_info.get_comp_param()) {
133 return std::make_unique<StringViewToScalarEncoder<int8_t, int64_t>>(
134 param.dst_chunk, error_tracking_enabled);
136 return std::make_unique<StringViewToScalarEncoder<int16_t, int64_t>>(
137 param.dst_chunk, error_tracking_enabled);
139 return std::make_unique<StringViewToScalarEncoder<int32_t, int64_t>>(
140 param.dst_chunk, error_tracking_enabled);
148 return std::make_unique<StringViewToScalarEncoder<int32_t, int64_t>>(
149 param.dst_chunk, error_tracking_enabled);
156 }
else if (dst_type_info.is_array()) {
157 auto dst_sub_type_info = dst_type_info.get_elem_type();
158 if (dst_sub_type_info.is_dict_encoded_string()) {
159 switch (dst_sub_type_info.get_size()) {
161 return std::make_unique<
162 StringViewToArrayEncoder<StringViewToStringDictEncoder<int32_t>>>(
163 param.scalar_temp_chunk, param.dst_chunk, error_tracking_enabled);
167 }
else if (dst_sub_type_info.is_none_encoded_string()) {
169 }
else if (dst_sub_type_info.is_date_in_days()) {
170 switch (dst_sub_type_info.get_comp_param()) {
173 return std::make_unique<
174 StringViewToArrayEncoder<StringViewToScalarEncoder<int32_t, int64_t>>>(
175 param.scalar_temp_chunk,
178 error_tracking_enabled);
182 }
else if (dst_sub_type_info.is_integer() || dst_sub_type_info.is_boolean() ||
183 dst_sub_type_info.is_fp() || dst_sub_type_info.is_decimal() ||
184 dst_sub_type_info.is_time_or_date()) {
186 switch (dst_sub_type_info.get_type()) {
188 return std::make_unique<
189 StringViewToArrayEncoder<StringViewToScalarEncoder<int8_t>>>(
190 param.scalar_temp_chunk,
193 error_tracking_enabled);
195 return std::make_unique<
196 StringViewToArrayEncoder<StringViewToScalarEncoder<int8_t>>>(
197 param.scalar_temp_chunk,
200 error_tracking_enabled);
202 return std::make_unique<
203 StringViewToArrayEncoder<StringViewToScalarEncoder<int16_t>>>(
204 param.scalar_temp_chunk,
207 error_tracking_enabled);
209 return std::make_unique<
210 StringViewToArrayEncoder<StringViewToScalarEncoder<int32_t>>>(
211 param.scalar_temp_chunk,
214 error_tracking_enabled);
221 return std::make_unique<
222 StringViewToArrayEncoder<StringViewToScalarEncoder<int64_t>>>(
223 param.scalar_temp_chunk,
226 error_tracking_enabled);
228 return std::make_unique<
229 StringViewToArrayEncoder<StringViewToScalarEncoder<float>>>(
230 param.scalar_temp_chunk,
233 error_tracking_enabled);
235 return std::make_unique<
236 StringViewToArrayEncoder<StringViewToScalarEncoder<double>>>(
237 param.scalar_temp_chunk,
240 error_tracking_enabled);
250 }
else if (dst_type_info.is_geometry()) {
251 return std::make_unique<StringViewToGeoEncoder>(param.geo_chunks,
252 param.geo_chunk_metadata,
253 error_tracking_enabled,
254 geo_validate_geometry);
257 UNREACHABLE() <<
"could not find appropriate encoder to create, conversion use case is "