1 | //------------------------------------------------------------------------- |
2 | // This file is automatically generated by scripts/generate_enum_util.py |
3 | // Do not edit this file manually, your changes will be overwritten |
4 | // If you want to exclude an enum from serialization, add it to the blacklist in the script |
5 | // |
6 | // Note: The generated code will only work properly if the enum is a top level item in the duckdb namespace |
7 | // If the enum is nested in a class, or in another namespace, the generated code will not compile. |
8 | // You should move the enum to the duckdb namespace, manually write a specialization or add it to the blacklist |
9 | //------------------------------------------------------------------------- |
10 | |
11 | #include "duckdb/common/enum_util.hpp" |
12 | #include "duckdb/parallel/task.hpp" |
13 | #include "duckdb/parallel/interrupt.hpp" |
14 | #include "duckdb/planner/bound_result_modifier.hpp" |
15 | #include "duckdb/planner/table_filter.hpp" |
16 | #include "duckdb/planner/binder.hpp" |
17 | #include "duckdb/catalog/catalog_entry/table_column_type.hpp" |
18 | #include "duckdb/function/aggregate_function.hpp" |
19 | #include "duckdb/function/function.hpp" |
20 | #include "duckdb/function/macro_function.hpp" |
21 | #include "duckdb/function/table/arrow.hpp" |
22 | #include "duckdb/function/scalar/strftime_format.hpp" |
23 | #include "duckdb/parser/simplified_token.hpp" |
24 | #include "duckdb/parser/result_modifier.hpp" |
25 | #include "duckdb/parser/constraint.hpp" |
26 | #include "duckdb/parser/parser_extension.hpp" |
27 | #include "duckdb/parser/query_node.hpp" |
28 | #include "duckdb/parser/parsed_data/create_sequence_info.hpp" |
29 | #include "duckdb/parser/parsed_data/alter_scalar_function_info.hpp" |
30 | #include "duckdb/parser/parsed_data/alter_table_info.hpp" |
31 | #include "duckdb/parser/parsed_data/alter_table_function_info.hpp" |
32 | #include "duckdb/parser/parsed_data/alter_info.hpp" |
33 | #include "duckdb/parser/parsed_data/pragma_info.hpp" |
34 | #include "duckdb/parser/parsed_data/create_info.hpp" |
35 | #include "duckdb/parser/parsed_data/transaction_info.hpp" |
36 | #include "duckdb/parser/parsed_data/sample_options.hpp" |
37 | #include "duckdb/parser/statement/explain_statement.hpp" |
38 | #include "duckdb/parser/statement/insert_statement.hpp" |
39 | #include "duckdb/parser/expression/window_expression.hpp" |
40 | #include "duckdb/storage/magic_bytes.hpp" |
41 | #include "duckdb/storage/statistics/base_statistics.hpp" |
42 | #include "duckdb/storage/table/column_segment.hpp" |
43 | #include "duckdb/storage/table/chunk_info.hpp" |
44 | #include "duckdb/storage/compression/bitpacking.hpp" |
45 | #include "duckdb/storage/buffer/block_handle.hpp" |
46 | #include "duckdb/verification/statement_verifier.hpp" |
47 | #include "duckdb/common/file_system.hpp" |
48 | #include "duckdb/common/file_buffer.hpp" |
49 | #include "duckdb/common/exception_format_value.hpp" |
50 | #include "duckdb/common/types.hpp" |
51 | #include "duckdb/common/printer.hpp" |
52 | #include "duckdb/common/types/timestamp.hpp" |
53 | #include "duckdb/common/types/conflict_manager.hpp" |
54 | #include "duckdb/common/types/vector.hpp" |
55 | #include "duckdb/common/types/vector_buffer.hpp" |
56 | #include "duckdb/common/types/column/partitioned_column_data.hpp" |
57 | #include "duckdb/common/types/column/column_data_scan_states.hpp" |
58 | #include "duckdb/common/types/row/partitioned_tuple_data.hpp" |
59 | #include "duckdb/common/types/row/tuple_data_states.hpp" |
60 | #include "duckdb/common/sort/partition_state.hpp" |
61 | #include "duckdb/common/enums/physical_operator_type.hpp" |
62 | #include "duckdb/common/enums/vector_type.hpp" |
63 | #include "duckdb/common/enums/access_mode.hpp" |
64 | #include "duckdb/common/enums/file_glob_options.hpp" |
65 | #include "duckdb/common/enums/wal_type.hpp" |
66 | #include "duckdb/common/enums/join_type.hpp" |
67 | #include "duckdb/common/enums/file_compression_type.hpp" |
68 | #include "duckdb/common/enums/profiler_format.hpp" |
69 | #include "duckdb/common/enums/statement_type.hpp" |
70 | #include "duckdb/common/enums/order_preservation_type.hpp" |
71 | #include "duckdb/common/enums/debug_initialize.hpp" |
72 | #include "duckdb/common/enums/catalog_type.hpp" |
73 | #include "duckdb/common/enums/set_scope.hpp" |
74 | #include "duckdb/common/enums/scan_options.hpp" |
75 | #include "duckdb/common/enums/set_type.hpp" |
76 | #include "duckdb/common/enums/expression_type.hpp" |
77 | #include "duckdb/common/enums/pending_execution_result.hpp" |
78 | #include "duckdb/common/enums/window_aggregation_mode.hpp" |
79 | #include "duckdb/common/enums/subquery_type.hpp" |
80 | #include "duckdb/common/enums/order_type.hpp" |
81 | #include "duckdb/common/enums/date_part_specifier.hpp" |
82 | #include "duckdb/common/enums/on_entry_not_found.hpp" |
83 | #include "duckdb/common/enums/logical_operator_type.hpp" |
84 | #include "duckdb/common/enums/operator_result_type.hpp" |
85 | #include "duckdb/common/enums/joinref_type.hpp" |
86 | #include "duckdb/common/enums/undo_flags.hpp" |
87 | #include "duckdb/common/enums/set_operation_type.hpp" |
88 | #include "duckdb/common/enums/optimizer_type.hpp" |
89 | #include "duckdb/common/enums/compression_type.hpp" |
90 | #include "duckdb/common/enums/aggregate_handling.hpp" |
91 | #include "duckdb/common/enums/tableref_type.hpp" |
92 | #include "duckdb/common/enums/relation_type.hpp" |
93 | #include "duckdb/common/enums/filter_propagate_result.hpp" |
94 | #include "duckdb/common/enums/index_type.hpp" |
95 | #include "duckdb/common/enums/output_type.hpp" |
96 | #include "duckdb/execution/index/art/node.hpp" |
97 | #include "duckdb/execution/index/art/art.hpp" |
98 | #include "duckdb/execution/operator/persistent/base_csv_reader.hpp" |
99 | #include "duckdb/main/error_manager.hpp" |
100 | #include "duckdb/main/appender.hpp" |
101 | #include "duckdb/main/config.hpp" |
102 | #include "duckdb/main/extension_helper.hpp" |
103 | #include "duckdb/main/query_result.hpp" |
104 | #include "duckdb/main/capi/capi_internal.hpp" |
105 | |
106 | namespace duckdb { |
107 | |
108 | template <> |
109 | const char *EnumUtil::ToChars<TaskExecutionMode>(TaskExecutionMode value) { |
110 | switch (value) { |
111 | case TaskExecutionMode::PROCESS_ALL: |
112 | return "PROCESS_ALL" ; |
113 | case TaskExecutionMode::PROCESS_PARTIAL: |
114 | return "PROCESS_PARTIAL" ; |
115 | default: |
116 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
117 | } |
118 | } |
119 | |
120 | template <> |
121 | TaskExecutionMode EnumUtil::FromString<TaskExecutionMode>(const char *value) { |
122 | if (StringUtil::Equals(s1: value, s2: "PROCESS_ALL" )) { |
123 | return TaskExecutionMode::PROCESS_ALL; |
124 | } |
125 | if (StringUtil::Equals(s1: value, s2: "PROCESS_PARTIAL" )) { |
126 | return TaskExecutionMode::PROCESS_PARTIAL; |
127 | } |
128 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
129 | } |
130 | |
131 | template <> |
132 | const char *EnumUtil::ToChars<TaskExecutionResult>(TaskExecutionResult value) { |
133 | switch (value) { |
134 | case TaskExecutionResult::TASK_FINISHED: |
135 | return "TASK_FINISHED" ; |
136 | case TaskExecutionResult::TASK_NOT_FINISHED: |
137 | return "TASK_NOT_FINISHED" ; |
138 | case TaskExecutionResult::TASK_ERROR: |
139 | return "TASK_ERROR" ; |
140 | case TaskExecutionResult::TASK_BLOCKED: |
141 | return "TASK_BLOCKED" ; |
142 | default: |
143 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
144 | } |
145 | } |
146 | |
147 | template <> |
148 | TaskExecutionResult EnumUtil::FromString<TaskExecutionResult>(const char *value) { |
149 | if (StringUtil::Equals(s1: value, s2: "TASK_FINISHED" )) { |
150 | return TaskExecutionResult::TASK_FINISHED; |
151 | } |
152 | if (StringUtil::Equals(s1: value, s2: "TASK_NOT_FINISHED" )) { |
153 | return TaskExecutionResult::TASK_NOT_FINISHED; |
154 | } |
155 | if (StringUtil::Equals(s1: value, s2: "TASK_ERROR" )) { |
156 | return TaskExecutionResult::TASK_ERROR; |
157 | } |
158 | if (StringUtil::Equals(s1: value, s2: "TASK_BLOCKED" )) { |
159 | return TaskExecutionResult::TASK_BLOCKED; |
160 | } |
161 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
162 | } |
163 | |
164 | template <> |
165 | const char *EnumUtil::ToChars<InterruptMode>(InterruptMode value) { |
166 | switch (value) { |
167 | case InterruptMode::NO_INTERRUPTS: |
168 | return "NO_INTERRUPTS" ; |
169 | case InterruptMode::TASK: |
170 | return "TASK" ; |
171 | case InterruptMode::BLOCKING: |
172 | return "BLOCKING" ; |
173 | default: |
174 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
175 | } |
176 | } |
177 | |
178 | template <> |
179 | InterruptMode EnumUtil::FromString<InterruptMode>(const char *value) { |
180 | if (StringUtil::Equals(s1: value, s2: "NO_INTERRUPTS" )) { |
181 | return InterruptMode::NO_INTERRUPTS; |
182 | } |
183 | if (StringUtil::Equals(s1: value, s2: "TASK" )) { |
184 | return InterruptMode::TASK; |
185 | } |
186 | if (StringUtil::Equals(s1: value, s2: "BLOCKING" )) { |
187 | return InterruptMode::BLOCKING; |
188 | } |
189 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
190 | } |
191 | |
192 | template <> |
193 | const char *EnumUtil::ToChars<DistinctType>(DistinctType value) { |
194 | switch (value) { |
195 | case DistinctType::DISTINCT: |
196 | return "DISTINCT" ; |
197 | case DistinctType::DISTINCT_ON: |
198 | return "DISTINCT_ON" ; |
199 | default: |
200 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
201 | } |
202 | } |
203 | |
204 | template <> |
205 | DistinctType EnumUtil::FromString<DistinctType>(const char *value) { |
206 | if (StringUtil::Equals(s1: value, s2: "DISTINCT" )) { |
207 | return DistinctType::DISTINCT; |
208 | } |
209 | if (StringUtil::Equals(s1: value, s2: "DISTINCT_ON" )) { |
210 | return DistinctType::DISTINCT_ON; |
211 | } |
212 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
213 | } |
214 | |
215 | template <> |
216 | const char *EnumUtil::ToChars<TableFilterType>(TableFilterType value) { |
217 | switch (value) { |
218 | case TableFilterType::CONSTANT_COMPARISON: |
219 | return "CONSTANT_COMPARISON" ; |
220 | case TableFilterType::IS_NULL: |
221 | return "IS_NULL" ; |
222 | case TableFilterType::IS_NOT_NULL: |
223 | return "IS_NOT_NULL" ; |
224 | case TableFilterType::CONJUNCTION_OR: |
225 | return "CONJUNCTION_OR" ; |
226 | case TableFilterType::CONJUNCTION_AND: |
227 | return "CONJUNCTION_AND" ; |
228 | default: |
229 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
230 | } |
231 | } |
232 | |
233 | template <> |
234 | TableFilterType EnumUtil::FromString<TableFilterType>(const char *value) { |
235 | if (StringUtil::Equals(s1: value, s2: "CONSTANT_COMPARISON" )) { |
236 | return TableFilterType::CONSTANT_COMPARISON; |
237 | } |
238 | if (StringUtil::Equals(s1: value, s2: "IS_NULL" )) { |
239 | return TableFilterType::IS_NULL; |
240 | } |
241 | if (StringUtil::Equals(s1: value, s2: "IS_NOT_NULL" )) { |
242 | return TableFilterType::IS_NOT_NULL; |
243 | } |
244 | if (StringUtil::Equals(s1: value, s2: "CONJUNCTION_OR" )) { |
245 | return TableFilterType::CONJUNCTION_OR; |
246 | } |
247 | if (StringUtil::Equals(s1: value, s2: "CONJUNCTION_AND" )) { |
248 | return TableFilterType::CONJUNCTION_AND; |
249 | } |
250 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
251 | } |
252 | |
253 | template <> |
254 | const char *EnumUtil::ToChars<BindingMode>(BindingMode value) { |
255 | switch (value) { |
256 | case BindingMode::STANDARD_BINDING: |
257 | return "STANDARD_BINDING" ; |
258 | case BindingMode::EXTRACT_NAMES: |
259 | return "EXTRACT_NAMES" ; |
260 | default: |
261 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
262 | } |
263 | } |
264 | |
265 | template <> |
266 | BindingMode EnumUtil::FromString<BindingMode>(const char *value) { |
267 | if (StringUtil::Equals(s1: value, s2: "STANDARD_BINDING" )) { |
268 | return BindingMode::STANDARD_BINDING; |
269 | } |
270 | if (StringUtil::Equals(s1: value, s2: "EXTRACT_NAMES" )) { |
271 | return BindingMode::EXTRACT_NAMES; |
272 | } |
273 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
274 | } |
275 | |
276 | template <> |
277 | const char *EnumUtil::ToChars<TableColumnType>(TableColumnType value) { |
278 | switch (value) { |
279 | case TableColumnType::STANDARD: |
280 | return "STANDARD" ; |
281 | case TableColumnType::GENERATED: |
282 | return "GENERATED" ; |
283 | default: |
284 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
285 | } |
286 | } |
287 | |
288 | template <> |
289 | TableColumnType EnumUtil::FromString<TableColumnType>(const char *value) { |
290 | if (StringUtil::Equals(s1: value, s2: "STANDARD" )) { |
291 | return TableColumnType::STANDARD; |
292 | } |
293 | if (StringUtil::Equals(s1: value, s2: "GENERATED" )) { |
294 | return TableColumnType::GENERATED; |
295 | } |
296 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
297 | } |
298 | |
299 | template <> |
300 | const char *EnumUtil::ToChars<AggregateType>(AggregateType value) { |
301 | switch (value) { |
302 | case AggregateType::NON_DISTINCT: |
303 | return "NON_DISTINCT" ; |
304 | case AggregateType::DISTINCT: |
305 | return "DISTINCT" ; |
306 | default: |
307 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
308 | } |
309 | } |
310 | |
311 | template <> |
312 | AggregateType EnumUtil::FromString<AggregateType>(const char *value) { |
313 | if (StringUtil::Equals(s1: value, s2: "NON_DISTINCT" )) { |
314 | return AggregateType::NON_DISTINCT; |
315 | } |
316 | if (StringUtil::Equals(s1: value, s2: "DISTINCT" )) { |
317 | return AggregateType::DISTINCT; |
318 | } |
319 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
320 | } |
321 | |
322 | template <> |
323 | const char *EnumUtil::ToChars<AggregateOrderDependent>(AggregateOrderDependent value) { |
324 | switch (value) { |
325 | case AggregateOrderDependent::ORDER_DEPENDENT: |
326 | return "ORDER_DEPENDENT" ; |
327 | case AggregateOrderDependent::NOT_ORDER_DEPENDENT: |
328 | return "NOT_ORDER_DEPENDENT" ; |
329 | default: |
330 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
331 | } |
332 | } |
333 | |
334 | template <> |
335 | AggregateOrderDependent EnumUtil::FromString<AggregateOrderDependent>(const char *value) { |
336 | if (StringUtil::Equals(s1: value, s2: "ORDER_DEPENDENT" )) { |
337 | return AggregateOrderDependent::ORDER_DEPENDENT; |
338 | } |
339 | if (StringUtil::Equals(s1: value, s2: "NOT_ORDER_DEPENDENT" )) { |
340 | return AggregateOrderDependent::NOT_ORDER_DEPENDENT; |
341 | } |
342 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
343 | } |
344 | |
345 | template <> |
346 | const char *EnumUtil::ToChars<FunctionNullHandling>(FunctionNullHandling value) { |
347 | switch (value) { |
348 | case FunctionNullHandling::DEFAULT_NULL_HANDLING: |
349 | return "DEFAULT_NULL_HANDLING" ; |
350 | case FunctionNullHandling::SPECIAL_HANDLING: |
351 | return "SPECIAL_HANDLING" ; |
352 | default: |
353 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
354 | } |
355 | } |
356 | |
357 | template <> |
358 | FunctionNullHandling EnumUtil::FromString<FunctionNullHandling>(const char *value) { |
359 | if (StringUtil::Equals(s1: value, s2: "DEFAULT_NULL_HANDLING" )) { |
360 | return FunctionNullHandling::DEFAULT_NULL_HANDLING; |
361 | } |
362 | if (StringUtil::Equals(s1: value, s2: "SPECIAL_HANDLING" )) { |
363 | return FunctionNullHandling::SPECIAL_HANDLING; |
364 | } |
365 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
366 | } |
367 | |
368 | template <> |
369 | const char *EnumUtil::ToChars<FunctionSideEffects>(FunctionSideEffects value) { |
370 | switch (value) { |
371 | case FunctionSideEffects::NO_SIDE_EFFECTS: |
372 | return "NO_SIDE_EFFECTS" ; |
373 | case FunctionSideEffects::HAS_SIDE_EFFECTS: |
374 | return "HAS_SIDE_EFFECTS" ; |
375 | default: |
376 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
377 | } |
378 | } |
379 | |
380 | template <> |
381 | FunctionSideEffects EnumUtil::FromString<FunctionSideEffects>(const char *value) { |
382 | if (StringUtil::Equals(s1: value, s2: "NO_SIDE_EFFECTS" )) { |
383 | return FunctionSideEffects::NO_SIDE_EFFECTS; |
384 | } |
385 | if (StringUtil::Equals(s1: value, s2: "HAS_SIDE_EFFECTS" )) { |
386 | return FunctionSideEffects::HAS_SIDE_EFFECTS; |
387 | } |
388 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
389 | } |
390 | |
391 | template <> |
392 | const char *EnumUtil::ToChars<MacroType>(MacroType value) { |
393 | switch (value) { |
394 | case MacroType::VOID_MACRO: |
395 | return "VOID_MACRO" ; |
396 | case MacroType::TABLE_MACRO: |
397 | return "TABLE_MACRO" ; |
398 | case MacroType::SCALAR_MACRO: |
399 | return "SCALAR_MACRO" ; |
400 | default: |
401 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
402 | } |
403 | } |
404 | |
405 | template <> |
406 | MacroType EnumUtil::FromString<MacroType>(const char *value) { |
407 | if (StringUtil::Equals(s1: value, s2: "VOID_MACRO" )) { |
408 | return MacroType::VOID_MACRO; |
409 | } |
410 | if (StringUtil::Equals(s1: value, s2: "TABLE_MACRO" )) { |
411 | return MacroType::TABLE_MACRO; |
412 | } |
413 | if (StringUtil::Equals(s1: value, s2: "SCALAR_MACRO" )) { |
414 | return MacroType::SCALAR_MACRO; |
415 | } |
416 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
417 | } |
418 | |
419 | template <> |
420 | const char *EnumUtil::ToChars<ArrowVariableSizeType>(ArrowVariableSizeType value) { |
421 | switch (value) { |
422 | case ArrowVariableSizeType::FIXED_SIZE: |
423 | return "FIXED_SIZE" ; |
424 | case ArrowVariableSizeType::NORMAL: |
425 | return "NORMAL" ; |
426 | case ArrowVariableSizeType::SUPER_SIZE: |
427 | return "SUPER_SIZE" ; |
428 | default: |
429 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
430 | } |
431 | } |
432 | |
433 | template <> |
434 | ArrowVariableSizeType EnumUtil::FromString<ArrowVariableSizeType>(const char *value) { |
435 | if (StringUtil::Equals(s1: value, s2: "FIXED_SIZE" )) { |
436 | return ArrowVariableSizeType::FIXED_SIZE; |
437 | } |
438 | if (StringUtil::Equals(s1: value, s2: "NORMAL" )) { |
439 | return ArrowVariableSizeType::NORMAL; |
440 | } |
441 | if (StringUtil::Equals(s1: value, s2: "SUPER_SIZE" )) { |
442 | return ArrowVariableSizeType::SUPER_SIZE; |
443 | } |
444 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
445 | } |
446 | |
447 | template <> |
448 | const char *EnumUtil::ToChars<ArrowDateTimeType>(ArrowDateTimeType value) { |
449 | switch (value) { |
450 | case ArrowDateTimeType::MILLISECONDS: |
451 | return "MILLISECONDS" ; |
452 | case ArrowDateTimeType::MICROSECONDS: |
453 | return "MICROSECONDS" ; |
454 | case ArrowDateTimeType::NANOSECONDS: |
455 | return "NANOSECONDS" ; |
456 | case ArrowDateTimeType::SECONDS: |
457 | return "SECONDS" ; |
458 | case ArrowDateTimeType::DAYS: |
459 | return "DAYS" ; |
460 | case ArrowDateTimeType::MONTHS: |
461 | return "MONTHS" ; |
462 | case ArrowDateTimeType::MONTH_DAY_NANO: |
463 | return "MONTH_DAY_NANO" ; |
464 | default: |
465 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
466 | } |
467 | } |
468 | |
469 | template <> |
470 | ArrowDateTimeType EnumUtil::FromString<ArrowDateTimeType>(const char *value) { |
471 | if (StringUtil::Equals(s1: value, s2: "MILLISECONDS" )) { |
472 | return ArrowDateTimeType::MILLISECONDS; |
473 | } |
474 | if (StringUtil::Equals(s1: value, s2: "MICROSECONDS" )) { |
475 | return ArrowDateTimeType::MICROSECONDS; |
476 | } |
477 | if (StringUtil::Equals(s1: value, s2: "NANOSECONDS" )) { |
478 | return ArrowDateTimeType::NANOSECONDS; |
479 | } |
480 | if (StringUtil::Equals(s1: value, s2: "SECONDS" )) { |
481 | return ArrowDateTimeType::SECONDS; |
482 | } |
483 | if (StringUtil::Equals(s1: value, s2: "DAYS" )) { |
484 | return ArrowDateTimeType::DAYS; |
485 | } |
486 | if (StringUtil::Equals(s1: value, s2: "MONTHS" )) { |
487 | return ArrowDateTimeType::MONTHS; |
488 | } |
489 | if (StringUtil::Equals(s1: value, s2: "MONTH_DAY_NANO" )) { |
490 | return ArrowDateTimeType::MONTH_DAY_NANO; |
491 | } |
492 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
493 | } |
494 | |
495 | template <> |
496 | const char *EnumUtil::ToChars<StrTimeSpecifier>(StrTimeSpecifier value) { |
497 | switch (value) { |
498 | case StrTimeSpecifier::ABBREVIATED_WEEKDAY_NAME: |
499 | return "ABBREVIATED_WEEKDAY_NAME" ; |
500 | case StrTimeSpecifier::FULL_WEEKDAY_NAME: |
501 | return "FULL_WEEKDAY_NAME" ; |
502 | case StrTimeSpecifier::WEEKDAY_DECIMAL: |
503 | return "WEEKDAY_DECIMAL" ; |
504 | case StrTimeSpecifier::DAY_OF_MONTH_PADDED: |
505 | return "DAY_OF_MONTH_PADDED" ; |
506 | case StrTimeSpecifier::DAY_OF_MONTH: |
507 | return "DAY_OF_MONTH" ; |
508 | case StrTimeSpecifier::ABBREVIATED_MONTH_NAME: |
509 | return "ABBREVIATED_MONTH_NAME" ; |
510 | case StrTimeSpecifier::FULL_MONTH_NAME: |
511 | return "FULL_MONTH_NAME" ; |
512 | case StrTimeSpecifier::MONTH_DECIMAL_PADDED: |
513 | return "MONTH_DECIMAL_PADDED" ; |
514 | case StrTimeSpecifier::MONTH_DECIMAL: |
515 | return "MONTH_DECIMAL" ; |
516 | case StrTimeSpecifier::YEAR_WITHOUT_CENTURY_PADDED: |
517 | return "YEAR_WITHOUT_CENTURY_PADDED" ; |
518 | case StrTimeSpecifier::YEAR_WITHOUT_CENTURY: |
519 | return "YEAR_WITHOUT_CENTURY" ; |
520 | case StrTimeSpecifier::YEAR_DECIMAL: |
521 | return "YEAR_DECIMAL" ; |
522 | case StrTimeSpecifier::HOUR_24_PADDED: |
523 | return "HOUR_24_PADDED" ; |
524 | case StrTimeSpecifier::HOUR_24_DECIMAL: |
525 | return "HOUR_24_DECIMAL" ; |
526 | case StrTimeSpecifier::HOUR_12_PADDED: |
527 | return "HOUR_12_PADDED" ; |
528 | case StrTimeSpecifier::HOUR_12_DECIMAL: |
529 | return "HOUR_12_DECIMAL" ; |
530 | case StrTimeSpecifier::AM_PM: |
531 | return "AM_PM" ; |
532 | case StrTimeSpecifier::MINUTE_PADDED: |
533 | return "MINUTE_PADDED" ; |
534 | case StrTimeSpecifier::MINUTE_DECIMAL: |
535 | return "MINUTE_DECIMAL" ; |
536 | case StrTimeSpecifier::SECOND_PADDED: |
537 | return "SECOND_PADDED" ; |
538 | case StrTimeSpecifier::SECOND_DECIMAL: |
539 | return "SECOND_DECIMAL" ; |
540 | case StrTimeSpecifier::MICROSECOND_PADDED: |
541 | return "MICROSECOND_PADDED" ; |
542 | case StrTimeSpecifier::MILLISECOND_PADDED: |
543 | return "MILLISECOND_PADDED" ; |
544 | case StrTimeSpecifier::UTC_OFFSET: |
545 | return "UTC_OFFSET" ; |
546 | case StrTimeSpecifier::TZ_NAME: |
547 | return "TZ_NAME" ; |
548 | case StrTimeSpecifier::DAY_OF_YEAR_PADDED: |
549 | return "DAY_OF_YEAR_PADDED" ; |
550 | case StrTimeSpecifier::DAY_OF_YEAR_DECIMAL: |
551 | return "DAY_OF_YEAR_DECIMAL" ; |
552 | case StrTimeSpecifier::WEEK_NUMBER_PADDED_SUN_FIRST: |
553 | return "WEEK_NUMBER_PADDED_SUN_FIRST" ; |
554 | case StrTimeSpecifier::WEEK_NUMBER_PADDED_MON_FIRST: |
555 | return "WEEK_NUMBER_PADDED_MON_FIRST" ; |
556 | case StrTimeSpecifier::LOCALE_APPROPRIATE_DATE_AND_TIME: |
557 | return "LOCALE_APPROPRIATE_DATE_AND_TIME" ; |
558 | case StrTimeSpecifier::LOCALE_APPROPRIATE_DATE: |
559 | return "LOCALE_APPROPRIATE_DATE" ; |
560 | case StrTimeSpecifier::LOCALE_APPROPRIATE_TIME: |
561 | return "LOCALE_APPROPRIATE_TIME" ; |
562 | default: |
563 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
564 | } |
565 | } |
566 | |
567 | template <> |
568 | StrTimeSpecifier EnumUtil::FromString<StrTimeSpecifier>(const char *value) { |
569 | if (StringUtil::Equals(s1: value, s2: "ABBREVIATED_WEEKDAY_NAME" )) { |
570 | return StrTimeSpecifier::ABBREVIATED_WEEKDAY_NAME; |
571 | } |
572 | if (StringUtil::Equals(s1: value, s2: "FULL_WEEKDAY_NAME" )) { |
573 | return StrTimeSpecifier::FULL_WEEKDAY_NAME; |
574 | } |
575 | if (StringUtil::Equals(s1: value, s2: "WEEKDAY_DECIMAL" )) { |
576 | return StrTimeSpecifier::WEEKDAY_DECIMAL; |
577 | } |
578 | if (StringUtil::Equals(s1: value, s2: "DAY_OF_MONTH_PADDED" )) { |
579 | return StrTimeSpecifier::DAY_OF_MONTH_PADDED; |
580 | } |
581 | if (StringUtil::Equals(s1: value, s2: "DAY_OF_MONTH" )) { |
582 | return StrTimeSpecifier::DAY_OF_MONTH; |
583 | } |
584 | if (StringUtil::Equals(s1: value, s2: "ABBREVIATED_MONTH_NAME" )) { |
585 | return StrTimeSpecifier::ABBREVIATED_MONTH_NAME; |
586 | } |
587 | if (StringUtil::Equals(s1: value, s2: "FULL_MONTH_NAME" )) { |
588 | return StrTimeSpecifier::FULL_MONTH_NAME; |
589 | } |
590 | if (StringUtil::Equals(s1: value, s2: "MONTH_DECIMAL_PADDED" )) { |
591 | return StrTimeSpecifier::MONTH_DECIMAL_PADDED; |
592 | } |
593 | if (StringUtil::Equals(s1: value, s2: "MONTH_DECIMAL" )) { |
594 | return StrTimeSpecifier::MONTH_DECIMAL; |
595 | } |
596 | if (StringUtil::Equals(s1: value, s2: "YEAR_WITHOUT_CENTURY_PADDED" )) { |
597 | return StrTimeSpecifier::YEAR_WITHOUT_CENTURY_PADDED; |
598 | } |
599 | if (StringUtil::Equals(s1: value, s2: "YEAR_WITHOUT_CENTURY" )) { |
600 | return StrTimeSpecifier::YEAR_WITHOUT_CENTURY; |
601 | } |
602 | if (StringUtil::Equals(s1: value, s2: "YEAR_DECIMAL" )) { |
603 | return StrTimeSpecifier::YEAR_DECIMAL; |
604 | } |
605 | if (StringUtil::Equals(s1: value, s2: "HOUR_24_PADDED" )) { |
606 | return StrTimeSpecifier::HOUR_24_PADDED; |
607 | } |
608 | if (StringUtil::Equals(s1: value, s2: "HOUR_24_DECIMAL" )) { |
609 | return StrTimeSpecifier::HOUR_24_DECIMAL; |
610 | } |
611 | if (StringUtil::Equals(s1: value, s2: "HOUR_12_PADDED" )) { |
612 | return StrTimeSpecifier::HOUR_12_PADDED; |
613 | } |
614 | if (StringUtil::Equals(s1: value, s2: "HOUR_12_DECIMAL" )) { |
615 | return StrTimeSpecifier::HOUR_12_DECIMAL; |
616 | } |
617 | if (StringUtil::Equals(s1: value, s2: "AM_PM" )) { |
618 | return StrTimeSpecifier::AM_PM; |
619 | } |
620 | if (StringUtil::Equals(s1: value, s2: "MINUTE_PADDED" )) { |
621 | return StrTimeSpecifier::MINUTE_PADDED; |
622 | } |
623 | if (StringUtil::Equals(s1: value, s2: "MINUTE_DECIMAL" )) { |
624 | return StrTimeSpecifier::MINUTE_DECIMAL; |
625 | } |
626 | if (StringUtil::Equals(s1: value, s2: "SECOND_PADDED" )) { |
627 | return StrTimeSpecifier::SECOND_PADDED; |
628 | } |
629 | if (StringUtil::Equals(s1: value, s2: "SECOND_DECIMAL" )) { |
630 | return StrTimeSpecifier::SECOND_DECIMAL; |
631 | } |
632 | if (StringUtil::Equals(s1: value, s2: "MICROSECOND_PADDED" )) { |
633 | return StrTimeSpecifier::MICROSECOND_PADDED; |
634 | } |
635 | if (StringUtil::Equals(s1: value, s2: "MILLISECOND_PADDED" )) { |
636 | return StrTimeSpecifier::MILLISECOND_PADDED; |
637 | } |
638 | if (StringUtil::Equals(s1: value, s2: "UTC_OFFSET" )) { |
639 | return StrTimeSpecifier::UTC_OFFSET; |
640 | } |
641 | if (StringUtil::Equals(s1: value, s2: "TZ_NAME" )) { |
642 | return StrTimeSpecifier::TZ_NAME; |
643 | } |
644 | if (StringUtil::Equals(s1: value, s2: "DAY_OF_YEAR_PADDED" )) { |
645 | return StrTimeSpecifier::DAY_OF_YEAR_PADDED; |
646 | } |
647 | if (StringUtil::Equals(s1: value, s2: "DAY_OF_YEAR_DECIMAL" )) { |
648 | return StrTimeSpecifier::DAY_OF_YEAR_DECIMAL; |
649 | } |
650 | if (StringUtil::Equals(s1: value, s2: "WEEK_NUMBER_PADDED_SUN_FIRST" )) { |
651 | return StrTimeSpecifier::WEEK_NUMBER_PADDED_SUN_FIRST; |
652 | } |
653 | if (StringUtil::Equals(s1: value, s2: "WEEK_NUMBER_PADDED_MON_FIRST" )) { |
654 | return StrTimeSpecifier::WEEK_NUMBER_PADDED_MON_FIRST; |
655 | } |
656 | if (StringUtil::Equals(s1: value, s2: "LOCALE_APPROPRIATE_DATE_AND_TIME" )) { |
657 | return StrTimeSpecifier::LOCALE_APPROPRIATE_DATE_AND_TIME; |
658 | } |
659 | if (StringUtil::Equals(s1: value, s2: "LOCALE_APPROPRIATE_DATE" )) { |
660 | return StrTimeSpecifier::LOCALE_APPROPRIATE_DATE; |
661 | } |
662 | if (StringUtil::Equals(s1: value, s2: "LOCALE_APPROPRIATE_TIME" )) { |
663 | return StrTimeSpecifier::LOCALE_APPROPRIATE_TIME; |
664 | } |
665 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
666 | } |
667 | |
668 | template <> |
669 | const char *EnumUtil::ToChars<SimplifiedTokenType>(SimplifiedTokenType value) { |
670 | switch (value) { |
671 | case SimplifiedTokenType::SIMPLIFIED_TOKEN_IDENTIFIER: |
672 | return "SIMPLIFIED_TOKEN_IDENTIFIER" ; |
673 | case SimplifiedTokenType::SIMPLIFIED_TOKEN_NUMERIC_CONSTANT: |
674 | return "SIMPLIFIED_TOKEN_NUMERIC_CONSTANT" ; |
675 | case SimplifiedTokenType::SIMPLIFIED_TOKEN_STRING_CONSTANT: |
676 | return "SIMPLIFIED_TOKEN_STRING_CONSTANT" ; |
677 | case SimplifiedTokenType::SIMPLIFIED_TOKEN_OPERATOR: |
678 | return "SIMPLIFIED_TOKEN_OPERATOR" ; |
679 | case SimplifiedTokenType::SIMPLIFIED_TOKEN_KEYWORD: |
680 | return "SIMPLIFIED_TOKEN_KEYWORD" ; |
681 | case SimplifiedTokenType::SIMPLIFIED_TOKEN_COMMENT: |
682 | return "SIMPLIFIED_TOKEN_COMMENT" ; |
683 | default: |
684 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
685 | } |
686 | } |
687 | |
688 | template <> |
689 | SimplifiedTokenType EnumUtil::FromString<SimplifiedTokenType>(const char *value) { |
690 | if (StringUtil::Equals(s1: value, s2: "SIMPLIFIED_TOKEN_IDENTIFIER" )) { |
691 | return SimplifiedTokenType::SIMPLIFIED_TOKEN_IDENTIFIER; |
692 | } |
693 | if (StringUtil::Equals(s1: value, s2: "SIMPLIFIED_TOKEN_NUMERIC_CONSTANT" )) { |
694 | return SimplifiedTokenType::SIMPLIFIED_TOKEN_NUMERIC_CONSTANT; |
695 | } |
696 | if (StringUtil::Equals(s1: value, s2: "SIMPLIFIED_TOKEN_STRING_CONSTANT" )) { |
697 | return SimplifiedTokenType::SIMPLIFIED_TOKEN_STRING_CONSTANT; |
698 | } |
699 | if (StringUtil::Equals(s1: value, s2: "SIMPLIFIED_TOKEN_OPERATOR" )) { |
700 | return SimplifiedTokenType::SIMPLIFIED_TOKEN_OPERATOR; |
701 | } |
702 | if (StringUtil::Equals(s1: value, s2: "SIMPLIFIED_TOKEN_KEYWORD" )) { |
703 | return SimplifiedTokenType::SIMPLIFIED_TOKEN_KEYWORD; |
704 | } |
705 | if (StringUtil::Equals(s1: value, s2: "SIMPLIFIED_TOKEN_COMMENT" )) { |
706 | return SimplifiedTokenType::SIMPLIFIED_TOKEN_COMMENT; |
707 | } |
708 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
709 | } |
710 | |
711 | template <> |
712 | const char *EnumUtil::ToChars<KeywordCategory>(KeywordCategory value) { |
713 | switch (value) { |
714 | case KeywordCategory::KEYWORD_RESERVED: |
715 | return "KEYWORD_RESERVED" ; |
716 | case KeywordCategory::KEYWORD_UNRESERVED: |
717 | return "KEYWORD_UNRESERVED" ; |
718 | case KeywordCategory::KEYWORD_TYPE_FUNC: |
719 | return "KEYWORD_TYPE_FUNC" ; |
720 | case KeywordCategory::KEYWORD_COL_NAME: |
721 | return "KEYWORD_COL_NAME" ; |
722 | default: |
723 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
724 | } |
725 | } |
726 | |
727 | template <> |
728 | KeywordCategory EnumUtil::FromString<KeywordCategory>(const char *value) { |
729 | if (StringUtil::Equals(s1: value, s2: "KEYWORD_RESERVED" )) { |
730 | return KeywordCategory::KEYWORD_RESERVED; |
731 | } |
732 | if (StringUtil::Equals(s1: value, s2: "KEYWORD_UNRESERVED" )) { |
733 | return KeywordCategory::KEYWORD_UNRESERVED; |
734 | } |
735 | if (StringUtil::Equals(s1: value, s2: "KEYWORD_TYPE_FUNC" )) { |
736 | return KeywordCategory::KEYWORD_TYPE_FUNC; |
737 | } |
738 | if (StringUtil::Equals(s1: value, s2: "KEYWORD_COL_NAME" )) { |
739 | return KeywordCategory::KEYWORD_COL_NAME; |
740 | } |
741 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
742 | } |
743 | |
744 | template <> |
745 | const char *EnumUtil::ToChars<ResultModifierType>(ResultModifierType value) { |
746 | switch (value) { |
747 | case ResultModifierType::LIMIT_MODIFIER: |
748 | return "LIMIT_MODIFIER" ; |
749 | case ResultModifierType::ORDER_MODIFIER: |
750 | return "ORDER_MODIFIER" ; |
751 | case ResultModifierType::DISTINCT_MODIFIER: |
752 | return "DISTINCT_MODIFIER" ; |
753 | case ResultModifierType::LIMIT_PERCENT_MODIFIER: |
754 | return "LIMIT_PERCENT_MODIFIER" ; |
755 | default: |
756 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
757 | } |
758 | } |
759 | |
760 | template <> |
761 | ResultModifierType EnumUtil::FromString<ResultModifierType>(const char *value) { |
762 | if (StringUtil::Equals(s1: value, s2: "LIMIT_MODIFIER" )) { |
763 | return ResultModifierType::LIMIT_MODIFIER; |
764 | } |
765 | if (StringUtil::Equals(s1: value, s2: "ORDER_MODIFIER" )) { |
766 | return ResultModifierType::ORDER_MODIFIER; |
767 | } |
768 | if (StringUtil::Equals(s1: value, s2: "DISTINCT_MODIFIER" )) { |
769 | return ResultModifierType::DISTINCT_MODIFIER; |
770 | } |
771 | if (StringUtil::Equals(s1: value, s2: "LIMIT_PERCENT_MODIFIER" )) { |
772 | return ResultModifierType::LIMIT_PERCENT_MODIFIER; |
773 | } |
774 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
775 | } |
776 | |
777 | template <> |
778 | const char *EnumUtil::ToChars<ConstraintType>(ConstraintType value) { |
779 | switch (value) { |
780 | case ConstraintType::INVALID: |
781 | return "INVALID" ; |
782 | case ConstraintType::NOT_NULL: |
783 | return "NOT_NULL" ; |
784 | case ConstraintType::CHECK: |
785 | return "CHECK" ; |
786 | case ConstraintType::UNIQUE: |
787 | return "UNIQUE" ; |
788 | case ConstraintType::FOREIGN_KEY: |
789 | return "FOREIGN_KEY" ; |
790 | default: |
791 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
792 | } |
793 | } |
794 | |
795 | template <> |
796 | ConstraintType EnumUtil::FromString<ConstraintType>(const char *value) { |
797 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
798 | return ConstraintType::INVALID; |
799 | } |
800 | if (StringUtil::Equals(s1: value, s2: "NOT_NULL" )) { |
801 | return ConstraintType::NOT_NULL; |
802 | } |
803 | if (StringUtil::Equals(s1: value, s2: "CHECK" )) { |
804 | return ConstraintType::CHECK; |
805 | } |
806 | if (StringUtil::Equals(s1: value, s2: "UNIQUE" )) { |
807 | return ConstraintType::UNIQUE; |
808 | } |
809 | if (StringUtil::Equals(s1: value, s2: "FOREIGN_KEY" )) { |
810 | return ConstraintType::FOREIGN_KEY; |
811 | } |
812 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
813 | } |
814 | |
815 | template <> |
816 | const char *EnumUtil::ToChars<ForeignKeyType>(ForeignKeyType value) { |
817 | switch (value) { |
818 | case ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE: |
819 | return "FK_TYPE_PRIMARY_KEY_TABLE" ; |
820 | case ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE: |
821 | return "FK_TYPE_FOREIGN_KEY_TABLE" ; |
822 | case ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE: |
823 | return "FK_TYPE_SELF_REFERENCE_TABLE" ; |
824 | default: |
825 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
826 | } |
827 | } |
828 | |
829 | template <> |
830 | ForeignKeyType EnumUtil::FromString<ForeignKeyType>(const char *value) { |
831 | if (StringUtil::Equals(s1: value, s2: "FK_TYPE_PRIMARY_KEY_TABLE" )) { |
832 | return ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE; |
833 | } |
834 | if (StringUtil::Equals(s1: value, s2: "FK_TYPE_FOREIGN_KEY_TABLE" )) { |
835 | return ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE; |
836 | } |
837 | if (StringUtil::Equals(s1: value, s2: "FK_TYPE_SELF_REFERENCE_TABLE" )) { |
838 | return ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE; |
839 | } |
840 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
841 | } |
842 | |
843 | template <> |
844 | const char *EnumUtil::ToChars<ParserExtensionResultType>(ParserExtensionResultType value) { |
845 | switch (value) { |
846 | case ParserExtensionResultType::PARSE_SUCCESSFUL: |
847 | return "PARSE_SUCCESSFUL" ; |
848 | case ParserExtensionResultType::DISPLAY_ORIGINAL_ERROR: |
849 | return "DISPLAY_ORIGINAL_ERROR" ; |
850 | case ParserExtensionResultType::DISPLAY_EXTENSION_ERROR: |
851 | return "DISPLAY_EXTENSION_ERROR" ; |
852 | default: |
853 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
854 | } |
855 | } |
856 | |
857 | template <> |
858 | ParserExtensionResultType EnumUtil::FromString<ParserExtensionResultType>(const char *value) { |
859 | if (StringUtil::Equals(s1: value, s2: "PARSE_SUCCESSFUL" )) { |
860 | return ParserExtensionResultType::PARSE_SUCCESSFUL; |
861 | } |
862 | if (StringUtil::Equals(s1: value, s2: "DISPLAY_ORIGINAL_ERROR" )) { |
863 | return ParserExtensionResultType::DISPLAY_ORIGINAL_ERROR; |
864 | } |
865 | if (StringUtil::Equals(s1: value, s2: "DISPLAY_EXTENSION_ERROR" )) { |
866 | return ParserExtensionResultType::DISPLAY_EXTENSION_ERROR; |
867 | } |
868 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
869 | } |
870 | |
871 | template <> |
872 | const char *EnumUtil::ToChars<QueryNodeType>(QueryNodeType value) { |
873 | switch (value) { |
874 | case QueryNodeType::SELECT_NODE: |
875 | return "SELECT_NODE" ; |
876 | case QueryNodeType::SET_OPERATION_NODE: |
877 | return "SET_OPERATION_NODE" ; |
878 | case QueryNodeType::BOUND_SUBQUERY_NODE: |
879 | return "BOUND_SUBQUERY_NODE" ; |
880 | case QueryNodeType::RECURSIVE_CTE_NODE: |
881 | return "RECURSIVE_CTE_NODE" ; |
882 | default: |
883 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
884 | } |
885 | } |
886 | |
887 | template <> |
888 | QueryNodeType EnumUtil::FromString<QueryNodeType>(const char *value) { |
889 | if (StringUtil::Equals(s1: value, s2: "SELECT_NODE" )) { |
890 | return QueryNodeType::SELECT_NODE; |
891 | } |
892 | if (StringUtil::Equals(s1: value, s2: "SET_OPERATION_NODE" )) { |
893 | return QueryNodeType::SET_OPERATION_NODE; |
894 | } |
895 | if (StringUtil::Equals(s1: value, s2: "BOUND_SUBQUERY_NODE" )) { |
896 | return QueryNodeType::BOUND_SUBQUERY_NODE; |
897 | } |
898 | if (StringUtil::Equals(s1: value, s2: "RECURSIVE_CTE_NODE" )) { |
899 | return QueryNodeType::RECURSIVE_CTE_NODE; |
900 | } |
901 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
902 | } |
903 | |
904 | template <> |
905 | const char *EnumUtil::ToChars<SequenceInfo>(SequenceInfo value) { |
906 | switch (value) { |
907 | case SequenceInfo::SEQ_START: |
908 | return "SEQ_START" ; |
909 | case SequenceInfo::SEQ_INC: |
910 | return "SEQ_INC" ; |
911 | case SequenceInfo::SEQ_MIN: |
912 | return "SEQ_MIN" ; |
913 | case SequenceInfo::SEQ_MAX: |
914 | return "SEQ_MAX" ; |
915 | case SequenceInfo::SEQ_CYCLE: |
916 | return "SEQ_CYCLE" ; |
917 | case SequenceInfo::SEQ_OWN: |
918 | return "SEQ_OWN" ; |
919 | default: |
920 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
921 | } |
922 | } |
923 | |
924 | template <> |
925 | SequenceInfo EnumUtil::FromString<SequenceInfo>(const char *value) { |
926 | if (StringUtil::Equals(s1: value, s2: "SEQ_START" )) { |
927 | return SequenceInfo::SEQ_START; |
928 | } |
929 | if (StringUtil::Equals(s1: value, s2: "SEQ_INC" )) { |
930 | return SequenceInfo::SEQ_INC; |
931 | } |
932 | if (StringUtil::Equals(s1: value, s2: "SEQ_MIN" )) { |
933 | return SequenceInfo::SEQ_MIN; |
934 | } |
935 | if (StringUtil::Equals(s1: value, s2: "SEQ_MAX" )) { |
936 | return SequenceInfo::SEQ_MAX; |
937 | } |
938 | if (StringUtil::Equals(s1: value, s2: "SEQ_CYCLE" )) { |
939 | return SequenceInfo::SEQ_CYCLE; |
940 | } |
941 | if (StringUtil::Equals(s1: value, s2: "SEQ_OWN" )) { |
942 | return SequenceInfo::SEQ_OWN; |
943 | } |
944 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
945 | } |
946 | |
947 | template <> |
948 | const char *EnumUtil::ToChars<AlterScalarFunctionType>(AlterScalarFunctionType value) { |
949 | switch (value) { |
950 | case AlterScalarFunctionType::INVALID: |
951 | return "INVALID" ; |
952 | case AlterScalarFunctionType::ADD_FUNCTION_OVERLOADS: |
953 | return "ADD_FUNCTION_OVERLOADS" ; |
954 | default: |
955 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
956 | } |
957 | } |
958 | |
959 | template <> |
960 | AlterScalarFunctionType EnumUtil::FromString<AlterScalarFunctionType>(const char *value) { |
961 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
962 | return AlterScalarFunctionType::INVALID; |
963 | } |
964 | if (StringUtil::Equals(s1: value, s2: "ADD_FUNCTION_OVERLOADS" )) { |
965 | return AlterScalarFunctionType::ADD_FUNCTION_OVERLOADS; |
966 | } |
967 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
968 | } |
969 | |
970 | template <> |
971 | const char *EnumUtil::ToChars<AlterTableType>(AlterTableType value) { |
972 | switch (value) { |
973 | case AlterTableType::INVALID: |
974 | return "INVALID" ; |
975 | case AlterTableType::RENAME_COLUMN: |
976 | return "RENAME_COLUMN" ; |
977 | case AlterTableType::RENAME_TABLE: |
978 | return "RENAME_TABLE" ; |
979 | case AlterTableType::ADD_COLUMN: |
980 | return "ADD_COLUMN" ; |
981 | case AlterTableType::REMOVE_COLUMN: |
982 | return "REMOVE_COLUMN" ; |
983 | case AlterTableType::ALTER_COLUMN_TYPE: |
984 | return "ALTER_COLUMN_TYPE" ; |
985 | case AlterTableType::SET_DEFAULT: |
986 | return "SET_DEFAULT" ; |
987 | case AlterTableType::FOREIGN_KEY_CONSTRAINT: |
988 | return "FOREIGN_KEY_CONSTRAINT" ; |
989 | case AlterTableType::SET_NOT_NULL: |
990 | return "SET_NOT_NULL" ; |
991 | case AlterTableType::DROP_NOT_NULL: |
992 | return "DROP_NOT_NULL" ; |
993 | default: |
994 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
995 | } |
996 | } |
997 | |
998 | template <> |
999 | AlterTableType EnumUtil::FromString<AlterTableType>(const char *value) { |
1000 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1001 | return AlterTableType::INVALID; |
1002 | } |
1003 | if (StringUtil::Equals(s1: value, s2: "RENAME_COLUMN" )) { |
1004 | return AlterTableType::RENAME_COLUMN; |
1005 | } |
1006 | if (StringUtil::Equals(s1: value, s2: "RENAME_TABLE" )) { |
1007 | return AlterTableType::RENAME_TABLE; |
1008 | } |
1009 | if (StringUtil::Equals(s1: value, s2: "ADD_COLUMN" )) { |
1010 | return AlterTableType::ADD_COLUMN; |
1011 | } |
1012 | if (StringUtil::Equals(s1: value, s2: "REMOVE_COLUMN" )) { |
1013 | return AlterTableType::REMOVE_COLUMN; |
1014 | } |
1015 | if (StringUtil::Equals(s1: value, s2: "ALTER_COLUMN_TYPE" )) { |
1016 | return AlterTableType::ALTER_COLUMN_TYPE; |
1017 | } |
1018 | if (StringUtil::Equals(s1: value, s2: "SET_DEFAULT" )) { |
1019 | return AlterTableType::SET_DEFAULT; |
1020 | } |
1021 | if (StringUtil::Equals(s1: value, s2: "FOREIGN_KEY_CONSTRAINT" )) { |
1022 | return AlterTableType::FOREIGN_KEY_CONSTRAINT; |
1023 | } |
1024 | if (StringUtil::Equals(s1: value, s2: "SET_NOT_NULL" )) { |
1025 | return AlterTableType::SET_NOT_NULL; |
1026 | } |
1027 | if (StringUtil::Equals(s1: value, s2: "DROP_NOT_NULL" )) { |
1028 | return AlterTableType::DROP_NOT_NULL; |
1029 | } |
1030 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1031 | } |
1032 | |
1033 | template <> |
1034 | const char *EnumUtil::ToChars<AlterViewType>(AlterViewType value) { |
1035 | switch (value) { |
1036 | case AlterViewType::INVALID: |
1037 | return "INVALID" ; |
1038 | case AlterViewType::RENAME_VIEW: |
1039 | return "RENAME_VIEW" ; |
1040 | default: |
1041 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1042 | } |
1043 | } |
1044 | |
1045 | template <> |
1046 | AlterViewType EnumUtil::FromString<AlterViewType>(const char *value) { |
1047 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1048 | return AlterViewType::INVALID; |
1049 | } |
1050 | if (StringUtil::Equals(s1: value, s2: "RENAME_VIEW" )) { |
1051 | return AlterViewType::RENAME_VIEW; |
1052 | } |
1053 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1054 | } |
1055 | |
1056 | template <> |
1057 | const char *EnumUtil::ToChars<AlterTableFunctionType>(AlterTableFunctionType value) { |
1058 | switch (value) { |
1059 | case AlterTableFunctionType::INVALID: |
1060 | return "INVALID" ; |
1061 | case AlterTableFunctionType::ADD_FUNCTION_OVERLOADS: |
1062 | return "ADD_FUNCTION_OVERLOADS" ; |
1063 | default: |
1064 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1065 | } |
1066 | } |
1067 | |
1068 | template <> |
1069 | AlterTableFunctionType EnumUtil::FromString<AlterTableFunctionType>(const char *value) { |
1070 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1071 | return AlterTableFunctionType::INVALID; |
1072 | } |
1073 | if (StringUtil::Equals(s1: value, s2: "ADD_FUNCTION_OVERLOADS" )) { |
1074 | return AlterTableFunctionType::ADD_FUNCTION_OVERLOADS; |
1075 | } |
1076 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1077 | } |
1078 | |
1079 | template <> |
1080 | const char *EnumUtil::ToChars<AlterType>(AlterType value) { |
1081 | switch (value) { |
1082 | case AlterType::INVALID: |
1083 | return "INVALID" ; |
1084 | case AlterType::ALTER_TABLE: |
1085 | return "ALTER_TABLE" ; |
1086 | case AlterType::ALTER_VIEW: |
1087 | return "ALTER_VIEW" ; |
1088 | case AlterType::ALTER_SEQUENCE: |
1089 | return "ALTER_SEQUENCE" ; |
1090 | case AlterType::CHANGE_OWNERSHIP: |
1091 | return "CHANGE_OWNERSHIP" ; |
1092 | case AlterType::ALTER_SCALAR_FUNCTION: |
1093 | return "ALTER_SCALAR_FUNCTION" ; |
1094 | case AlterType::ALTER_TABLE_FUNCTION: |
1095 | return "ALTER_TABLE_FUNCTION" ; |
1096 | default: |
1097 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1098 | } |
1099 | } |
1100 | |
1101 | template <> |
1102 | AlterType EnumUtil::FromString<AlterType>(const char *value) { |
1103 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1104 | return AlterType::INVALID; |
1105 | } |
1106 | if (StringUtil::Equals(s1: value, s2: "ALTER_TABLE" )) { |
1107 | return AlterType::ALTER_TABLE; |
1108 | } |
1109 | if (StringUtil::Equals(s1: value, s2: "ALTER_VIEW" )) { |
1110 | return AlterType::ALTER_VIEW; |
1111 | } |
1112 | if (StringUtil::Equals(s1: value, s2: "ALTER_SEQUENCE" )) { |
1113 | return AlterType::ALTER_SEQUENCE; |
1114 | } |
1115 | if (StringUtil::Equals(s1: value, s2: "CHANGE_OWNERSHIP" )) { |
1116 | return AlterType::CHANGE_OWNERSHIP; |
1117 | } |
1118 | if (StringUtil::Equals(s1: value, s2: "ALTER_SCALAR_FUNCTION" )) { |
1119 | return AlterType::ALTER_SCALAR_FUNCTION; |
1120 | } |
1121 | if (StringUtil::Equals(s1: value, s2: "ALTER_TABLE_FUNCTION" )) { |
1122 | return AlterType::ALTER_TABLE_FUNCTION; |
1123 | } |
1124 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1125 | } |
1126 | |
1127 | template <> |
1128 | const char *EnumUtil::ToChars<PragmaType>(PragmaType value) { |
1129 | switch (value) { |
1130 | case PragmaType::PRAGMA_STATEMENT: |
1131 | return "PRAGMA_STATEMENT" ; |
1132 | case PragmaType::PRAGMA_CALL: |
1133 | return "PRAGMA_CALL" ; |
1134 | default: |
1135 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1136 | } |
1137 | } |
1138 | |
1139 | template <> |
1140 | PragmaType EnumUtil::FromString<PragmaType>(const char *value) { |
1141 | if (StringUtil::Equals(s1: value, s2: "PRAGMA_STATEMENT" )) { |
1142 | return PragmaType::PRAGMA_STATEMENT; |
1143 | } |
1144 | if (StringUtil::Equals(s1: value, s2: "PRAGMA_CALL" )) { |
1145 | return PragmaType::PRAGMA_CALL; |
1146 | } |
1147 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1148 | } |
1149 | |
1150 | template <> |
1151 | const char *EnumUtil::ToChars<OnCreateConflict>(OnCreateConflict value) { |
1152 | switch (value) { |
1153 | case OnCreateConflict::ERROR_ON_CONFLICT: |
1154 | return "ERROR_ON_CONFLICT" ; |
1155 | case OnCreateConflict::IGNORE_ON_CONFLICT: |
1156 | return "IGNORE_ON_CONFLICT" ; |
1157 | case OnCreateConflict::REPLACE_ON_CONFLICT: |
1158 | return "REPLACE_ON_CONFLICT" ; |
1159 | case OnCreateConflict::ALTER_ON_CONFLICT: |
1160 | return "ALTER_ON_CONFLICT" ; |
1161 | default: |
1162 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1163 | } |
1164 | } |
1165 | |
1166 | template <> |
1167 | OnCreateConflict EnumUtil::FromString<OnCreateConflict>(const char *value) { |
1168 | if (StringUtil::Equals(s1: value, s2: "ERROR_ON_CONFLICT" )) { |
1169 | return OnCreateConflict::ERROR_ON_CONFLICT; |
1170 | } |
1171 | if (StringUtil::Equals(s1: value, s2: "IGNORE_ON_CONFLICT" )) { |
1172 | return OnCreateConflict::IGNORE_ON_CONFLICT; |
1173 | } |
1174 | if (StringUtil::Equals(s1: value, s2: "REPLACE_ON_CONFLICT" )) { |
1175 | return OnCreateConflict::REPLACE_ON_CONFLICT; |
1176 | } |
1177 | if (StringUtil::Equals(s1: value, s2: "ALTER_ON_CONFLICT" )) { |
1178 | return OnCreateConflict::ALTER_ON_CONFLICT; |
1179 | } |
1180 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1181 | } |
1182 | |
1183 | template <> |
1184 | const char *EnumUtil::ToChars<TransactionType>(TransactionType value) { |
1185 | switch (value) { |
1186 | case TransactionType::INVALID: |
1187 | return "INVALID" ; |
1188 | case TransactionType::BEGIN_TRANSACTION: |
1189 | return "BEGIN_TRANSACTION" ; |
1190 | case TransactionType::COMMIT: |
1191 | return "COMMIT" ; |
1192 | case TransactionType::ROLLBACK: |
1193 | return "ROLLBACK" ; |
1194 | default: |
1195 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1196 | } |
1197 | } |
1198 | |
1199 | template <> |
1200 | TransactionType EnumUtil::FromString<TransactionType>(const char *value) { |
1201 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1202 | return TransactionType::INVALID; |
1203 | } |
1204 | if (StringUtil::Equals(s1: value, s2: "BEGIN_TRANSACTION" )) { |
1205 | return TransactionType::BEGIN_TRANSACTION; |
1206 | } |
1207 | if (StringUtil::Equals(s1: value, s2: "COMMIT" )) { |
1208 | return TransactionType::COMMIT; |
1209 | } |
1210 | if (StringUtil::Equals(s1: value, s2: "ROLLBACK" )) { |
1211 | return TransactionType::ROLLBACK; |
1212 | } |
1213 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1214 | } |
1215 | |
1216 | template <> |
1217 | const char *EnumUtil::ToChars<SampleMethod>(SampleMethod value) { |
1218 | switch (value) { |
1219 | case SampleMethod::SYSTEM_SAMPLE: |
1220 | return "System" ; |
1221 | case SampleMethod::BERNOULLI_SAMPLE: |
1222 | return "Bernoulli" ; |
1223 | case SampleMethod::RESERVOIR_SAMPLE: |
1224 | return "Reservoir" ; |
1225 | default: |
1226 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1227 | } |
1228 | } |
1229 | |
1230 | template <> |
1231 | SampleMethod EnumUtil::FromString<SampleMethod>(const char *value) { |
1232 | if (StringUtil::Equals(s1: value, s2: "System" )) { |
1233 | return SampleMethod::SYSTEM_SAMPLE; |
1234 | } |
1235 | if (StringUtil::Equals(s1: value, s2: "Bernoulli" )) { |
1236 | return SampleMethod::BERNOULLI_SAMPLE; |
1237 | } |
1238 | if (StringUtil::Equals(s1: value, s2: "Reservoir" )) { |
1239 | return SampleMethod::RESERVOIR_SAMPLE; |
1240 | } |
1241 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1242 | } |
1243 | |
1244 | template <> |
1245 | const char *EnumUtil::ToChars<ExplainType>(ExplainType value) { |
1246 | switch (value) { |
1247 | case ExplainType::EXPLAIN_STANDARD: |
1248 | return "EXPLAIN_STANDARD" ; |
1249 | case ExplainType::EXPLAIN_ANALYZE: |
1250 | return "EXPLAIN_ANALYZE" ; |
1251 | default: |
1252 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1253 | } |
1254 | } |
1255 | |
1256 | template <> |
1257 | ExplainType EnumUtil::FromString<ExplainType>(const char *value) { |
1258 | if (StringUtil::Equals(s1: value, s2: "EXPLAIN_STANDARD" )) { |
1259 | return ExplainType::EXPLAIN_STANDARD; |
1260 | } |
1261 | if (StringUtil::Equals(s1: value, s2: "EXPLAIN_ANALYZE" )) { |
1262 | return ExplainType::EXPLAIN_ANALYZE; |
1263 | } |
1264 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1265 | } |
1266 | |
1267 | template <> |
1268 | const char *EnumUtil::ToChars<OnConflictAction>(OnConflictAction value) { |
1269 | switch (value) { |
1270 | case OnConflictAction::THROW: |
1271 | return "THROW" ; |
1272 | case OnConflictAction::NOTHING: |
1273 | return "NOTHING" ; |
1274 | case OnConflictAction::UPDATE: |
1275 | return "UPDATE" ; |
1276 | case OnConflictAction::REPLACE: |
1277 | return "REPLACE" ; |
1278 | default: |
1279 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1280 | } |
1281 | } |
1282 | |
1283 | template <> |
1284 | OnConflictAction EnumUtil::FromString<OnConflictAction>(const char *value) { |
1285 | if (StringUtil::Equals(s1: value, s2: "THROW" )) { |
1286 | return OnConflictAction::THROW; |
1287 | } |
1288 | if (StringUtil::Equals(s1: value, s2: "NOTHING" )) { |
1289 | return OnConflictAction::NOTHING; |
1290 | } |
1291 | if (StringUtil::Equals(s1: value, s2: "UPDATE" )) { |
1292 | return OnConflictAction::UPDATE; |
1293 | } |
1294 | if (StringUtil::Equals(s1: value, s2: "REPLACE" )) { |
1295 | return OnConflictAction::REPLACE; |
1296 | } |
1297 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1298 | } |
1299 | |
1300 | template <> |
1301 | const char *EnumUtil::ToChars<WindowBoundary>(WindowBoundary value) { |
1302 | switch (value) { |
1303 | case WindowBoundary::INVALID: |
1304 | return "INVALID" ; |
1305 | case WindowBoundary::UNBOUNDED_PRECEDING: |
1306 | return "UNBOUNDED_PRECEDING" ; |
1307 | case WindowBoundary::UNBOUNDED_FOLLOWING: |
1308 | return "UNBOUNDED_FOLLOWING" ; |
1309 | case WindowBoundary::CURRENT_ROW_RANGE: |
1310 | return "CURRENT_ROW_RANGE" ; |
1311 | case WindowBoundary::CURRENT_ROW_ROWS: |
1312 | return "CURRENT_ROW_ROWS" ; |
1313 | case WindowBoundary::EXPR_PRECEDING_ROWS: |
1314 | return "EXPR_PRECEDING_ROWS" ; |
1315 | case WindowBoundary::EXPR_FOLLOWING_ROWS: |
1316 | return "EXPR_FOLLOWING_ROWS" ; |
1317 | case WindowBoundary::EXPR_PRECEDING_RANGE: |
1318 | return "EXPR_PRECEDING_RANGE" ; |
1319 | case WindowBoundary::EXPR_FOLLOWING_RANGE: |
1320 | return "EXPR_FOLLOWING_RANGE" ; |
1321 | default: |
1322 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1323 | } |
1324 | } |
1325 | |
1326 | template <> |
1327 | WindowBoundary EnumUtil::FromString<WindowBoundary>(const char *value) { |
1328 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1329 | return WindowBoundary::INVALID; |
1330 | } |
1331 | if (StringUtil::Equals(s1: value, s2: "UNBOUNDED_PRECEDING" )) { |
1332 | return WindowBoundary::UNBOUNDED_PRECEDING; |
1333 | } |
1334 | if (StringUtil::Equals(s1: value, s2: "UNBOUNDED_FOLLOWING" )) { |
1335 | return WindowBoundary::UNBOUNDED_FOLLOWING; |
1336 | } |
1337 | if (StringUtil::Equals(s1: value, s2: "CURRENT_ROW_RANGE" )) { |
1338 | return WindowBoundary::CURRENT_ROW_RANGE; |
1339 | } |
1340 | if (StringUtil::Equals(s1: value, s2: "CURRENT_ROW_ROWS" )) { |
1341 | return WindowBoundary::CURRENT_ROW_ROWS; |
1342 | } |
1343 | if (StringUtil::Equals(s1: value, s2: "EXPR_PRECEDING_ROWS" )) { |
1344 | return WindowBoundary::EXPR_PRECEDING_ROWS; |
1345 | } |
1346 | if (StringUtil::Equals(s1: value, s2: "EXPR_FOLLOWING_ROWS" )) { |
1347 | return WindowBoundary::EXPR_FOLLOWING_ROWS; |
1348 | } |
1349 | if (StringUtil::Equals(s1: value, s2: "EXPR_PRECEDING_RANGE" )) { |
1350 | return WindowBoundary::EXPR_PRECEDING_RANGE; |
1351 | } |
1352 | if (StringUtil::Equals(s1: value, s2: "EXPR_FOLLOWING_RANGE" )) { |
1353 | return WindowBoundary::EXPR_FOLLOWING_RANGE; |
1354 | } |
1355 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1356 | } |
1357 | |
1358 | template <> |
1359 | const char *EnumUtil::ToChars<DataFileType>(DataFileType value) { |
1360 | switch (value) { |
1361 | case DataFileType::FILE_DOES_NOT_EXIST: |
1362 | return "FILE_DOES_NOT_EXIST" ; |
1363 | case DataFileType::DUCKDB_FILE: |
1364 | return "DUCKDB_FILE" ; |
1365 | case DataFileType::SQLITE_FILE: |
1366 | return "SQLITE_FILE" ; |
1367 | case DataFileType::PARQUET_FILE: |
1368 | return "PARQUET_FILE" ; |
1369 | default: |
1370 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1371 | } |
1372 | } |
1373 | |
1374 | template <> |
1375 | DataFileType EnumUtil::FromString<DataFileType>(const char *value) { |
1376 | if (StringUtil::Equals(s1: value, s2: "FILE_DOES_NOT_EXIST" )) { |
1377 | return DataFileType::FILE_DOES_NOT_EXIST; |
1378 | } |
1379 | if (StringUtil::Equals(s1: value, s2: "DUCKDB_FILE" )) { |
1380 | return DataFileType::DUCKDB_FILE; |
1381 | } |
1382 | if (StringUtil::Equals(s1: value, s2: "SQLITE_FILE" )) { |
1383 | return DataFileType::SQLITE_FILE; |
1384 | } |
1385 | if (StringUtil::Equals(s1: value, s2: "PARQUET_FILE" )) { |
1386 | return DataFileType::PARQUET_FILE; |
1387 | } |
1388 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1389 | } |
1390 | |
1391 | template <> |
1392 | const char *EnumUtil::ToChars<StatsInfo>(StatsInfo value) { |
1393 | switch (value) { |
1394 | case StatsInfo::CAN_HAVE_NULL_VALUES: |
1395 | return "CAN_HAVE_NULL_VALUES" ; |
1396 | case StatsInfo::CANNOT_HAVE_NULL_VALUES: |
1397 | return "CANNOT_HAVE_NULL_VALUES" ; |
1398 | case StatsInfo::CAN_HAVE_VALID_VALUES: |
1399 | return "CAN_HAVE_VALID_VALUES" ; |
1400 | case StatsInfo::CANNOT_HAVE_VALID_VALUES: |
1401 | return "CANNOT_HAVE_VALID_VALUES" ; |
1402 | case StatsInfo::CAN_HAVE_NULL_AND_VALID_VALUES: |
1403 | return "CAN_HAVE_NULL_AND_VALID_VALUES" ; |
1404 | default: |
1405 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1406 | } |
1407 | } |
1408 | |
1409 | template <> |
1410 | StatsInfo EnumUtil::FromString<StatsInfo>(const char *value) { |
1411 | if (StringUtil::Equals(s1: value, s2: "CAN_HAVE_NULL_VALUES" )) { |
1412 | return StatsInfo::CAN_HAVE_NULL_VALUES; |
1413 | } |
1414 | if (StringUtil::Equals(s1: value, s2: "CANNOT_HAVE_NULL_VALUES" )) { |
1415 | return StatsInfo::CANNOT_HAVE_NULL_VALUES; |
1416 | } |
1417 | if (StringUtil::Equals(s1: value, s2: "CAN_HAVE_VALID_VALUES" )) { |
1418 | return StatsInfo::CAN_HAVE_VALID_VALUES; |
1419 | } |
1420 | if (StringUtil::Equals(s1: value, s2: "CANNOT_HAVE_VALID_VALUES" )) { |
1421 | return StatsInfo::CANNOT_HAVE_VALID_VALUES; |
1422 | } |
1423 | if (StringUtil::Equals(s1: value, s2: "CAN_HAVE_NULL_AND_VALID_VALUES" )) { |
1424 | return StatsInfo::CAN_HAVE_NULL_AND_VALID_VALUES; |
1425 | } |
1426 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1427 | } |
1428 | |
1429 | template <> |
1430 | const char *EnumUtil::ToChars<StatisticsType>(StatisticsType value) { |
1431 | switch (value) { |
1432 | case StatisticsType::NUMERIC_STATS: |
1433 | return "NUMERIC_STATS" ; |
1434 | case StatisticsType::STRING_STATS: |
1435 | return "STRING_STATS" ; |
1436 | case StatisticsType::LIST_STATS: |
1437 | return "LIST_STATS" ; |
1438 | case StatisticsType::STRUCT_STATS: |
1439 | return "STRUCT_STATS" ; |
1440 | case StatisticsType::BASE_STATS: |
1441 | return "BASE_STATS" ; |
1442 | default: |
1443 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1444 | } |
1445 | } |
1446 | |
1447 | template <> |
1448 | StatisticsType EnumUtil::FromString<StatisticsType>(const char *value) { |
1449 | if (StringUtil::Equals(s1: value, s2: "NUMERIC_STATS" )) { |
1450 | return StatisticsType::NUMERIC_STATS; |
1451 | } |
1452 | if (StringUtil::Equals(s1: value, s2: "STRING_STATS" )) { |
1453 | return StatisticsType::STRING_STATS; |
1454 | } |
1455 | if (StringUtil::Equals(s1: value, s2: "LIST_STATS" )) { |
1456 | return StatisticsType::LIST_STATS; |
1457 | } |
1458 | if (StringUtil::Equals(s1: value, s2: "STRUCT_STATS" )) { |
1459 | return StatisticsType::STRUCT_STATS; |
1460 | } |
1461 | if (StringUtil::Equals(s1: value, s2: "BASE_STATS" )) { |
1462 | return StatisticsType::BASE_STATS; |
1463 | } |
1464 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1465 | } |
1466 | |
1467 | template <> |
1468 | const char *EnumUtil::ToChars<ColumnSegmentType>(ColumnSegmentType value) { |
1469 | switch (value) { |
1470 | case ColumnSegmentType::TRANSIENT: |
1471 | return "TRANSIENT" ; |
1472 | case ColumnSegmentType::PERSISTENT: |
1473 | return "PERSISTENT" ; |
1474 | default: |
1475 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1476 | } |
1477 | } |
1478 | |
1479 | template <> |
1480 | ColumnSegmentType EnumUtil::FromString<ColumnSegmentType>(const char *value) { |
1481 | if (StringUtil::Equals(s1: value, s2: "TRANSIENT" )) { |
1482 | return ColumnSegmentType::TRANSIENT; |
1483 | } |
1484 | if (StringUtil::Equals(s1: value, s2: "PERSISTENT" )) { |
1485 | return ColumnSegmentType::PERSISTENT; |
1486 | } |
1487 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1488 | } |
1489 | |
1490 | template <> |
1491 | const char *EnumUtil::ToChars<ChunkInfoType>(ChunkInfoType value) { |
1492 | switch (value) { |
1493 | case ChunkInfoType::CONSTANT_INFO: |
1494 | return "CONSTANT_INFO" ; |
1495 | case ChunkInfoType::VECTOR_INFO: |
1496 | return "VECTOR_INFO" ; |
1497 | case ChunkInfoType::EMPTY_INFO: |
1498 | return "EMPTY_INFO" ; |
1499 | default: |
1500 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1501 | } |
1502 | } |
1503 | |
1504 | template <> |
1505 | ChunkInfoType EnumUtil::FromString<ChunkInfoType>(const char *value) { |
1506 | if (StringUtil::Equals(s1: value, s2: "CONSTANT_INFO" )) { |
1507 | return ChunkInfoType::CONSTANT_INFO; |
1508 | } |
1509 | if (StringUtil::Equals(s1: value, s2: "VECTOR_INFO" )) { |
1510 | return ChunkInfoType::VECTOR_INFO; |
1511 | } |
1512 | if (StringUtil::Equals(s1: value, s2: "EMPTY_INFO" )) { |
1513 | return ChunkInfoType::EMPTY_INFO; |
1514 | } |
1515 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1516 | } |
1517 | |
1518 | template <> |
1519 | const char *EnumUtil::ToChars<BitpackingMode>(BitpackingMode value) { |
1520 | switch (value) { |
1521 | case BitpackingMode::AUTO: |
1522 | return "AUTO" ; |
1523 | case BitpackingMode::CONSTANT: |
1524 | return "CONSTANT" ; |
1525 | case BitpackingMode::CONSTANT_DELTA: |
1526 | return "CONSTANT_DELTA" ; |
1527 | case BitpackingMode::DELTA_FOR: |
1528 | return "DELTA_FOR" ; |
1529 | case BitpackingMode::FOR: |
1530 | return "FOR" ; |
1531 | default: |
1532 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1533 | } |
1534 | } |
1535 | |
1536 | template <> |
1537 | BitpackingMode EnumUtil::FromString<BitpackingMode>(const char *value) { |
1538 | if (StringUtil::Equals(s1: value, s2: "AUTO" )) { |
1539 | return BitpackingMode::AUTO; |
1540 | } |
1541 | if (StringUtil::Equals(s1: value, s2: "CONSTANT" )) { |
1542 | return BitpackingMode::CONSTANT; |
1543 | } |
1544 | if (StringUtil::Equals(s1: value, s2: "CONSTANT_DELTA" )) { |
1545 | return BitpackingMode::CONSTANT_DELTA; |
1546 | } |
1547 | if (StringUtil::Equals(s1: value, s2: "DELTA_FOR" )) { |
1548 | return BitpackingMode::DELTA_FOR; |
1549 | } |
1550 | if (StringUtil::Equals(s1: value, s2: "FOR" )) { |
1551 | return BitpackingMode::FOR; |
1552 | } |
1553 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1554 | } |
1555 | |
1556 | template <> |
1557 | const char *EnumUtil::ToChars<BlockState>(BlockState value) { |
1558 | switch (value) { |
1559 | case BlockState::BLOCK_UNLOADED: |
1560 | return "BLOCK_UNLOADED" ; |
1561 | case BlockState::BLOCK_LOADED: |
1562 | return "BLOCK_LOADED" ; |
1563 | default: |
1564 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1565 | } |
1566 | } |
1567 | |
1568 | template <> |
1569 | BlockState EnumUtil::FromString<BlockState>(const char *value) { |
1570 | if (StringUtil::Equals(s1: value, s2: "BLOCK_UNLOADED" )) { |
1571 | return BlockState::BLOCK_UNLOADED; |
1572 | } |
1573 | if (StringUtil::Equals(s1: value, s2: "BLOCK_LOADED" )) { |
1574 | return BlockState::BLOCK_LOADED; |
1575 | } |
1576 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1577 | } |
1578 | |
1579 | template <> |
1580 | const char *EnumUtil::ToChars<VerificationType>(VerificationType value) { |
1581 | switch (value) { |
1582 | case VerificationType::ORIGINAL: |
1583 | return "ORIGINAL" ; |
1584 | case VerificationType::COPIED: |
1585 | return "COPIED" ; |
1586 | case VerificationType::DESERIALIZED: |
1587 | return "DESERIALIZED" ; |
1588 | case VerificationType::DESERIALIZED_V2: |
1589 | return "DESERIALIZED_V2" ; |
1590 | case VerificationType::PARSED: |
1591 | return "PARSED" ; |
1592 | case VerificationType::UNOPTIMIZED: |
1593 | return "UNOPTIMIZED" ; |
1594 | case VerificationType::NO_OPERATOR_CACHING: |
1595 | return "NO_OPERATOR_CACHING" ; |
1596 | case VerificationType::PREPARED: |
1597 | return "PREPARED" ; |
1598 | case VerificationType::EXTERNAL: |
1599 | return "EXTERNAL" ; |
1600 | case VerificationType::INVALID: |
1601 | return "INVALID" ; |
1602 | default: |
1603 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1604 | } |
1605 | } |
1606 | |
1607 | template <> |
1608 | VerificationType EnumUtil::FromString<VerificationType>(const char *value) { |
1609 | if (StringUtil::Equals(s1: value, s2: "ORIGINAL" )) { |
1610 | return VerificationType::ORIGINAL; |
1611 | } |
1612 | if (StringUtil::Equals(s1: value, s2: "COPIED" )) { |
1613 | return VerificationType::COPIED; |
1614 | } |
1615 | if (StringUtil::Equals(s1: value, s2: "DESERIALIZED" )) { |
1616 | return VerificationType::DESERIALIZED; |
1617 | } |
1618 | if (StringUtil::Equals(s1: value, s2: "DESERIALIZED_V2" )) { |
1619 | return VerificationType::DESERIALIZED_V2; |
1620 | } |
1621 | if (StringUtil::Equals(s1: value, s2: "PARSED" )) { |
1622 | return VerificationType::PARSED; |
1623 | } |
1624 | if (StringUtil::Equals(s1: value, s2: "UNOPTIMIZED" )) { |
1625 | return VerificationType::UNOPTIMIZED; |
1626 | } |
1627 | if (StringUtil::Equals(s1: value, s2: "NO_OPERATOR_CACHING" )) { |
1628 | return VerificationType::NO_OPERATOR_CACHING; |
1629 | } |
1630 | if (StringUtil::Equals(s1: value, s2: "PREPARED" )) { |
1631 | return VerificationType::PREPARED; |
1632 | } |
1633 | if (StringUtil::Equals(s1: value, s2: "EXTERNAL" )) { |
1634 | return VerificationType::EXTERNAL; |
1635 | } |
1636 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1637 | return VerificationType::INVALID; |
1638 | } |
1639 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1640 | } |
1641 | |
1642 | template <> |
1643 | const char *EnumUtil::ToChars<FileLockType>(FileLockType value) { |
1644 | switch (value) { |
1645 | case FileLockType::NO_LOCK: |
1646 | return "NO_LOCK" ; |
1647 | case FileLockType::READ_LOCK: |
1648 | return "READ_LOCK" ; |
1649 | case FileLockType::WRITE_LOCK: |
1650 | return "WRITE_LOCK" ; |
1651 | default: |
1652 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1653 | } |
1654 | } |
1655 | |
1656 | template <> |
1657 | FileLockType EnumUtil::FromString<FileLockType>(const char *value) { |
1658 | if (StringUtil::Equals(s1: value, s2: "NO_LOCK" )) { |
1659 | return FileLockType::NO_LOCK; |
1660 | } |
1661 | if (StringUtil::Equals(s1: value, s2: "READ_LOCK" )) { |
1662 | return FileLockType::READ_LOCK; |
1663 | } |
1664 | if (StringUtil::Equals(s1: value, s2: "WRITE_LOCK" )) { |
1665 | return FileLockType::WRITE_LOCK; |
1666 | } |
1667 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1668 | } |
1669 | |
1670 | template <> |
1671 | const char *EnumUtil::ToChars<FileBufferType>(FileBufferType value) { |
1672 | switch (value) { |
1673 | case FileBufferType::BLOCK: |
1674 | return "BLOCK" ; |
1675 | case FileBufferType::MANAGED_BUFFER: |
1676 | return "MANAGED_BUFFER" ; |
1677 | case FileBufferType::TINY_BUFFER: |
1678 | return "TINY_BUFFER" ; |
1679 | default: |
1680 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1681 | } |
1682 | } |
1683 | |
1684 | template <> |
1685 | FileBufferType EnumUtil::FromString<FileBufferType>(const char *value) { |
1686 | if (StringUtil::Equals(s1: value, s2: "BLOCK" )) { |
1687 | return FileBufferType::BLOCK; |
1688 | } |
1689 | if (StringUtil::Equals(s1: value, s2: "MANAGED_BUFFER" )) { |
1690 | return FileBufferType::MANAGED_BUFFER; |
1691 | } |
1692 | if (StringUtil::Equals(s1: value, s2: "TINY_BUFFER" )) { |
1693 | return FileBufferType::TINY_BUFFER; |
1694 | } |
1695 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1696 | } |
1697 | |
1698 | template <> |
1699 | const char *EnumUtil::ToChars<ExceptionFormatValueType>(ExceptionFormatValueType value) { |
1700 | switch (value) { |
1701 | case ExceptionFormatValueType::FORMAT_VALUE_TYPE_DOUBLE: |
1702 | return "FORMAT_VALUE_TYPE_DOUBLE" ; |
1703 | case ExceptionFormatValueType::FORMAT_VALUE_TYPE_INTEGER: |
1704 | return "FORMAT_VALUE_TYPE_INTEGER" ; |
1705 | case ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING: |
1706 | return "FORMAT_VALUE_TYPE_STRING" ; |
1707 | default: |
1708 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1709 | } |
1710 | } |
1711 | |
1712 | template <> |
1713 | ExceptionFormatValueType EnumUtil::FromString<ExceptionFormatValueType>(const char *value) { |
1714 | if (StringUtil::Equals(s1: value, s2: "FORMAT_VALUE_TYPE_DOUBLE" )) { |
1715 | return ExceptionFormatValueType::FORMAT_VALUE_TYPE_DOUBLE; |
1716 | } |
1717 | if (StringUtil::Equals(s1: value, s2: "FORMAT_VALUE_TYPE_INTEGER" )) { |
1718 | return ExceptionFormatValueType::FORMAT_VALUE_TYPE_INTEGER; |
1719 | } |
1720 | if (StringUtil::Equals(s1: value, s2: "FORMAT_VALUE_TYPE_STRING" )) { |
1721 | return ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING; |
1722 | } |
1723 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1724 | } |
1725 | |
1726 | template <> |
1727 | const char *EnumUtil::ToChars<ExtraTypeInfoType>(ExtraTypeInfoType value) { |
1728 | switch (value) { |
1729 | case ExtraTypeInfoType::INVALID_TYPE_INFO: |
1730 | return "INVALID_TYPE_INFO" ; |
1731 | case ExtraTypeInfoType::GENERIC_TYPE_INFO: |
1732 | return "GENERIC_TYPE_INFO" ; |
1733 | case ExtraTypeInfoType::DECIMAL_TYPE_INFO: |
1734 | return "DECIMAL_TYPE_INFO" ; |
1735 | case ExtraTypeInfoType::STRING_TYPE_INFO: |
1736 | return "STRING_TYPE_INFO" ; |
1737 | case ExtraTypeInfoType::LIST_TYPE_INFO: |
1738 | return "LIST_TYPE_INFO" ; |
1739 | case ExtraTypeInfoType::STRUCT_TYPE_INFO: |
1740 | return "STRUCT_TYPE_INFO" ; |
1741 | case ExtraTypeInfoType::ENUM_TYPE_INFO: |
1742 | return "ENUM_TYPE_INFO" ; |
1743 | case ExtraTypeInfoType::USER_TYPE_INFO: |
1744 | return "USER_TYPE_INFO" ; |
1745 | case ExtraTypeInfoType::AGGREGATE_STATE_TYPE_INFO: |
1746 | return "AGGREGATE_STATE_TYPE_INFO" ; |
1747 | default: |
1748 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1749 | } |
1750 | } |
1751 | |
1752 | template <> |
1753 | ExtraTypeInfoType EnumUtil::FromString<ExtraTypeInfoType>(const char *value) { |
1754 | if (StringUtil::Equals(s1: value, s2: "INVALID_TYPE_INFO" )) { |
1755 | return ExtraTypeInfoType::INVALID_TYPE_INFO; |
1756 | } |
1757 | if (StringUtil::Equals(s1: value, s2: "GENERIC_TYPE_INFO" )) { |
1758 | return ExtraTypeInfoType::GENERIC_TYPE_INFO; |
1759 | } |
1760 | if (StringUtil::Equals(s1: value, s2: "DECIMAL_TYPE_INFO" )) { |
1761 | return ExtraTypeInfoType::DECIMAL_TYPE_INFO; |
1762 | } |
1763 | if (StringUtil::Equals(s1: value, s2: "STRING_TYPE_INFO" )) { |
1764 | return ExtraTypeInfoType::STRING_TYPE_INFO; |
1765 | } |
1766 | if (StringUtil::Equals(s1: value, s2: "LIST_TYPE_INFO" )) { |
1767 | return ExtraTypeInfoType::LIST_TYPE_INFO; |
1768 | } |
1769 | if (StringUtil::Equals(s1: value, s2: "STRUCT_TYPE_INFO" )) { |
1770 | return ExtraTypeInfoType::STRUCT_TYPE_INFO; |
1771 | } |
1772 | if (StringUtil::Equals(s1: value, s2: "ENUM_TYPE_INFO" )) { |
1773 | return ExtraTypeInfoType::ENUM_TYPE_INFO; |
1774 | } |
1775 | if (StringUtil::Equals(s1: value, s2: "USER_TYPE_INFO" )) { |
1776 | return ExtraTypeInfoType::USER_TYPE_INFO; |
1777 | } |
1778 | if (StringUtil::Equals(s1: value, s2: "AGGREGATE_STATE_TYPE_INFO" )) { |
1779 | return ExtraTypeInfoType::AGGREGATE_STATE_TYPE_INFO; |
1780 | } |
1781 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1782 | } |
1783 | |
1784 | template <> |
1785 | const char *EnumUtil::ToChars<PhysicalType>(PhysicalType value) { |
1786 | switch (value) { |
1787 | case PhysicalType::BOOL: |
1788 | return "BOOL" ; |
1789 | case PhysicalType::UINT8: |
1790 | return "UINT8" ; |
1791 | case PhysicalType::INT8: |
1792 | return "INT8" ; |
1793 | case PhysicalType::UINT16: |
1794 | return "UINT16" ; |
1795 | case PhysicalType::INT16: |
1796 | return "INT16" ; |
1797 | case PhysicalType::UINT32: |
1798 | return "UINT32" ; |
1799 | case PhysicalType::INT32: |
1800 | return "INT32" ; |
1801 | case PhysicalType::UINT64: |
1802 | return "UINT64" ; |
1803 | case PhysicalType::INT64: |
1804 | return "INT64" ; |
1805 | case PhysicalType::FLOAT: |
1806 | return "FLOAT" ; |
1807 | case PhysicalType::DOUBLE: |
1808 | return "DOUBLE" ; |
1809 | case PhysicalType::INTERVAL: |
1810 | return "INTERVAL" ; |
1811 | case PhysicalType::LIST: |
1812 | return "LIST" ; |
1813 | case PhysicalType::STRUCT: |
1814 | return "STRUCT" ; |
1815 | case PhysicalType::VARCHAR: |
1816 | return "VARCHAR" ; |
1817 | case PhysicalType::INT128: |
1818 | return "INT128" ; |
1819 | case PhysicalType::UNKNOWN: |
1820 | return "UNKNOWN" ; |
1821 | case PhysicalType::BIT: |
1822 | return "BIT" ; |
1823 | case PhysicalType::INVALID: |
1824 | return "INVALID" ; |
1825 | default: |
1826 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1827 | } |
1828 | } |
1829 | |
1830 | template <> |
1831 | PhysicalType EnumUtil::FromString<PhysicalType>(const char *value) { |
1832 | if (StringUtil::Equals(s1: value, s2: "BOOL" )) { |
1833 | return PhysicalType::BOOL; |
1834 | } |
1835 | if (StringUtil::Equals(s1: value, s2: "UINT8" )) { |
1836 | return PhysicalType::UINT8; |
1837 | } |
1838 | if (StringUtil::Equals(s1: value, s2: "INT8" )) { |
1839 | return PhysicalType::INT8; |
1840 | } |
1841 | if (StringUtil::Equals(s1: value, s2: "UINT16" )) { |
1842 | return PhysicalType::UINT16; |
1843 | } |
1844 | if (StringUtil::Equals(s1: value, s2: "INT16" )) { |
1845 | return PhysicalType::INT16; |
1846 | } |
1847 | if (StringUtil::Equals(s1: value, s2: "UINT32" )) { |
1848 | return PhysicalType::UINT32; |
1849 | } |
1850 | if (StringUtil::Equals(s1: value, s2: "INT32" )) { |
1851 | return PhysicalType::INT32; |
1852 | } |
1853 | if (StringUtil::Equals(s1: value, s2: "UINT64" )) { |
1854 | return PhysicalType::UINT64; |
1855 | } |
1856 | if (StringUtil::Equals(s1: value, s2: "INT64" )) { |
1857 | return PhysicalType::INT64; |
1858 | } |
1859 | if (StringUtil::Equals(s1: value, s2: "FLOAT" )) { |
1860 | return PhysicalType::FLOAT; |
1861 | } |
1862 | if (StringUtil::Equals(s1: value, s2: "DOUBLE" )) { |
1863 | return PhysicalType::DOUBLE; |
1864 | } |
1865 | if (StringUtil::Equals(s1: value, s2: "INTERVAL" )) { |
1866 | return PhysicalType::INTERVAL; |
1867 | } |
1868 | if (StringUtil::Equals(s1: value, s2: "LIST" )) { |
1869 | return PhysicalType::LIST; |
1870 | } |
1871 | if (StringUtil::Equals(s1: value, s2: "STRUCT" )) { |
1872 | return PhysicalType::STRUCT; |
1873 | } |
1874 | if (StringUtil::Equals(s1: value, s2: "VARCHAR" )) { |
1875 | return PhysicalType::VARCHAR; |
1876 | } |
1877 | if (StringUtil::Equals(s1: value, s2: "INT128" )) { |
1878 | return PhysicalType::INT128; |
1879 | } |
1880 | if (StringUtil::Equals(s1: value, s2: "UNKNOWN" )) { |
1881 | return PhysicalType::UNKNOWN; |
1882 | } |
1883 | if (StringUtil::Equals(s1: value, s2: "BIT" )) { |
1884 | return PhysicalType::BIT; |
1885 | } |
1886 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1887 | return PhysicalType::INVALID; |
1888 | } |
1889 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
1890 | } |
1891 | |
1892 | template <> |
1893 | const char *EnumUtil::ToChars<LogicalTypeId>(LogicalTypeId value) { |
1894 | switch (value) { |
1895 | case LogicalTypeId::INVALID: |
1896 | return "INVALID" ; |
1897 | case LogicalTypeId::SQLNULL: |
1898 | return "NULL" ; |
1899 | case LogicalTypeId::UNKNOWN: |
1900 | return "UNKNOWN" ; |
1901 | case LogicalTypeId::ANY: |
1902 | return "ANY" ; |
1903 | case LogicalTypeId::USER: |
1904 | return "USER" ; |
1905 | case LogicalTypeId::BOOLEAN: |
1906 | return "BOOLEAN" ; |
1907 | case LogicalTypeId::TINYINT: |
1908 | return "TINYINT" ; |
1909 | case LogicalTypeId::SMALLINT: |
1910 | return "SMALLINT" ; |
1911 | case LogicalTypeId::INTEGER: |
1912 | return "INTEGER" ; |
1913 | case LogicalTypeId::BIGINT: |
1914 | return "BIGINT" ; |
1915 | case LogicalTypeId::DATE: |
1916 | return "DATE" ; |
1917 | case LogicalTypeId::TIME: |
1918 | return "TIME" ; |
1919 | case LogicalTypeId::TIMESTAMP_SEC: |
1920 | return "TIMESTAMP_S" ; |
1921 | case LogicalTypeId::TIMESTAMP_MS: |
1922 | return "TIMESTAMP_MS" ; |
1923 | case LogicalTypeId::TIMESTAMP: |
1924 | return "TIMESTAMP" ; |
1925 | case LogicalTypeId::TIMESTAMP_NS: |
1926 | return "TIMESTAMP_NS" ; |
1927 | case LogicalTypeId::DECIMAL: |
1928 | return "DECIMAL" ; |
1929 | case LogicalTypeId::FLOAT: |
1930 | return "FLOAT" ; |
1931 | case LogicalTypeId::DOUBLE: |
1932 | return "DOUBLE" ; |
1933 | case LogicalTypeId::CHAR: |
1934 | return "CHAR" ; |
1935 | case LogicalTypeId::VARCHAR: |
1936 | return "VARCHAR" ; |
1937 | case LogicalTypeId::BLOB: |
1938 | return "BLOB" ; |
1939 | case LogicalTypeId::INTERVAL: |
1940 | return "INTERVAL" ; |
1941 | case LogicalTypeId::UTINYINT: |
1942 | return "UTINYINT" ; |
1943 | case LogicalTypeId::USMALLINT: |
1944 | return "USMALLINT" ; |
1945 | case LogicalTypeId::UINTEGER: |
1946 | return "UINTEGER" ; |
1947 | case LogicalTypeId::UBIGINT: |
1948 | return "UBIGINT" ; |
1949 | case LogicalTypeId::TIMESTAMP_TZ: |
1950 | return "TIMESTAMP WITH TIME ZONE" ; |
1951 | case LogicalTypeId::TIME_TZ: |
1952 | return "TIME WITH TIME ZONE" ; |
1953 | case LogicalTypeId::BIT: |
1954 | return "BIT" ; |
1955 | case LogicalTypeId::HUGEINT: |
1956 | return "HUGEINT" ; |
1957 | case LogicalTypeId::POINTER: |
1958 | return "POINTER" ; |
1959 | case LogicalTypeId::VALIDITY: |
1960 | return "VALIDITY" ; |
1961 | case LogicalTypeId::UUID: |
1962 | return "UUID" ; |
1963 | case LogicalTypeId::STRUCT: |
1964 | return "STRUCT" ; |
1965 | case LogicalTypeId::LIST: |
1966 | return "LIST" ; |
1967 | case LogicalTypeId::MAP: |
1968 | return "MAP" ; |
1969 | case LogicalTypeId::TABLE: |
1970 | return "TABLE" ; |
1971 | case LogicalTypeId::ENUM: |
1972 | return "ENUM" ; |
1973 | case LogicalTypeId::AGGREGATE_STATE: |
1974 | return "AGGREGATE_STATE" ; |
1975 | case LogicalTypeId::LAMBDA: |
1976 | return "LAMBDA" ; |
1977 | case LogicalTypeId::UNION: |
1978 | return "UNION" ; |
1979 | default: |
1980 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
1981 | } |
1982 | } |
1983 | |
1984 | template <> |
1985 | LogicalTypeId EnumUtil::FromString<LogicalTypeId>(const char *value) { |
1986 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
1987 | return LogicalTypeId::INVALID; |
1988 | } |
1989 | if (StringUtil::Equals(s1: value, s2: "NULL" )) { |
1990 | return LogicalTypeId::SQLNULL; |
1991 | } |
1992 | if (StringUtil::Equals(s1: value, s2: "UNKNOWN" )) { |
1993 | return LogicalTypeId::UNKNOWN; |
1994 | } |
1995 | if (StringUtil::Equals(s1: value, s2: "ANY" )) { |
1996 | return LogicalTypeId::ANY; |
1997 | } |
1998 | if (StringUtil::Equals(s1: value, s2: "USER" )) { |
1999 | return LogicalTypeId::USER; |
2000 | } |
2001 | if (StringUtil::Equals(s1: value, s2: "BOOLEAN" )) { |
2002 | return LogicalTypeId::BOOLEAN; |
2003 | } |
2004 | if (StringUtil::Equals(s1: value, s2: "TINYINT" )) { |
2005 | return LogicalTypeId::TINYINT; |
2006 | } |
2007 | if (StringUtil::Equals(s1: value, s2: "SMALLINT" )) { |
2008 | return LogicalTypeId::SMALLINT; |
2009 | } |
2010 | if (StringUtil::Equals(s1: value, s2: "INTEGER" )) { |
2011 | return LogicalTypeId::INTEGER; |
2012 | } |
2013 | if (StringUtil::Equals(s1: value, s2: "BIGINT" )) { |
2014 | return LogicalTypeId::BIGINT; |
2015 | } |
2016 | if (StringUtil::Equals(s1: value, s2: "DATE" )) { |
2017 | return LogicalTypeId::DATE; |
2018 | } |
2019 | if (StringUtil::Equals(s1: value, s2: "TIME" )) { |
2020 | return LogicalTypeId::TIME; |
2021 | } |
2022 | if (StringUtil::Equals(s1: value, s2: "TIMESTAMP_S" )) { |
2023 | return LogicalTypeId::TIMESTAMP_SEC; |
2024 | } |
2025 | if (StringUtil::Equals(s1: value, s2: "TIMESTAMP_MS" )) { |
2026 | return LogicalTypeId::TIMESTAMP_MS; |
2027 | } |
2028 | if (StringUtil::Equals(s1: value, s2: "TIMESTAMP" )) { |
2029 | return LogicalTypeId::TIMESTAMP; |
2030 | } |
2031 | if (StringUtil::Equals(s1: value, s2: "TIMESTAMP_NS" )) { |
2032 | return LogicalTypeId::TIMESTAMP_NS; |
2033 | } |
2034 | if (StringUtil::Equals(s1: value, s2: "DECIMAL" )) { |
2035 | return LogicalTypeId::DECIMAL; |
2036 | } |
2037 | if (StringUtil::Equals(s1: value, s2: "FLOAT" )) { |
2038 | return LogicalTypeId::FLOAT; |
2039 | } |
2040 | if (StringUtil::Equals(s1: value, s2: "DOUBLE" )) { |
2041 | return LogicalTypeId::DOUBLE; |
2042 | } |
2043 | if (StringUtil::Equals(s1: value, s2: "CHAR" )) { |
2044 | return LogicalTypeId::CHAR; |
2045 | } |
2046 | if (StringUtil::Equals(s1: value, s2: "VARCHAR" )) { |
2047 | return LogicalTypeId::VARCHAR; |
2048 | } |
2049 | if (StringUtil::Equals(s1: value, s2: "BLOB" )) { |
2050 | return LogicalTypeId::BLOB; |
2051 | } |
2052 | if (StringUtil::Equals(s1: value, s2: "INTERVAL" )) { |
2053 | return LogicalTypeId::INTERVAL; |
2054 | } |
2055 | if (StringUtil::Equals(s1: value, s2: "UTINYINT" )) { |
2056 | return LogicalTypeId::UTINYINT; |
2057 | } |
2058 | if (StringUtil::Equals(s1: value, s2: "USMALLINT" )) { |
2059 | return LogicalTypeId::USMALLINT; |
2060 | } |
2061 | if (StringUtil::Equals(s1: value, s2: "UINTEGER" )) { |
2062 | return LogicalTypeId::UINTEGER; |
2063 | } |
2064 | if (StringUtil::Equals(s1: value, s2: "UBIGINT" )) { |
2065 | return LogicalTypeId::UBIGINT; |
2066 | } |
2067 | if (StringUtil::Equals(s1: value, s2: "TIMESTAMP WITH TIME ZONE" )) { |
2068 | return LogicalTypeId::TIMESTAMP_TZ; |
2069 | } |
2070 | if (StringUtil::Equals(s1: value, s2: "TIME WITH TIME ZONE" )) { |
2071 | return LogicalTypeId::TIME_TZ; |
2072 | } |
2073 | if (StringUtil::Equals(s1: value, s2: "BIT" )) { |
2074 | return LogicalTypeId::BIT; |
2075 | } |
2076 | if (StringUtil::Equals(s1: value, s2: "HUGEINT" )) { |
2077 | return LogicalTypeId::HUGEINT; |
2078 | } |
2079 | if (StringUtil::Equals(s1: value, s2: "POINTER" )) { |
2080 | return LogicalTypeId::POINTER; |
2081 | } |
2082 | if (StringUtil::Equals(s1: value, s2: "VALIDITY" )) { |
2083 | return LogicalTypeId::VALIDITY; |
2084 | } |
2085 | if (StringUtil::Equals(s1: value, s2: "UUID" )) { |
2086 | return LogicalTypeId::UUID; |
2087 | } |
2088 | if (StringUtil::Equals(s1: value, s2: "STRUCT" )) { |
2089 | return LogicalTypeId::STRUCT; |
2090 | } |
2091 | if (StringUtil::Equals(s1: value, s2: "LIST" )) { |
2092 | return LogicalTypeId::LIST; |
2093 | } |
2094 | if (StringUtil::Equals(s1: value, s2: "MAP" )) { |
2095 | return LogicalTypeId::MAP; |
2096 | } |
2097 | if (StringUtil::Equals(s1: value, s2: "TABLE" )) { |
2098 | return LogicalTypeId::TABLE; |
2099 | } |
2100 | if (StringUtil::Equals(s1: value, s2: "ENUM" )) { |
2101 | return LogicalTypeId::ENUM; |
2102 | } |
2103 | if (StringUtil::Equals(s1: value, s2: "AGGREGATE_STATE" )) { |
2104 | return LogicalTypeId::AGGREGATE_STATE; |
2105 | } |
2106 | if (StringUtil::Equals(s1: value, s2: "LAMBDA" )) { |
2107 | return LogicalTypeId::LAMBDA; |
2108 | } |
2109 | if (StringUtil::Equals(s1: value, s2: "UNION" )) { |
2110 | return LogicalTypeId::UNION; |
2111 | } |
2112 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2113 | } |
2114 | |
2115 | template <> |
2116 | const char *EnumUtil::ToChars<OutputStream>(OutputStream value) { |
2117 | switch (value) { |
2118 | case OutputStream::STREAM_STDOUT: |
2119 | return "STREAM_STDOUT" ; |
2120 | case OutputStream::STREAM_STDERR: |
2121 | return "STREAM_STDERR" ; |
2122 | default: |
2123 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2124 | } |
2125 | } |
2126 | |
2127 | template <> |
2128 | OutputStream EnumUtil::FromString<OutputStream>(const char *value) { |
2129 | if (StringUtil::Equals(s1: value, s2: "STREAM_STDOUT" )) { |
2130 | return OutputStream::STREAM_STDOUT; |
2131 | } |
2132 | if (StringUtil::Equals(s1: value, s2: "STREAM_STDERR" )) { |
2133 | return OutputStream::STREAM_STDERR; |
2134 | } |
2135 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2136 | } |
2137 | |
2138 | template <> |
2139 | const char *EnumUtil::ToChars<TimestampCastResult>(TimestampCastResult value) { |
2140 | switch (value) { |
2141 | case TimestampCastResult::SUCCESS: |
2142 | return "SUCCESS" ; |
2143 | case TimestampCastResult::ERROR_INCORRECT_FORMAT: |
2144 | return "ERROR_INCORRECT_FORMAT" ; |
2145 | case TimestampCastResult::ERROR_NON_UTC_TIMEZONE: |
2146 | return "ERROR_NON_UTC_TIMEZONE" ; |
2147 | default: |
2148 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2149 | } |
2150 | } |
2151 | |
2152 | template <> |
2153 | TimestampCastResult EnumUtil::FromString<TimestampCastResult>(const char *value) { |
2154 | if (StringUtil::Equals(s1: value, s2: "SUCCESS" )) { |
2155 | return TimestampCastResult::SUCCESS; |
2156 | } |
2157 | if (StringUtil::Equals(s1: value, s2: "ERROR_INCORRECT_FORMAT" )) { |
2158 | return TimestampCastResult::ERROR_INCORRECT_FORMAT; |
2159 | } |
2160 | if (StringUtil::Equals(s1: value, s2: "ERROR_NON_UTC_TIMEZONE" )) { |
2161 | return TimestampCastResult::ERROR_NON_UTC_TIMEZONE; |
2162 | } |
2163 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2164 | } |
2165 | |
2166 | template <> |
2167 | const char *EnumUtil::ToChars<ConflictManagerMode>(ConflictManagerMode value) { |
2168 | switch (value) { |
2169 | case ConflictManagerMode::SCAN: |
2170 | return "SCAN" ; |
2171 | case ConflictManagerMode::THROW: |
2172 | return "THROW" ; |
2173 | default: |
2174 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2175 | } |
2176 | } |
2177 | |
2178 | template <> |
2179 | ConflictManagerMode EnumUtil::FromString<ConflictManagerMode>(const char *value) { |
2180 | if (StringUtil::Equals(s1: value, s2: "SCAN" )) { |
2181 | return ConflictManagerMode::SCAN; |
2182 | } |
2183 | if (StringUtil::Equals(s1: value, s2: "THROW" )) { |
2184 | return ConflictManagerMode::THROW; |
2185 | } |
2186 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2187 | } |
2188 | |
2189 | template <> |
2190 | const char *EnumUtil::ToChars<LookupResultType>(LookupResultType value) { |
2191 | switch (value) { |
2192 | case LookupResultType::LOOKUP_MISS: |
2193 | return "LOOKUP_MISS" ; |
2194 | case LookupResultType::LOOKUP_HIT: |
2195 | return "LOOKUP_HIT" ; |
2196 | case LookupResultType::LOOKUP_NULL: |
2197 | return "LOOKUP_NULL" ; |
2198 | default: |
2199 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2200 | } |
2201 | } |
2202 | |
2203 | template <> |
2204 | LookupResultType EnumUtil::FromString<LookupResultType>(const char *value) { |
2205 | if (StringUtil::Equals(s1: value, s2: "LOOKUP_MISS" )) { |
2206 | return LookupResultType::LOOKUP_MISS; |
2207 | } |
2208 | if (StringUtil::Equals(s1: value, s2: "LOOKUP_HIT" )) { |
2209 | return LookupResultType::LOOKUP_HIT; |
2210 | } |
2211 | if (StringUtil::Equals(s1: value, s2: "LOOKUP_NULL" )) { |
2212 | return LookupResultType::LOOKUP_NULL; |
2213 | } |
2214 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2215 | } |
2216 | |
2217 | template <> |
2218 | const char *EnumUtil::ToChars<MapInvalidReason>(MapInvalidReason value) { |
2219 | switch (value) { |
2220 | case MapInvalidReason::VALID: |
2221 | return "VALID" ; |
2222 | case MapInvalidReason::NULL_KEY_LIST: |
2223 | return "NULL_KEY_LIST" ; |
2224 | case MapInvalidReason::NULL_KEY: |
2225 | return "NULL_KEY" ; |
2226 | case MapInvalidReason::DUPLICATE_KEY: |
2227 | return "DUPLICATE_KEY" ; |
2228 | default: |
2229 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2230 | } |
2231 | } |
2232 | |
2233 | template <> |
2234 | MapInvalidReason EnumUtil::FromString<MapInvalidReason>(const char *value) { |
2235 | if (StringUtil::Equals(s1: value, s2: "VALID" )) { |
2236 | return MapInvalidReason::VALID; |
2237 | } |
2238 | if (StringUtil::Equals(s1: value, s2: "NULL_KEY_LIST" )) { |
2239 | return MapInvalidReason::NULL_KEY_LIST; |
2240 | } |
2241 | if (StringUtil::Equals(s1: value, s2: "NULL_KEY" )) { |
2242 | return MapInvalidReason::NULL_KEY; |
2243 | } |
2244 | if (StringUtil::Equals(s1: value, s2: "DUPLICATE_KEY" )) { |
2245 | return MapInvalidReason::DUPLICATE_KEY; |
2246 | } |
2247 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2248 | } |
2249 | |
2250 | template <> |
2251 | const char *EnumUtil::ToChars<UnionInvalidReason>(UnionInvalidReason value) { |
2252 | switch (value) { |
2253 | case UnionInvalidReason::VALID: |
2254 | return "VALID" ; |
2255 | case UnionInvalidReason::TAG_OUT_OF_RANGE: |
2256 | return "TAG_OUT_OF_RANGE" ; |
2257 | case UnionInvalidReason::NO_MEMBERS: |
2258 | return "NO_MEMBERS" ; |
2259 | case UnionInvalidReason::VALIDITY_OVERLAP: |
2260 | return "VALIDITY_OVERLAP" ; |
2261 | default: |
2262 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2263 | } |
2264 | } |
2265 | |
2266 | template <> |
2267 | UnionInvalidReason EnumUtil::FromString<UnionInvalidReason>(const char *value) { |
2268 | if (StringUtil::Equals(s1: value, s2: "VALID" )) { |
2269 | return UnionInvalidReason::VALID; |
2270 | } |
2271 | if (StringUtil::Equals(s1: value, s2: "TAG_OUT_OF_RANGE" )) { |
2272 | return UnionInvalidReason::TAG_OUT_OF_RANGE; |
2273 | } |
2274 | if (StringUtil::Equals(s1: value, s2: "NO_MEMBERS" )) { |
2275 | return UnionInvalidReason::NO_MEMBERS; |
2276 | } |
2277 | if (StringUtil::Equals(s1: value, s2: "VALIDITY_OVERLAP" )) { |
2278 | return UnionInvalidReason::VALIDITY_OVERLAP; |
2279 | } |
2280 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2281 | } |
2282 | |
2283 | template <> |
2284 | const char *EnumUtil::ToChars<VectorBufferType>(VectorBufferType value) { |
2285 | switch (value) { |
2286 | case VectorBufferType::STANDARD_BUFFER: |
2287 | return "STANDARD_BUFFER" ; |
2288 | case VectorBufferType::DICTIONARY_BUFFER: |
2289 | return "DICTIONARY_BUFFER" ; |
2290 | case VectorBufferType::VECTOR_CHILD_BUFFER: |
2291 | return "VECTOR_CHILD_BUFFER" ; |
2292 | case VectorBufferType::STRING_BUFFER: |
2293 | return "STRING_BUFFER" ; |
2294 | case VectorBufferType::FSST_BUFFER: |
2295 | return "FSST_BUFFER" ; |
2296 | case VectorBufferType::STRUCT_BUFFER: |
2297 | return "STRUCT_BUFFER" ; |
2298 | case VectorBufferType::LIST_BUFFER: |
2299 | return "LIST_BUFFER" ; |
2300 | case VectorBufferType::MANAGED_BUFFER: |
2301 | return "MANAGED_BUFFER" ; |
2302 | case VectorBufferType::OPAQUE_BUFFER: |
2303 | return "OPAQUE_BUFFER" ; |
2304 | default: |
2305 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2306 | } |
2307 | } |
2308 | |
2309 | template <> |
2310 | VectorBufferType EnumUtil::FromString<VectorBufferType>(const char *value) { |
2311 | if (StringUtil::Equals(s1: value, s2: "STANDARD_BUFFER" )) { |
2312 | return VectorBufferType::STANDARD_BUFFER; |
2313 | } |
2314 | if (StringUtil::Equals(s1: value, s2: "DICTIONARY_BUFFER" )) { |
2315 | return VectorBufferType::DICTIONARY_BUFFER; |
2316 | } |
2317 | if (StringUtil::Equals(s1: value, s2: "VECTOR_CHILD_BUFFER" )) { |
2318 | return VectorBufferType::VECTOR_CHILD_BUFFER; |
2319 | } |
2320 | if (StringUtil::Equals(s1: value, s2: "STRING_BUFFER" )) { |
2321 | return VectorBufferType::STRING_BUFFER; |
2322 | } |
2323 | if (StringUtil::Equals(s1: value, s2: "FSST_BUFFER" )) { |
2324 | return VectorBufferType::FSST_BUFFER; |
2325 | } |
2326 | if (StringUtil::Equals(s1: value, s2: "STRUCT_BUFFER" )) { |
2327 | return VectorBufferType::STRUCT_BUFFER; |
2328 | } |
2329 | if (StringUtil::Equals(s1: value, s2: "LIST_BUFFER" )) { |
2330 | return VectorBufferType::LIST_BUFFER; |
2331 | } |
2332 | if (StringUtil::Equals(s1: value, s2: "MANAGED_BUFFER" )) { |
2333 | return VectorBufferType::MANAGED_BUFFER; |
2334 | } |
2335 | if (StringUtil::Equals(s1: value, s2: "OPAQUE_BUFFER" )) { |
2336 | return VectorBufferType::OPAQUE_BUFFER; |
2337 | } |
2338 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2339 | } |
2340 | |
2341 | template <> |
2342 | const char *EnumUtil::ToChars<VectorAuxiliaryDataType>(VectorAuxiliaryDataType value) { |
2343 | switch (value) { |
2344 | case VectorAuxiliaryDataType::ARROW_AUXILIARY: |
2345 | return "ARROW_AUXILIARY" ; |
2346 | default: |
2347 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2348 | } |
2349 | } |
2350 | |
2351 | template <> |
2352 | VectorAuxiliaryDataType EnumUtil::FromString<VectorAuxiliaryDataType>(const char *value) { |
2353 | if (StringUtil::Equals(s1: value, s2: "ARROW_AUXILIARY" )) { |
2354 | return VectorAuxiliaryDataType::ARROW_AUXILIARY; |
2355 | } |
2356 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2357 | } |
2358 | |
2359 | template <> |
2360 | const char *EnumUtil::ToChars<PartitionedColumnDataType>(PartitionedColumnDataType value) { |
2361 | switch (value) { |
2362 | case PartitionedColumnDataType::INVALID: |
2363 | return "INVALID" ; |
2364 | case PartitionedColumnDataType::RADIX: |
2365 | return "RADIX" ; |
2366 | case PartitionedColumnDataType::HIVE: |
2367 | return "HIVE" ; |
2368 | default: |
2369 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2370 | } |
2371 | } |
2372 | |
2373 | template <> |
2374 | PartitionedColumnDataType EnumUtil::FromString<PartitionedColumnDataType>(const char *value) { |
2375 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
2376 | return PartitionedColumnDataType::INVALID; |
2377 | } |
2378 | if (StringUtil::Equals(s1: value, s2: "RADIX" )) { |
2379 | return PartitionedColumnDataType::RADIX; |
2380 | } |
2381 | if (StringUtil::Equals(s1: value, s2: "HIVE" )) { |
2382 | return PartitionedColumnDataType::HIVE; |
2383 | } |
2384 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2385 | } |
2386 | |
2387 | template <> |
2388 | const char *EnumUtil::ToChars<ColumnDataAllocatorType>(ColumnDataAllocatorType value) { |
2389 | switch (value) { |
2390 | case ColumnDataAllocatorType::BUFFER_MANAGER_ALLOCATOR: |
2391 | return "BUFFER_MANAGER_ALLOCATOR" ; |
2392 | case ColumnDataAllocatorType::IN_MEMORY_ALLOCATOR: |
2393 | return "IN_MEMORY_ALLOCATOR" ; |
2394 | default: |
2395 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2396 | } |
2397 | } |
2398 | |
2399 | template <> |
2400 | ColumnDataAllocatorType EnumUtil::FromString<ColumnDataAllocatorType>(const char *value) { |
2401 | if (StringUtil::Equals(s1: value, s2: "BUFFER_MANAGER_ALLOCATOR" )) { |
2402 | return ColumnDataAllocatorType::BUFFER_MANAGER_ALLOCATOR; |
2403 | } |
2404 | if (StringUtil::Equals(s1: value, s2: "IN_MEMORY_ALLOCATOR" )) { |
2405 | return ColumnDataAllocatorType::IN_MEMORY_ALLOCATOR; |
2406 | } |
2407 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2408 | } |
2409 | |
2410 | template <> |
2411 | const char *EnumUtil::ToChars<ColumnDataScanProperties>(ColumnDataScanProperties value) { |
2412 | switch (value) { |
2413 | case ColumnDataScanProperties::INVALID: |
2414 | return "INVALID" ; |
2415 | case ColumnDataScanProperties::ALLOW_ZERO_COPY: |
2416 | return "ALLOW_ZERO_COPY" ; |
2417 | case ColumnDataScanProperties::DISALLOW_ZERO_COPY: |
2418 | return "DISALLOW_ZERO_COPY" ; |
2419 | default: |
2420 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2421 | } |
2422 | } |
2423 | |
2424 | template <> |
2425 | ColumnDataScanProperties EnumUtil::FromString<ColumnDataScanProperties>(const char *value) { |
2426 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
2427 | return ColumnDataScanProperties::INVALID; |
2428 | } |
2429 | if (StringUtil::Equals(s1: value, s2: "ALLOW_ZERO_COPY" )) { |
2430 | return ColumnDataScanProperties::ALLOW_ZERO_COPY; |
2431 | } |
2432 | if (StringUtil::Equals(s1: value, s2: "DISALLOW_ZERO_COPY" )) { |
2433 | return ColumnDataScanProperties::DISALLOW_ZERO_COPY; |
2434 | } |
2435 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2436 | } |
2437 | |
2438 | template <> |
2439 | const char *EnumUtil::ToChars<PartitionedTupleDataType>(PartitionedTupleDataType value) { |
2440 | switch (value) { |
2441 | case PartitionedTupleDataType::INVALID: |
2442 | return "INVALID" ; |
2443 | case PartitionedTupleDataType::RADIX: |
2444 | return "RADIX" ; |
2445 | default: |
2446 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2447 | } |
2448 | } |
2449 | |
2450 | template <> |
2451 | PartitionedTupleDataType EnumUtil::FromString<PartitionedTupleDataType>(const char *value) { |
2452 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
2453 | return PartitionedTupleDataType::INVALID; |
2454 | } |
2455 | if (StringUtil::Equals(s1: value, s2: "RADIX" )) { |
2456 | return PartitionedTupleDataType::RADIX; |
2457 | } |
2458 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2459 | } |
2460 | |
2461 | template <> |
2462 | const char *EnumUtil::ToChars<TupleDataPinProperties>(TupleDataPinProperties value) { |
2463 | switch (value) { |
2464 | case TupleDataPinProperties::INVALID: |
2465 | return "INVALID" ; |
2466 | case TupleDataPinProperties::KEEP_EVERYTHING_PINNED: |
2467 | return "KEEP_EVERYTHING_PINNED" ; |
2468 | case TupleDataPinProperties::UNPIN_AFTER_DONE: |
2469 | return "UNPIN_AFTER_DONE" ; |
2470 | case TupleDataPinProperties::DESTROY_AFTER_DONE: |
2471 | return "DESTROY_AFTER_DONE" ; |
2472 | case TupleDataPinProperties::ALREADY_PINNED: |
2473 | return "ALREADY_PINNED" ; |
2474 | default: |
2475 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2476 | } |
2477 | } |
2478 | |
2479 | template <> |
2480 | TupleDataPinProperties EnumUtil::FromString<TupleDataPinProperties>(const char *value) { |
2481 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
2482 | return TupleDataPinProperties::INVALID; |
2483 | } |
2484 | if (StringUtil::Equals(s1: value, s2: "KEEP_EVERYTHING_PINNED" )) { |
2485 | return TupleDataPinProperties::KEEP_EVERYTHING_PINNED; |
2486 | } |
2487 | if (StringUtil::Equals(s1: value, s2: "UNPIN_AFTER_DONE" )) { |
2488 | return TupleDataPinProperties::UNPIN_AFTER_DONE; |
2489 | } |
2490 | if (StringUtil::Equals(s1: value, s2: "DESTROY_AFTER_DONE" )) { |
2491 | return TupleDataPinProperties::DESTROY_AFTER_DONE; |
2492 | } |
2493 | if (StringUtil::Equals(s1: value, s2: "ALREADY_PINNED" )) { |
2494 | return TupleDataPinProperties::ALREADY_PINNED; |
2495 | } |
2496 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2497 | } |
2498 | |
2499 | template <> |
2500 | const char *EnumUtil::ToChars<PartitionSortStage>(PartitionSortStage value) { |
2501 | switch (value) { |
2502 | case PartitionSortStage::INIT: |
2503 | return "INIT" ; |
2504 | case PartitionSortStage::PREPARE: |
2505 | return "PREPARE" ; |
2506 | case PartitionSortStage::MERGE: |
2507 | return "MERGE" ; |
2508 | case PartitionSortStage::SORTED: |
2509 | return "SORTED" ; |
2510 | default: |
2511 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2512 | } |
2513 | } |
2514 | |
2515 | template <> |
2516 | PartitionSortStage EnumUtil::FromString<PartitionSortStage>(const char *value) { |
2517 | if (StringUtil::Equals(s1: value, s2: "INIT" )) { |
2518 | return PartitionSortStage::INIT; |
2519 | } |
2520 | if (StringUtil::Equals(s1: value, s2: "PREPARE" )) { |
2521 | return PartitionSortStage::PREPARE; |
2522 | } |
2523 | if (StringUtil::Equals(s1: value, s2: "MERGE" )) { |
2524 | return PartitionSortStage::MERGE; |
2525 | } |
2526 | if (StringUtil::Equals(s1: value, s2: "SORTED" )) { |
2527 | return PartitionSortStage::SORTED; |
2528 | } |
2529 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2530 | } |
2531 | |
2532 | template <> |
2533 | const char *EnumUtil::ToChars<PhysicalOperatorType>(PhysicalOperatorType value) { |
2534 | switch (value) { |
2535 | case PhysicalOperatorType::INVALID: |
2536 | return "INVALID" ; |
2537 | case PhysicalOperatorType::ORDER_BY: |
2538 | return "ORDER_BY" ; |
2539 | case PhysicalOperatorType::LIMIT: |
2540 | return "LIMIT" ; |
2541 | case PhysicalOperatorType::STREAMING_LIMIT: |
2542 | return "STREAMING_LIMIT" ; |
2543 | case PhysicalOperatorType::LIMIT_PERCENT: |
2544 | return "LIMIT_PERCENT" ; |
2545 | case PhysicalOperatorType::TOP_N: |
2546 | return "TOP_N" ; |
2547 | case PhysicalOperatorType::WINDOW: |
2548 | return "WINDOW" ; |
2549 | case PhysicalOperatorType::UNNEST: |
2550 | return "UNNEST" ; |
2551 | case PhysicalOperatorType::UNGROUPED_AGGREGATE: |
2552 | return "UNGROUPED_AGGREGATE" ; |
2553 | case PhysicalOperatorType::HASH_GROUP_BY: |
2554 | return "HASH_GROUP_BY" ; |
2555 | case PhysicalOperatorType::PERFECT_HASH_GROUP_BY: |
2556 | return "PERFECT_HASH_GROUP_BY" ; |
2557 | case PhysicalOperatorType::FILTER: |
2558 | return "FILTER" ; |
2559 | case PhysicalOperatorType::PROJECTION: |
2560 | return "PROJECTION" ; |
2561 | case PhysicalOperatorType::COPY_TO_FILE: |
2562 | return "COPY_TO_FILE" ; |
2563 | case PhysicalOperatorType::RESERVOIR_SAMPLE: |
2564 | return "RESERVOIR_SAMPLE" ; |
2565 | case PhysicalOperatorType::STREAMING_SAMPLE: |
2566 | return "STREAMING_SAMPLE" ; |
2567 | case PhysicalOperatorType::STREAMING_WINDOW: |
2568 | return "STREAMING_WINDOW" ; |
2569 | case PhysicalOperatorType::PIVOT: |
2570 | return "PIVOT" ; |
2571 | case PhysicalOperatorType::TABLE_SCAN: |
2572 | return "TABLE_SCAN" ; |
2573 | case PhysicalOperatorType::DUMMY_SCAN: |
2574 | return "DUMMY_SCAN" ; |
2575 | case PhysicalOperatorType::COLUMN_DATA_SCAN: |
2576 | return "COLUMN_DATA_SCAN" ; |
2577 | case PhysicalOperatorType::CHUNK_SCAN: |
2578 | return "CHUNK_SCAN" ; |
2579 | case PhysicalOperatorType::RECURSIVE_CTE_SCAN: |
2580 | return "RECURSIVE_CTE_SCAN" ; |
2581 | case PhysicalOperatorType::DELIM_SCAN: |
2582 | return "DELIM_SCAN" ; |
2583 | case PhysicalOperatorType::EXPRESSION_SCAN: |
2584 | return "EXPRESSION_SCAN" ; |
2585 | case PhysicalOperatorType::POSITIONAL_SCAN: |
2586 | return "POSITIONAL_SCAN" ; |
2587 | case PhysicalOperatorType::BLOCKWISE_NL_JOIN: |
2588 | return "BLOCKWISE_NL_JOIN" ; |
2589 | case PhysicalOperatorType::NESTED_LOOP_JOIN: |
2590 | return "NESTED_LOOP_JOIN" ; |
2591 | case PhysicalOperatorType::HASH_JOIN: |
2592 | return "HASH_JOIN" ; |
2593 | case PhysicalOperatorType::CROSS_PRODUCT: |
2594 | return "CROSS_PRODUCT" ; |
2595 | case PhysicalOperatorType::PIECEWISE_MERGE_JOIN: |
2596 | return "PIECEWISE_MERGE_JOIN" ; |
2597 | case PhysicalOperatorType::IE_JOIN: |
2598 | return "IE_JOIN" ; |
2599 | case PhysicalOperatorType::DELIM_JOIN: |
2600 | return "DELIM_JOIN" ; |
2601 | case PhysicalOperatorType::INDEX_JOIN: |
2602 | return "INDEX_JOIN" ; |
2603 | case PhysicalOperatorType::POSITIONAL_JOIN: |
2604 | return "POSITIONAL_JOIN" ; |
2605 | case PhysicalOperatorType::ASOF_JOIN: |
2606 | return "ASOF_JOIN" ; |
2607 | case PhysicalOperatorType::UNION: |
2608 | return "UNION" ; |
2609 | case PhysicalOperatorType::RECURSIVE_CTE: |
2610 | return "RECURSIVE_CTE" ; |
2611 | case PhysicalOperatorType::INSERT: |
2612 | return "INSERT" ; |
2613 | case PhysicalOperatorType::BATCH_INSERT: |
2614 | return "BATCH_INSERT" ; |
2615 | case PhysicalOperatorType::DELETE_OPERATOR: |
2616 | return "DELETE_OPERATOR" ; |
2617 | case PhysicalOperatorType::UPDATE: |
2618 | return "UPDATE" ; |
2619 | case PhysicalOperatorType::CREATE_TABLE: |
2620 | return "CREATE_TABLE" ; |
2621 | case PhysicalOperatorType::CREATE_TABLE_AS: |
2622 | return "CREATE_TABLE_AS" ; |
2623 | case PhysicalOperatorType::BATCH_CREATE_TABLE_AS: |
2624 | return "BATCH_CREATE_TABLE_AS" ; |
2625 | case PhysicalOperatorType::CREATE_INDEX: |
2626 | return "CREATE_INDEX" ; |
2627 | case PhysicalOperatorType::ALTER: |
2628 | return "ALTER" ; |
2629 | case PhysicalOperatorType::CREATE_SEQUENCE: |
2630 | return "CREATE_SEQUENCE" ; |
2631 | case PhysicalOperatorType::CREATE_VIEW: |
2632 | return "CREATE_VIEW" ; |
2633 | case PhysicalOperatorType::CREATE_SCHEMA: |
2634 | return "CREATE_SCHEMA" ; |
2635 | case PhysicalOperatorType::CREATE_MACRO: |
2636 | return "CREATE_MACRO" ; |
2637 | case PhysicalOperatorType::DROP: |
2638 | return "DROP" ; |
2639 | case PhysicalOperatorType::PRAGMA: |
2640 | return "PRAGMA" ; |
2641 | case PhysicalOperatorType::TRANSACTION: |
2642 | return "TRANSACTION" ; |
2643 | case PhysicalOperatorType::CREATE_TYPE: |
2644 | return "CREATE_TYPE" ; |
2645 | case PhysicalOperatorType::ATTACH: |
2646 | return "ATTACH" ; |
2647 | case PhysicalOperatorType::DETACH: |
2648 | return "DETACH" ; |
2649 | case PhysicalOperatorType::EXPLAIN: |
2650 | return "EXPLAIN" ; |
2651 | case PhysicalOperatorType::EXPLAIN_ANALYZE: |
2652 | return "EXPLAIN_ANALYZE" ; |
2653 | case PhysicalOperatorType::EMPTY_RESULT: |
2654 | return "EMPTY_RESULT" ; |
2655 | case PhysicalOperatorType::EXECUTE: |
2656 | return "EXECUTE" ; |
2657 | case PhysicalOperatorType::PREPARE: |
2658 | return "PREPARE" ; |
2659 | case PhysicalOperatorType::VACUUM: |
2660 | return "VACUUM" ; |
2661 | case PhysicalOperatorType::EXPORT: |
2662 | return "EXPORT" ; |
2663 | case PhysicalOperatorType::SET: |
2664 | return "SET" ; |
2665 | case PhysicalOperatorType::LOAD: |
2666 | return "LOAD" ; |
2667 | case PhysicalOperatorType::INOUT_FUNCTION: |
2668 | return "INOUT_FUNCTION" ; |
2669 | case PhysicalOperatorType::RESULT_COLLECTOR: |
2670 | return "RESULT_COLLECTOR" ; |
2671 | case PhysicalOperatorType::RESET: |
2672 | return "RESET" ; |
2673 | case PhysicalOperatorType::EXTENSION: |
2674 | return "EXTENSION" ; |
2675 | default: |
2676 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2677 | } |
2678 | } |
2679 | |
2680 | template <> |
2681 | PhysicalOperatorType EnumUtil::FromString<PhysicalOperatorType>(const char *value) { |
2682 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
2683 | return PhysicalOperatorType::INVALID; |
2684 | } |
2685 | if (StringUtil::Equals(s1: value, s2: "ORDER_BY" )) { |
2686 | return PhysicalOperatorType::ORDER_BY; |
2687 | } |
2688 | if (StringUtil::Equals(s1: value, s2: "LIMIT" )) { |
2689 | return PhysicalOperatorType::LIMIT; |
2690 | } |
2691 | if (StringUtil::Equals(s1: value, s2: "STREAMING_LIMIT" )) { |
2692 | return PhysicalOperatorType::STREAMING_LIMIT; |
2693 | } |
2694 | if (StringUtil::Equals(s1: value, s2: "LIMIT_PERCENT" )) { |
2695 | return PhysicalOperatorType::LIMIT_PERCENT; |
2696 | } |
2697 | if (StringUtil::Equals(s1: value, s2: "TOP_N" )) { |
2698 | return PhysicalOperatorType::TOP_N; |
2699 | } |
2700 | if (StringUtil::Equals(s1: value, s2: "WINDOW" )) { |
2701 | return PhysicalOperatorType::WINDOW; |
2702 | } |
2703 | if (StringUtil::Equals(s1: value, s2: "UNNEST" )) { |
2704 | return PhysicalOperatorType::UNNEST; |
2705 | } |
2706 | if (StringUtil::Equals(s1: value, s2: "UNGROUPED_AGGREGATE" )) { |
2707 | return PhysicalOperatorType::UNGROUPED_AGGREGATE; |
2708 | } |
2709 | if (StringUtil::Equals(s1: value, s2: "HASH_GROUP_BY" )) { |
2710 | return PhysicalOperatorType::HASH_GROUP_BY; |
2711 | } |
2712 | if (StringUtil::Equals(s1: value, s2: "PERFECT_HASH_GROUP_BY" )) { |
2713 | return PhysicalOperatorType::PERFECT_HASH_GROUP_BY; |
2714 | } |
2715 | if (StringUtil::Equals(s1: value, s2: "FILTER" )) { |
2716 | return PhysicalOperatorType::FILTER; |
2717 | } |
2718 | if (StringUtil::Equals(s1: value, s2: "PROJECTION" )) { |
2719 | return PhysicalOperatorType::PROJECTION; |
2720 | } |
2721 | if (StringUtil::Equals(s1: value, s2: "COPY_TO_FILE" )) { |
2722 | return PhysicalOperatorType::COPY_TO_FILE; |
2723 | } |
2724 | if (StringUtil::Equals(s1: value, s2: "RESERVOIR_SAMPLE" )) { |
2725 | return PhysicalOperatorType::RESERVOIR_SAMPLE; |
2726 | } |
2727 | if (StringUtil::Equals(s1: value, s2: "STREAMING_SAMPLE" )) { |
2728 | return PhysicalOperatorType::STREAMING_SAMPLE; |
2729 | } |
2730 | if (StringUtil::Equals(s1: value, s2: "STREAMING_WINDOW" )) { |
2731 | return PhysicalOperatorType::STREAMING_WINDOW; |
2732 | } |
2733 | if (StringUtil::Equals(s1: value, s2: "PIVOT" )) { |
2734 | return PhysicalOperatorType::PIVOT; |
2735 | } |
2736 | if (StringUtil::Equals(s1: value, s2: "TABLE_SCAN" )) { |
2737 | return PhysicalOperatorType::TABLE_SCAN; |
2738 | } |
2739 | if (StringUtil::Equals(s1: value, s2: "DUMMY_SCAN" )) { |
2740 | return PhysicalOperatorType::DUMMY_SCAN; |
2741 | } |
2742 | if (StringUtil::Equals(s1: value, s2: "COLUMN_DATA_SCAN" )) { |
2743 | return PhysicalOperatorType::COLUMN_DATA_SCAN; |
2744 | } |
2745 | if (StringUtil::Equals(s1: value, s2: "CHUNK_SCAN" )) { |
2746 | return PhysicalOperatorType::CHUNK_SCAN; |
2747 | } |
2748 | if (StringUtil::Equals(s1: value, s2: "RECURSIVE_CTE_SCAN" )) { |
2749 | return PhysicalOperatorType::RECURSIVE_CTE_SCAN; |
2750 | } |
2751 | if (StringUtil::Equals(s1: value, s2: "DELIM_SCAN" )) { |
2752 | return PhysicalOperatorType::DELIM_SCAN; |
2753 | } |
2754 | if (StringUtil::Equals(s1: value, s2: "EXPRESSION_SCAN" )) { |
2755 | return PhysicalOperatorType::EXPRESSION_SCAN; |
2756 | } |
2757 | if (StringUtil::Equals(s1: value, s2: "POSITIONAL_SCAN" )) { |
2758 | return PhysicalOperatorType::POSITIONAL_SCAN; |
2759 | } |
2760 | if (StringUtil::Equals(s1: value, s2: "BLOCKWISE_NL_JOIN" )) { |
2761 | return PhysicalOperatorType::BLOCKWISE_NL_JOIN; |
2762 | } |
2763 | if (StringUtil::Equals(s1: value, s2: "NESTED_LOOP_JOIN" )) { |
2764 | return PhysicalOperatorType::NESTED_LOOP_JOIN; |
2765 | } |
2766 | if (StringUtil::Equals(s1: value, s2: "HASH_JOIN" )) { |
2767 | return PhysicalOperatorType::HASH_JOIN; |
2768 | } |
2769 | if (StringUtil::Equals(s1: value, s2: "CROSS_PRODUCT" )) { |
2770 | return PhysicalOperatorType::CROSS_PRODUCT; |
2771 | } |
2772 | if (StringUtil::Equals(s1: value, s2: "PIECEWISE_MERGE_JOIN" )) { |
2773 | return PhysicalOperatorType::PIECEWISE_MERGE_JOIN; |
2774 | } |
2775 | if (StringUtil::Equals(s1: value, s2: "IE_JOIN" )) { |
2776 | return PhysicalOperatorType::IE_JOIN; |
2777 | } |
2778 | if (StringUtil::Equals(s1: value, s2: "DELIM_JOIN" )) { |
2779 | return PhysicalOperatorType::DELIM_JOIN; |
2780 | } |
2781 | if (StringUtil::Equals(s1: value, s2: "INDEX_JOIN" )) { |
2782 | return PhysicalOperatorType::INDEX_JOIN; |
2783 | } |
2784 | if (StringUtil::Equals(s1: value, s2: "POSITIONAL_JOIN" )) { |
2785 | return PhysicalOperatorType::POSITIONAL_JOIN; |
2786 | } |
2787 | if (StringUtil::Equals(s1: value, s2: "ASOF_JOIN" )) { |
2788 | return PhysicalOperatorType::ASOF_JOIN; |
2789 | } |
2790 | if (StringUtil::Equals(s1: value, s2: "UNION" )) { |
2791 | return PhysicalOperatorType::UNION; |
2792 | } |
2793 | if (StringUtil::Equals(s1: value, s2: "RECURSIVE_CTE" )) { |
2794 | return PhysicalOperatorType::RECURSIVE_CTE; |
2795 | } |
2796 | if (StringUtil::Equals(s1: value, s2: "INSERT" )) { |
2797 | return PhysicalOperatorType::INSERT; |
2798 | } |
2799 | if (StringUtil::Equals(s1: value, s2: "BATCH_INSERT" )) { |
2800 | return PhysicalOperatorType::BATCH_INSERT; |
2801 | } |
2802 | if (StringUtil::Equals(s1: value, s2: "DELETE_OPERATOR" )) { |
2803 | return PhysicalOperatorType::DELETE_OPERATOR; |
2804 | } |
2805 | if (StringUtil::Equals(s1: value, s2: "UPDATE" )) { |
2806 | return PhysicalOperatorType::UPDATE; |
2807 | } |
2808 | if (StringUtil::Equals(s1: value, s2: "CREATE_TABLE" )) { |
2809 | return PhysicalOperatorType::CREATE_TABLE; |
2810 | } |
2811 | if (StringUtil::Equals(s1: value, s2: "CREATE_TABLE_AS" )) { |
2812 | return PhysicalOperatorType::CREATE_TABLE_AS; |
2813 | } |
2814 | if (StringUtil::Equals(s1: value, s2: "BATCH_CREATE_TABLE_AS" )) { |
2815 | return PhysicalOperatorType::BATCH_CREATE_TABLE_AS; |
2816 | } |
2817 | if (StringUtil::Equals(s1: value, s2: "CREATE_INDEX" )) { |
2818 | return PhysicalOperatorType::CREATE_INDEX; |
2819 | } |
2820 | if (StringUtil::Equals(s1: value, s2: "ALTER" )) { |
2821 | return PhysicalOperatorType::ALTER; |
2822 | } |
2823 | if (StringUtil::Equals(s1: value, s2: "CREATE_SEQUENCE" )) { |
2824 | return PhysicalOperatorType::CREATE_SEQUENCE; |
2825 | } |
2826 | if (StringUtil::Equals(s1: value, s2: "CREATE_VIEW" )) { |
2827 | return PhysicalOperatorType::CREATE_VIEW; |
2828 | } |
2829 | if (StringUtil::Equals(s1: value, s2: "CREATE_SCHEMA" )) { |
2830 | return PhysicalOperatorType::CREATE_SCHEMA; |
2831 | } |
2832 | if (StringUtil::Equals(s1: value, s2: "CREATE_MACRO" )) { |
2833 | return PhysicalOperatorType::CREATE_MACRO; |
2834 | } |
2835 | if (StringUtil::Equals(s1: value, s2: "DROP" )) { |
2836 | return PhysicalOperatorType::DROP; |
2837 | } |
2838 | if (StringUtil::Equals(s1: value, s2: "PRAGMA" )) { |
2839 | return PhysicalOperatorType::PRAGMA; |
2840 | } |
2841 | if (StringUtil::Equals(s1: value, s2: "TRANSACTION" )) { |
2842 | return PhysicalOperatorType::TRANSACTION; |
2843 | } |
2844 | if (StringUtil::Equals(s1: value, s2: "CREATE_TYPE" )) { |
2845 | return PhysicalOperatorType::CREATE_TYPE; |
2846 | } |
2847 | if (StringUtil::Equals(s1: value, s2: "ATTACH" )) { |
2848 | return PhysicalOperatorType::ATTACH; |
2849 | } |
2850 | if (StringUtil::Equals(s1: value, s2: "DETACH" )) { |
2851 | return PhysicalOperatorType::DETACH; |
2852 | } |
2853 | if (StringUtil::Equals(s1: value, s2: "EXPLAIN" )) { |
2854 | return PhysicalOperatorType::EXPLAIN; |
2855 | } |
2856 | if (StringUtil::Equals(s1: value, s2: "EXPLAIN_ANALYZE" )) { |
2857 | return PhysicalOperatorType::EXPLAIN_ANALYZE; |
2858 | } |
2859 | if (StringUtil::Equals(s1: value, s2: "EMPTY_RESULT" )) { |
2860 | return PhysicalOperatorType::EMPTY_RESULT; |
2861 | } |
2862 | if (StringUtil::Equals(s1: value, s2: "EXECUTE" )) { |
2863 | return PhysicalOperatorType::EXECUTE; |
2864 | } |
2865 | if (StringUtil::Equals(s1: value, s2: "PREPARE" )) { |
2866 | return PhysicalOperatorType::PREPARE; |
2867 | } |
2868 | if (StringUtil::Equals(s1: value, s2: "VACUUM" )) { |
2869 | return PhysicalOperatorType::VACUUM; |
2870 | } |
2871 | if (StringUtil::Equals(s1: value, s2: "EXPORT" )) { |
2872 | return PhysicalOperatorType::EXPORT; |
2873 | } |
2874 | if (StringUtil::Equals(s1: value, s2: "SET" )) { |
2875 | return PhysicalOperatorType::SET; |
2876 | } |
2877 | if (StringUtil::Equals(s1: value, s2: "LOAD" )) { |
2878 | return PhysicalOperatorType::LOAD; |
2879 | } |
2880 | if (StringUtil::Equals(s1: value, s2: "INOUT_FUNCTION" )) { |
2881 | return PhysicalOperatorType::INOUT_FUNCTION; |
2882 | } |
2883 | if (StringUtil::Equals(s1: value, s2: "RESULT_COLLECTOR" )) { |
2884 | return PhysicalOperatorType::RESULT_COLLECTOR; |
2885 | } |
2886 | if (StringUtil::Equals(s1: value, s2: "RESET" )) { |
2887 | return PhysicalOperatorType::RESET; |
2888 | } |
2889 | if (StringUtil::Equals(s1: value, s2: "EXTENSION" )) { |
2890 | return PhysicalOperatorType::EXTENSION; |
2891 | } |
2892 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2893 | } |
2894 | |
2895 | template <> |
2896 | const char *EnumUtil::ToChars<VectorType>(VectorType value) { |
2897 | switch (value) { |
2898 | case VectorType::FLAT_VECTOR: |
2899 | return "FLAT_VECTOR" ; |
2900 | case VectorType::FSST_VECTOR: |
2901 | return "FSST_VECTOR" ; |
2902 | case VectorType::CONSTANT_VECTOR: |
2903 | return "CONSTANT_VECTOR" ; |
2904 | case VectorType::DICTIONARY_VECTOR: |
2905 | return "DICTIONARY_VECTOR" ; |
2906 | case VectorType::SEQUENCE_VECTOR: |
2907 | return "SEQUENCE_VECTOR" ; |
2908 | default: |
2909 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2910 | } |
2911 | } |
2912 | |
2913 | template <> |
2914 | VectorType EnumUtil::FromString<VectorType>(const char *value) { |
2915 | if (StringUtil::Equals(s1: value, s2: "FLAT_VECTOR" )) { |
2916 | return VectorType::FLAT_VECTOR; |
2917 | } |
2918 | if (StringUtil::Equals(s1: value, s2: "FSST_VECTOR" )) { |
2919 | return VectorType::FSST_VECTOR; |
2920 | } |
2921 | if (StringUtil::Equals(s1: value, s2: "CONSTANT_VECTOR" )) { |
2922 | return VectorType::CONSTANT_VECTOR; |
2923 | } |
2924 | if (StringUtil::Equals(s1: value, s2: "DICTIONARY_VECTOR" )) { |
2925 | return VectorType::DICTIONARY_VECTOR; |
2926 | } |
2927 | if (StringUtil::Equals(s1: value, s2: "SEQUENCE_VECTOR" )) { |
2928 | return VectorType::SEQUENCE_VECTOR; |
2929 | } |
2930 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2931 | } |
2932 | |
2933 | template <> |
2934 | const char *EnumUtil::ToChars<AccessMode>(AccessMode value) { |
2935 | switch (value) { |
2936 | case AccessMode::UNDEFINED: |
2937 | return "UNDEFINED" ; |
2938 | case AccessMode::AUTOMATIC: |
2939 | return "AUTOMATIC" ; |
2940 | case AccessMode::READ_ONLY: |
2941 | return "READ_ONLY" ; |
2942 | case AccessMode::READ_WRITE: |
2943 | return "READ_WRITE" ; |
2944 | default: |
2945 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2946 | } |
2947 | } |
2948 | |
2949 | template <> |
2950 | AccessMode EnumUtil::FromString<AccessMode>(const char *value) { |
2951 | if (StringUtil::Equals(s1: value, s2: "UNDEFINED" )) { |
2952 | return AccessMode::UNDEFINED; |
2953 | } |
2954 | if (StringUtil::Equals(s1: value, s2: "AUTOMATIC" )) { |
2955 | return AccessMode::AUTOMATIC; |
2956 | } |
2957 | if (StringUtil::Equals(s1: value, s2: "READ_ONLY" )) { |
2958 | return AccessMode::READ_ONLY; |
2959 | } |
2960 | if (StringUtil::Equals(s1: value, s2: "READ_WRITE" )) { |
2961 | return AccessMode::READ_WRITE; |
2962 | } |
2963 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2964 | } |
2965 | |
2966 | template <> |
2967 | const char *EnumUtil::ToChars<FileGlobOptions>(FileGlobOptions value) { |
2968 | switch (value) { |
2969 | case FileGlobOptions::DISALLOW_EMPTY: |
2970 | return "DISALLOW_EMPTY" ; |
2971 | case FileGlobOptions::ALLOW_EMPTY: |
2972 | return "ALLOW_EMPTY" ; |
2973 | default: |
2974 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
2975 | } |
2976 | } |
2977 | |
2978 | template <> |
2979 | FileGlobOptions EnumUtil::FromString<FileGlobOptions>(const char *value) { |
2980 | if (StringUtil::Equals(s1: value, s2: "DISALLOW_EMPTY" )) { |
2981 | return FileGlobOptions::DISALLOW_EMPTY; |
2982 | } |
2983 | if (StringUtil::Equals(s1: value, s2: "ALLOW_EMPTY" )) { |
2984 | return FileGlobOptions::ALLOW_EMPTY; |
2985 | } |
2986 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
2987 | } |
2988 | |
2989 | template <> |
2990 | const char *EnumUtil::ToChars<WALType>(WALType value) { |
2991 | switch (value) { |
2992 | case WALType::INVALID: |
2993 | return "INVALID" ; |
2994 | case WALType::CREATE_TABLE: |
2995 | return "CREATE_TABLE" ; |
2996 | case WALType::DROP_TABLE: |
2997 | return "DROP_TABLE" ; |
2998 | case WALType::CREATE_SCHEMA: |
2999 | return "CREATE_SCHEMA" ; |
3000 | case WALType::DROP_SCHEMA: |
3001 | return "DROP_SCHEMA" ; |
3002 | case WALType::CREATE_VIEW: |
3003 | return "CREATE_VIEW" ; |
3004 | case WALType::DROP_VIEW: |
3005 | return "DROP_VIEW" ; |
3006 | case WALType::CREATE_SEQUENCE: |
3007 | return "CREATE_SEQUENCE" ; |
3008 | case WALType::DROP_SEQUENCE: |
3009 | return "DROP_SEQUENCE" ; |
3010 | case WALType::SEQUENCE_VALUE: |
3011 | return "SEQUENCE_VALUE" ; |
3012 | case WALType::CREATE_MACRO: |
3013 | return "CREATE_MACRO" ; |
3014 | case WALType::DROP_MACRO: |
3015 | return "DROP_MACRO" ; |
3016 | case WALType::CREATE_TYPE: |
3017 | return "CREATE_TYPE" ; |
3018 | case WALType::DROP_TYPE: |
3019 | return "DROP_TYPE" ; |
3020 | case WALType::ALTER_INFO: |
3021 | return "ALTER_INFO" ; |
3022 | case WALType::CREATE_TABLE_MACRO: |
3023 | return "CREATE_TABLE_MACRO" ; |
3024 | case WALType::DROP_TABLE_MACRO: |
3025 | return "DROP_TABLE_MACRO" ; |
3026 | case WALType::CREATE_INDEX: |
3027 | return "CREATE_INDEX" ; |
3028 | case WALType::DROP_INDEX: |
3029 | return "DROP_INDEX" ; |
3030 | case WALType::USE_TABLE: |
3031 | return "USE_TABLE" ; |
3032 | case WALType::INSERT_TUPLE: |
3033 | return "INSERT_TUPLE" ; |
3034 | case WALType::DELETE_TUPLE: |
3035 | return "DELETE_TUPLE" ; |
3036 | case WALType::UPDATE_TUPLE: |
3037 | return "UPDATE_TUPLE" ; |
3038 | case WALType::CHECKPOINT: |
3039 | return "CHECKPOINT" ; |
3040 | case WALType::WAL_FLUSH: |
3041 | return "WAL_FLUSH" ; |
3042 | default: |
3043 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3044 | } |
3045 | } |
3046 | |
3047 | template <> |
3048 | WALType EnumUtil::FromString<WALType>(const char *value) { |
3049 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
3050 | return WALType::INVALID; |
3051 | } |
3052 | if (StringUtil::Equals(s1: value, s2: "CREATE_TABLE" )) { |
3053 | return WALType::CREATE_TABLE; |
3054 | } |
3055 | if (StringUtil::Equals(s1: value, s2: "DROP_TABLE" )) { |
3056 | return WALType::DROP_TABLE; |
3057 | } |
3058 | if (StringUtil::Equals(s1: value, s2: "CREATE_SCHEMA" )) { |
3059 | return WALType::CREATE_SCHEMA; |
3060 | } |
3061 | if (StringUtil::Equals(s1: value, s2: "DROP_SCHEMA" )) { |
3062 | return WALType::DROP_SCHEMA; |
3063 | } |
3064 | if (StringUtil::Equals(s1: value, s2: "CREATE_VIEW" )) { |
3065 | return WALType::CREATE_VIEW; |
3066 | } |
3067 | if (StringUtil::Equals(s1: value, s2: "DROP_VIEW" )) { |
3068 | return WALType::DROP_VIEW; |
3069 | } |
3070 | if (StringUtil::Equals(s1: value, s2: "CREATE_SEQUENCE" )) { |
3071 | return WALType::CREATE_SEQUENCE; |
3072 | } |
3073 | if (StringUtil::Equals(s1: value, s2: "DROP_SEQUENCE" )) { |
3074 | return WALType::DROP_SEQUENCE; |
3075 | } |
3076 | if (StringUtil::Equals(s1: value, s2: "SEQUENCE_VALUE" )) { |
3077 | return WALType::SEQUENCE_VALUE; |
3078 | } |
3079 | if (StringUtil::Equals(s1: value, s2: "CREATE_MACRO" )) { |
3080 | return WALType::CREATE_MACRO; |
3081 | } |
3082 | if (StringUtil::Equals(s1: value, s2: "DROP_MACRO" )) { |
3083 | return WALType::DROP_MACRO; |
3084 | } |
3085 | if (StringUtil::Equals(s1: value, s2: "CREATE_TYPE" )) { |
3086 | return WALType::CREATE_TYPE; |
3087 | } |
3088 | if (StringUtil::Equals(s1: value, s2: "DROP_TYPE" )) { |
3089 | return WALType::DROP_TYPE; |
3090 | } |
3091 | if (StringUtil::Equals(s1: value, s2: "ALTER_INFO" )) { |
3092 | return WALType::ALTER_INFO; |
3093 | } |
3094 | if (StringUtil::Equals(s1: value, s2: "CREATE_TABLE_MACRO" )) { |
3095 | return WALType::CREATE_TABLE_MACRO; |
3096 | } |
3097 | if (StringUtil::Equals(s1: value, s2: "DROP_TABLE_MACRO" )) { |
3098 | return WALType::DROP_TABLE_MACRO; |
3099 | } |
3100 | if (StringUtil::Equals(s1: value, s2: "CREATE_INDEX" )) { |
3101 | return WALType::CREATE_INDEX; |
3102 | } |
3103 | if (StringUtil::Equals(s1: value, s2: "DROP_INDEX" )) { |
3104 | return WALType::DROP_INDEX; |
3105 | } |
3106 | if (StringUtil::Equals(s1: value, s2: "USE_TABLE" )) { |
3107 | return WALType::USE_TABLE; |
3108 | } |
3109 | if (StringUtil::Equals(s1: value, s2: "INSERT_TUPLE" )) { |
3110 | return WALType::INSERT_TUPLE; |
3111 | } |
3112 | if (StringUtil::Equals(s1: value, s2: "DELETE_TUPLE" )) { |
3113 | return WALType::DELETE_TUPLE; |
3114 | } |
3115 | if (StringUtil::Equals(s1: value, s2: "UPDATE_TUPLE" )) { |
3116 | return WALType::UPDATE_TUPLE; |
3117 | } |
3118 | if (StringUtil::Equals(s1: value, s2: "CHECKPOINT" )) { |
3119 | return WALType::CHECKPOINT; |
3120 | } |
3121 | if (StringUtil::Equals(s1: value, s2: "WAL_FLUSH" )) { |
3122 | return WALType::WAL_FLUSH; |
3123 | } |
3124 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3125 | } |
3126 | |
3127 | template <> |
3128 | const char *EnumUtil::ToChars<JoinType>(JoinType value) { |
3129 | switch (value) { |
3130 | case JoinType::INVALID: |
3131 | return "INVALID" ; |
3132 | case JoinType::LEFT: |
3133 | return "LEFT" ; |
3134 | case JoinType::RIGHT: |
3135 | return "RIGHT" ; |
3136 | case JoinType::INNER: |
3137 | return "INNER" ; |
3138 | case JoinType::OUTER: |
3139 | return "FULL" ; |
3140 | case JoinType::SEMI: |
3141 | return "SEMI" ; |
3142 | case JoinType::ANTI: |
3143 | return "ANTI" ; |
3144 | case JoinType::MARK: |
3145 | return "MARK" ; |
3146 | case JoinType::SINGLE: |
3147 | return "SINGLE" ; |
3148 | default: |
3149 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3150 | } |
3151 | } |
3152 | |
3153 | template <> |
3154 | JoinType EnumUtil::FromString<JoinType>(const char *value) { |
3155 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
3156 | return JoinType::INVALID; |
3157 | } |
3158 | if (StringUtil::Equals(s1: value, s2: "LEFT" )) { |
3159 | return JoinType::LEFT; |
3160 | } |
3161 | if (StringUtil::Equals(s1: value, s2: "RIGHT" )) { |
3162 | return JoinType::RIGHT; |
3163 | } |
3164 | if (StringUtil::Equals(s1: value, s2: "INNER" )) { |
3165 | return JoinType::INNER; |
3166 | } |
3167 | if (StringUtil::Equals(s1: value, s2: "FULL" )) { |
3168 | return JoinType::OUTER; |
3169 | } |
3170 | if (StringUtil::Equals(s1: value, s2: "SEMI" )) { |
3171 | return JoinType::SEMI; |
3172 | } |
3173 | if (StringUtil::Equals(s1: value, s2: "ANTI" )) { |
3174 | return JoinType::ANTI; |
3175 | } |
3176 | if (StringUtil::Equals(s1: value, s2: "MARK" )) { |
3177 | return JoinType::MARK; |
3178 | } |
3179 | if (StringUtil::Equals(s1: value, s2: "SINGLE" )) { |
3180 | return JoinType::SINGLE; |
3181 | } |
3182 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3183 | } |
3184 | |
3185 | template <> |
3186 | const char *EnumUtil::ToChars<FileCompressionType>(FileCompressionType value) { |
3187 | switch (value) { |
3188 | case FileCompressionType::AUTO_DETECT: |
3189 | return "AUTO_DETECT" ; |
3190 | case FileCompressionType::UNCOMPRESSED: |
3191 | return "UNCOMPRESSED" ; |
3192 | case FileCompressionType::GZIP: |
3193 | return "GZIP" ; |
3194 | case FileCompressionType::ZSTD: |
3195 | return "ZSTD" ; |
3196 | default: |
3197 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3198 | } |
3199 | } |
3200 | |
3201 | template <> |
3202 | FileCompressionType EnumUtil::FromString<FileCompressionType>(const char *value) { |
3203 | if (StringUtil::Equals(s1: value, s2: "AUTO_DETECT" )) { |
3204 | return FileCompressionType::AUTO_DETECT; |
3205 | } |
3206 | if (StringUtil::Equals(s1: value, s2: "UNCOMPRESSED" )) { |
3207 | return FileCompressionType::UNCOMPRESSED; |
3208 | } |
3209 | if (StringUtil::Equals(s1: value, s2: "GZIP" )) { |
3210 | return FileCompressionType::GZIP; |
3211 | } |
3212 | if (StringUtil::Equals(s1: value, s2: "ZSTD" )) { |
3213 | return FileCompressionType::ZSTD; |
3214 | } |
3215 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3216 | } |
3217 | |
3218 | template <> |
3219 | const char *EnumUtil::ToChars<ProfilerPrintFormat>(ProfilerPrintFormat value) { |
3220 | switch (value) { |
3221 | case ProfilerPrintFormat::QUERY_TREE: |
3222 | return "QUERY_TREE" ; |
3223 | case ProfilerPrintFormat::JSON: |
3224 | return "JSON" ; |
3225 | case ProfilerPrintFormat::QUERY_TREE_OPTIMIZER: |
3226 | return "QUERY_TREE_OPTIMIZER" ; |
3227 | default: |
3228 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3229 | } |
3230 | } |
3231 | |
3232 | template <> |
3233 | ProfilerPrintFormat EnumUtil::FromString<ProfilerPrintFormat>(const char *value) { |
3234 | if (StringUtil::Equals(s1: value, s2: "QUERY_TREE" )) { |
3235 | return ProfilerPrintFormat::QUERY_TREE; |
3236 | } |
3237 | if (StringUtil::Equals(s1: value, s2: "JSON" )) { |
3238 | return ProfilerPrintFormat::JSON; |
3239 | } |
3240 | if (StringUtil::Equals(s1: value, s2: "QUERY_TREE_OPTIMIZER" )) { |
3241 | return ProfilerPrintFormat::QUERY_TREE_OPTIMIZER; |
3242 | } |
3243 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3244 | } |
3245 | |
3246 | template <> |
3247 | const char *EnumUtil::ToChars<StatementType>(StatementType value) { |
3248 | switch (value) { |
3249 | case StatementType::INVALID_STATEMENT: |
3250 | return "INVALID_STATEMENT" ; |
3251 | case StatementType::SELECT_STATEMENT: |
3252 | return "SELECT_STATEMENT" ; |
3253 | case StatementType::INSERT_STATEMENT: |
3254 | return "INSERT_STATEMENT" ; |
3255 | case StatementType::UPDATE_STATEMENT: |
3256 | return "UPDATE_STATEMENT" ; |
3257 | case StatementType::CREATE_STATEMENT: |
3258 | return "CREATE_STATEMENT" ; |
3259 | case StatementType::DELETE_STATEMENT: |
3260 | return "DELETE_STATEMENT" ; |
3261 | case StatementType::PREPARE_STATEMENT: |
3262 | return "PREPARE_STATEMENT" ; |
3263 | case StatementType::EXECUTE_STATEMENT: |
3264 | return "EXECUTE_STATEMENT" ; |
3265 | case StatementType::ALTER_STATEMENT: |
3266 | return "ALTER_STATEMENT" ; |
3267 | case StatementType::TRANSACTION_STATEMENT: |
3268 | return "TRANSACTION_STATEMENT" ; |
3269 | case StatementType::COPY_STATEMENT: |
3270 | return "COPY_STATEMENT" ; |
3271 | case StatementType::ANALYZE_STATEMENT: |
3272 | return "ANALYZE_STATEMENT" ; |
3273 | case StatementType::VARIABLE_SET_STATEMENT: |
3274 | return "VARIABLE_SET_STATEMENT" ; |
3275 | case StatementType::CREATE_FUNC_STATEMENT: |
3276 | return "CREATE_FUNC_STATEMENT" ; |
3277 | case StatementType::EXPLAIN_STATEMENT: |
3278 | return "EXPLAIN_STATEMENT" ; |
3279 | case StatementType::DROP_STATEMENT: |
3280 | return "DROP_STATEMENT" ; |
3281 | case StatementType::EXPORT_STATEMENT: |
3282 | return "EXPORT_STATEMENT" ; |
3283 | case StatementType::PRAGMA_STATEMENT: |
3284 | return "PRAGMA_STATEMENT" ; |
3285 | case StatementType::SHOW_STATEMENT: |
3286 | return "SHOW_STATEMENT" ; |
3287 | case StatementType::VACUUM_STATEMENT: |
3288 | return "VACUUM_STATEMENT" ; |
3289 | case StatementType::CALL_STATEMENT: |
3290 | return "CALL_STATEMENT" ; |
3291 | case StatementType::SET_STATEMENT: |
3292 | return "SET_STATEMENT" ; |
3293 | case StatementType::LOAD_STATEMENT: |
3294 | return "LOAD_STATEMENT" ; |
3295 | case StatementType::RELATION_STATEMENT: |
3296 | return "RELATION_STATEMENT" ; |
3297 | case StatementType::EXTENSION_STATEMENT: |
3298 | return "EXTENSION_STATEMENT" ; |
3299 | case StatementType::LOGICAL_PLAN_STATEMENT: |
3300 | return "LOGICAL_PLAN_STATEMENT" ; |
3301 | case StatementType::ATTACH_STATEMENT: |
3302 | return "ATTACH_STATEMENT" ; |
3303 | case StatementType::DETACH_STATEMENT: |
3304 | return "DETACH_STATEMENT" ; |
3305 | case StatementType::MULTI_STATEMENT: |
3306 | return "MULTI_STATEMENT" ; |
3307 | default: |
3308 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3309 | } |
3310 | } |
3311 | |
3312 | template <> |
3313 | StatementType EnumUtil::FromString<StatementType>(const char *value) { |
3314 | if (StringUtil::Equals(s1: value, s2: "INVALID_STATEMENT" )) { |
3315 | return StatementType::INVALID_STATEMENT; |
3316 | } |
3317 | if (StringUtil::Equals(s1: value, s2: "SELECT_STATEMENT" )) { |
3318 | return StatementType::SELECT_STATEMENT; |
3319 | } |
3320 | if (StringUtil::Equals(s1: value, s2: "INSERT_STATEMENT" )) { |
3321 | return StatementType::INSERT_STATEMENT; |
3322 | } |
3323 | if (StringUtil::Equals(s1: value, s2: "UPDATE_STATEMENT" )) { |
3324 | return StatementType::UPDATE_STATEMENT; |
3325 | } |
3326 | if (StringUtil::Equals(s1: value, s2: "CREATE_STATEMENT" )) { |
3327 | return StatementType::CREATE_STATEMENT; |
3328 | } |
3329 | if (StringUtil::Equals(s1: value, s2: "DELETE_STATEMENT" )) { |
3330 | return StatementType::DELETE_STATEMENT; |
3331 | } |
3332 | if (StringUtil::Equals(s1: value, s2: "PREPARE_STATEMENT" )) { |
3333 | return StatementType::PREPARE_STATEMENT; |
3334 | } |
3335 | if (StringUtil::Equals(s1: value, s2: "EXECUTE_STATEMENT" )) { |
3336 | return StatementType::EXECUTE_STATEMENT; |
3337 | } |
3338 | if (StringUtil::Equals(s1: value, s2: "ALTER_STATEMENT" )) { |
3339 | return StatementType::ALTER_STATEMENT; |
3340 | } |
3341 | if (StringUtil::Equals(s1: value, s2: "TRANSACTION_STATEMENT" )) { |
3342 | return StatementType::TRANSACTION_STATEMENT; |
3343 | } |
3344 | if (StringUtil::Equals(s1: value, s2: "COPY_STATEMENT" )) { |
3345 | return StatementType::COPY_STATEMENT; |
3346 | } |
3347 | if (StringUtil::Equals(s1: value, s2: "ANALYZE_STATEMENT" )) { |
3348 | return StatementType::ANALYZE_STATEMENT; |
3349 | } |
3350 | if (StringUtil::Equals(s1: value, s2: "VARIABLE_SET_STATEMENT" )) { |
3351 | return StatementType::VARIABLE_SET_STATEMENT; |
3352 | } |
3353 | if (StringUtil::Equals(s1: value, s2: "CREATE_FUNC_STATEMENT" )) { |
3354 | return StatementType::CREATE_FUNC_STATEMENT; |
3355 | } |
3356 | if (StringUtil::Equals(s1: value, s2: "EXPLAIN_STATEMENT" )) { |
3357 | return StatementType::EXPLAIN_STATEMENT; |
3358 | } |
3359 | if (StringUtil::Equals(s1: value, s2: "DROP_STATEMENT" )) { |
3360 | return StatementType::DROP_STATEMENT; |
3361 | } |
3362 | if (StringUtil::Equals(s1: value, s2: "EXPORT_STATEMENT" )) { |
3363 | return StatementType::EXPORT_STATEMENT; |
3364 | } |
3365 | if (StringUtil::Equals(s1: value, s2: "PRAGMA_STATEMENT" )) { |
3366 | return StatementType::PRAGMA_STATEMENT; |
3367 | } |
3368 | if (StringUtil::Equals(s1: value, s2: "SHOW_STATEMENT" )) { |
3369 | return StatementType::SHOW_STATEMENT; |
3370 | } |
3371 | if (StringUtil::Equals(s1: value, s2: "VACUUM_STATEMENT" )) { |
3372 | return StatementType::VACUUM_STATEMENT; |
3373 | } |
3374 | if (StringUtil::Equals(s1: value, s2: "CALL_STATEMENT" )) { |
3375 | return StatementType::CALL_STATEMENT; |
3376 | } |
3377 | if (StringUtil::Equals(s1: value, s2: "SET_STATEMENT" )) { |
3378 | return StatementType::SET_STATEMENT; |
3379 | } |
3380 | if (StringUtil::Equals(s1: value, s2: "LOAD_STATEMENT" )) { |
3381 | return StatementType::LOAD_STATEMENT; |
3382 | } |
3383 | if (StringUtil::Equals(s1: value, s2: "RELATION_STATEMENT" )) { |
3384 | return StatementType::RELATION_STATEMENT; |
3385 | } |
3386 | if (StringUtil::Equals(s1: value, s2: "EXTENSION_STATEMENT" )) { |
3387 | return StatementType::EXTENSION_STATEMENT; |
3388 | } |
3389 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_PLAN_STATEMENT" )) { |
3390 | return StatementType::LOGICAL_PLAN_STATEMENT; |
3391 | } |
3392 | if (StringUtil::Equals(s1: value, s2: "ATTACH_STATEMENT" )) { |
3393 | return StatementType::ATTACH_STATEMENT; |
3394 | } |
3395 | if (StringUtil::Equals(s1: value, s2: "DETACH_STATEMENT" )) { |
3396 | return StatementType::DETACH_STATEMENT; |
3397 | } |
3398 | if (StringUtil::Equals(s1: value, s2: "MULTI_STATEMENT" )) { |
3399 | return StatementType::MULTI_STATEMENT; |
3400 | } |
3401 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3402 | } |
3403 | |
3404 | template <> |
3405 | const char *EnumUtil::ToChars<StatementReturnType>(StatementReturnType value) { |
3406 | switch (value) { |
3407 | case StatementReturnType::QUERY_RESULT: |
3408 | return "QUERY_RESULT" ; |
3409 | case StatementReturnType::CHANGED_ROWS: |
3410 | return "CHANGED_ROWS" ; |
3411 | case StatementReturnType::NOTHING: |
3412 | return "NOTHING" ; |
3413 | default: |
3414 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3415 | } |
3416 | } |
3417 | |
3418 | template <> |
3419 | StatementReturnType EnumUtil::FromString<StatementReturnType>(const char *value) { |
3420 | if (StringUtil::Equals(s1: value, s2: "QUERY_RESULT" )) { |
3421 | return StatementReturnType::QUERY_RESULT; |
3422 | } |
3423 | if (StringUtil::Equals(s1: value, s2: "CHANGED_ROWS" )) { |
3424 | return StatementReturnType::CHANGED_ROWS; |
3425 | } |
3426 | if (StringUtil::Equals(s1: value, s2: "NOTHING" )) { |
3427 | return StatementReturnType::NOTHING; |
3428 | } |
3429 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3430 | } |
3431 | |
3432 | template <> |
3433 | const char *EnumUtil::ToChars<OrderPreservationType>(OrderPreservationType value) { |
3434 | switch (value) { |
3435 | case OrderPreservationType::NO_ORDER: |
3436 | return "NO_ORDER" ; |
3437 | case OrderPreservationType::INSERTION_ORDER: |
3438 | return "INSERTION_ORDER" ; |
3439 | case OrderPreservationType::FIXED_ORDER: |
3440 | return "FIXED_ORDER" ; |
3441 | default: |
3442 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3443 | } |
3444 | } |
3445 | |
3446 | template <> |
3447 | OrderPreservationType EnumUtil::FromString<OrderPreservationType>(const char *value) { |
3448 | if (StringUtil::Equals(s1: value, s2: "NO_ORDER" )) { |
3449 | return OrderPreservationType::NO_ORDER; |
3450 | } |
3451 | if (StringUtil::Equals(s1: value, s2: "INSERTION_ORDER" )) { |
3452 | return OrderPreservationType::INSERTION_ORDER; |
3453 | } |
3454 | if (StringUtil::Equals(s1: value, s2: "FIXED_ORDER" )) { |
3455 | return OrderPreservationType::FIXED_ORDER; |
3456 | } |
3457 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3458 | } |
3459 | |
3460 | template <> |
3461 | const char *EnumUtil::ToChars<DebugInitialize>(DebugInitialize value) { |
3462 | switch (value) { |
3463 | case DebugInitialize::NO_INITIALIZE: |
3464 | return "NO_INITIALIZE" ; |
3465 | case DebugInitialize::DEBUG_ZERO_INITIALIZE: |
3466 | return "DEBUG_ZERO_INITIALIZE" ; |
3467 | case DebugInitialize::DEBUG_ONE_INITIALIZE: |
3468 | return "DEBUG_ONE_INITIALIZE" ; |
3469 | default: |
3470 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3471 | } |
3472 | } |
3473 | |
3474 | template <> |
3475 | DebugInitialize EnumUtil::FromString<DebugInitialize>(const char *value) { |
3476 | if (StringUtil::Equals(s1: value, s2: "NO_INITIALIZE" )) { |
3477 | return DebugInitialize::NO_INITIALIZE; |
3478 | } |
3479 | if (StringUtil::Equals(s1: value, s2: "DEBUG_ZERO_INITIALIZE" )) { |
3480 | return DebugInitialize::DEBUG_ZERO_INITIALIZE; |
3481 | } |
3482 | if (StringUtil::Equals(s1: value, s2: "DEBUG_ONE_INITIALIZE" )) { |
3483 | return DebugInitialize::DEBUG_ONE_INITIALIZE; |
3484 | } |
3485 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3486 | } |
3487 | |
3488 | template <> |
3489 | const char *EnumUtil::ToChars<CatalogType>(CatalogType value) { |
3490 | switch (value) { |
3491 | case CatalogType::INVALID: |
3492 | return "INVALID" ; |
3493 | case CatalogType::TABLE_ENTRY: |
3494 | return "TABLE_ENTRY" ; |
3495 | case CatalogType::SCHEMA_ENTRY: |
3496 | return "SCHEMA_ENTRY" ; |
3497 | case CatalogType::VIEW_ENTRY: |
3498 | return "VIEW_ENTRY" ; |
3499 | case CatalogType::INDEX_ENTRY: |
3500 | return "INDEX_ENTRY" ; |
3501 | case CatalogType::PREPARED_STATEMENT: |
3502 | return "PREPARED_STATEMENT" ; |
3503 | case CatalogType::SEQUENCE_ENTRY: |
3504 | return "SEQUENCE_ENTRY" ; |
3505 | case CatalogType::COLLATION_ENTRY: |
3506 | return "COLLATION_ENTRY" ; |
3507 | case CatalogType::TYPE_ENTRY: |
3508 | return "TYPE_ENTRY" ; |
3509 | case CatalogType::DATABASE_ENTRY: |
3510 | return "DATABASE_ENTRY" ; |
3511 | case CatalogType::TABLE_FUNCTION_ENTRY: |
3512 | return "TABLE_FUNCTION_ENTRY" ; |
3513 | case CatalogType::SCALAR_FUNCTION_ENTRY: |
3514 | return "SCALAR_FUNCTION_ENTRY" ; |
3515 | case CatalogType::AGGREGATE_FUNCTION_ENTRY: |
3516 | return "AGGREGATE_FUNCTION_ENTRY" ; |
3517 | case CatalogType::PRAGMA_FUNCTION_ENTRY: |
3518 | return "PRAGMA_FUNCTION_ENTRY" ; |
3519 | case CatalogType::COPY_FUNCTION_ENTRY: |
3520 | return "COPY_FUNCTION_ENTRY" ; |
3521 | case CatalogType::MACRO_ENTRY: |
3522 | return "MACRO_ENTRY" ; |
3523 | case CatalogType::TABLE_MACRO_ENTRY: |
3524 | return "TABLE_MACRO_ENTRY" ; |
3525 | case CatalogType::UPDATED_ENTRY: |
3526 | return "UPDATED_ENTRY" ; |
3527 | case CatalogType::DELETED_ENTRY: |
3528 | return "DELETED_ENTRY" ; |
3529 | default: |
3530 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3531 | } |
3532 | } |
3533 | |
3534 | template <> |
3535 | CatalogType EnumUtil::FromString<CatalogType>(const char *value) { |
3536 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
3537 | return CatalogType::INVALID; |
3538 | } |
3539 | if (StringUtil::Equals(s1: value, s2: "TABLE_ENTRY" )) { |
3540 | return CatalogType::TABLE_ENTRY; |
3541 | } |
3542 | if (StringUtil::Equals(s1: value, s2: "SCHEMA_ENTRY" )) { |
3543 | return CatalogType::SCHEMA_ENTRY; |
3544 | } |
3545 | if (StringUtil::Equals(s1: value, s2: "VIEW_ENTRY" )) { |
3546 | return CatalogType::VIEW_ENTRY; |
3547 | } |
3548 | if (StringUtil::Equals(s1: value, s2: "INDEX_ENTRY" )) { |
3549 | return CatalogType::INDEX_ENTRY; |
3550 | } |
3551 | if (StringUtil::Equals(s1: value, s2: "PREPARED_STATEMENT" )) { |
3552 | return CatalogType::PREPARED_STATEMENT; |
3553 | } |
3554 | if (StringUtil::Equals(s1: value, s2: "SEQUENCE_ENTRY" )) { |
3555 | return CatalogType::SEQUENCE_ENTRY; |
3556 | } |
3557 | if (StringUtil::Equals(s1: value, s2: "COLLATION_ENTRY" )) { |
3558 | return CatalogType::COLLATION_ENTRY; |
3559 | } |
3560 | if (StringUtil::Equals(s1: value, s2: "TYPE_ENTRY" )) { |
3561 | return CatalogType::TYPE_ENTRY; |
3562 | } |
3563 | if (StringUtil::Equals(s1: value, s2: "DATABASE_ENTRY" )) { |
3564 | return CatalogType::DATABASE_ENTRY; |
3565 | } |
3566 | if (StringUtil::Equals(s1: value, s2: "TABLE_FUNCTION_ENTRY" )) { |
3567 | return CatalogType::TABLE_FUNCTION_ENTRY; |
3568 | } |
3569 | if (StringUtil::Equals(s1: value, s2: "SCALAR_FUNCTION_ENTRY" )) { |
3570 | return CatalogType::SCALAR_FUNCTION_ENTRY; |
3571 | } |
3572 | if (StringUtil::Equals(s1: value, s2: "AGGREGATE_FUNCTION_ENTRY" )) { |
3573 | return CatalogType::AGGREGATE_FUNCTION_ENTRY; |
3574 | } |
3575 | if (StringUtil::Equals(s1: value, s2: "PRAGMA_FUNCTION_ENTRY" )) { |
3576 | return CatalogType::PRAGMA_FUNCTION_ENTRY; |
3577 | } |
3578 | if (StringUtil::Equals(s1: value, s2: "COPY_FUNCTION_ENTRY" )) { |
3579 | return CatalogType::COPY_FUNCTION_ENTRY; |
3580 | } |
3581 | if (StringUtil::Equals(s1: value, s2: "MACRO_ENTRY" )) { |
3582 | return CatalogType::MACRO_ENTRY; |
3583 | } |
3584 | if (StringUtil::Equals(s1: value, s2: "TABLE_MACRO_ENTRY" )) { |
3585 | return CatalogType::TABLE_MACRO_ENTRY; |
3586 | } |
3587 | if (StringUtil::Equals(s1: value, s2: "UPDATED_ENTRY" )) { |
3588 | return CatalogType::UPDATED_ENTRY; |
3589 | } |
3590 | if (StringUtil::Equals(s1: value, s2: "DELETED_ENTRY" )) { |
3591 | return CatalogType::DELETED_ENTRY; |
3592 | } |
3593 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3594 | } |
3595 | |
3596 | template <> |
3597 | const char *EnumUtil::ToChars<SetScope>(SetScope value) { |
3598 | switch (value) { |
3599 | case SetScope::AUTOMATIC: |
3600 | return "AUTOMATIC" ; |
3601 | case SetScope::LOCAL: |
3602 | return "LOCAL" ; |
3603 | case SetScope::SESSION: |
3604 | return "SESSION" ; |
3605 | case SetScope::GLOBAL: |
3606 | return "GLOBAL" ; |
3607 | default: |
3608 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3609 | } |
3610 | } |
3611 | |
3612 | template <> |
3613 | SetScope EnumUtil::FromString<SetScope>(const char *value) { |
3614 | if (StringUtil::Equals(s1: value, s2: "AUTOMATIC" )) { |
3615 | return SetScope::AUTOMATIC; |
3616 | } |
3617 | if (StringUtil::Equals(s1: value, s2: "LOCAL" )) { |
3618 | return SetScope::LOCAL; |
3619 | } |
3620 | if (StringUtil::Equals(s1: value, s2: "SESSION" )) { |
3621 | return SetScope::SESSION; |
3622 | } |
3623 | if (StringUtil::Equals(s1: value, s2: "GLOBAL" )) { |
3624 | return SetScope::GLOBAL; |
3625 | } |
3626 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3627 | } |
3628 | |
3629 | template <> |
3630 | const char *EnumUtil::ToChars<TableScanType>(TableScanType value) { |
3631 | switch (value) { |
3632 | case TableScanType::TABLE_SCAN_REGULAR: |
3633 | return "TABLE_SCAN_REGULAR" ; |
3634 | case TableScanType::TABLE_SCAN_COMMITTED_ROWS: |
3635 | return "TABLE_SCAN_COMMITTED_ROWS" ; |
3636 | case TableScanType::TABLE_SCAN_COMMITTED_ROWS_DISALLOW_UPDATES: |
3637 | return "TABLE_SCAN_COMMITTED_ROWS_DISALLOW_UPDATES" ; |
3638 | case TableScanType::TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED: |
3639 | return "TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED" ; |
3640 | default: |
3641 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3642 | } |
3643 | } |
3644 | |
3645 | template <> |
3646 | TableScanType EnumUtil::FromString<TableScanType>(const char *value) { |
3647 | if (StringUtil::Equals(s1: value, s2: "TABLE_SCAN_REGULAR" )) { |
3648 | return TableScanType::TABLE_SCAN_REGULAR; |
3649 | } |
3650 | if (StringUtil::Equals(s1: value, s2: "TABLE_SCAN_COMMITTED_ROWS" )) { |
3651 | return TableScanType::TABLE_SCAN_COMMITTED_ROWS; |
3652 | } |
3653 | if (StringUtil::Equals(s1: value, s2: "TABLE_SCAN_COMMITTED_ROWS_DISALLOW_UPDATES" )) { |
3654 | return TableScanType::TABLE_SCAN_COMMITTED_ROWS_DISALLOW_UPDATES; |
3655 | } |
3656 | if (StringUtil::Equals(s1: value, s2: "TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED" )) { |
3657 | return TableScanType::TABLE_SCAN_COMMITTED_ROWS_OMIT_PERMANENTLY_DELETED; |
3658 | } |
3659 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3660 | } |
3661 | |
3662 | template <> |
3663 | const char *EnumUtil::ToChars<SetType>(SetType value) { |
3664 | switch (value) { |
3665 | case SetType::SET: |
3666 | return "SET" ; |
3667 | case SetType::RESET: |
3668 | return "RESET" ; |
3669 | default: |
3670 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3671 | } |
3672 | } |
3673 | |
3674 | template <> |
3675 | SetType EnumUtil::FromString<SetType>(const char *value) { |
3676 | if (StringUtil::Equals(s1: value, s2: "SET" )) { |
3677 | return SetType::SET; |
3678 | } |
3679 | if (StringUtil::Equals(s1: value, s2: "RESET" )) { |
3680 | return SetType::RESET; |
3681 | } |
3682 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
3683 | } |
3684 | |
3685 | template <> |
3686 | const char *EnumUtil::ToChars<ExpressionType>(ExpressionType value) { |
3687 | switch (value) { |
3688 | case ExpressionType::INVALID: |
3689 | return "INVALID" ; |
3690 | case ExpressionType::OPERATOR_CAST: |
3691 | return "OPERATOR_CAST" ; |
3692 | case ExpressionType::OPERATOR_NOT: |
3693 | return "OPERATOR_NOT" ; |
3694 | case ExpressionType::OPERATOR_IS_NULL: |
3695 | return "OPERATOR_IS_NULL" ; |
3696 | case ExpressionType::OPERATOR_IS_NOT_NULL: |
3697 | return "OPERATOR_IS_NOT_NULL" ; |
3698 | case ExpressionType::COMPARE_EQUAL: |
3699 | return "COMPARE_EQUAL" ; |
3700 | case ExpressionType::COMPARE_NOTEQUAL: |
3701 | return "COMPARE_NOTEQUAL" ; |
3702 | case ExpressionType::COMPARE_LESSTHAN: |
3703 | return "COMPARE_LESSTHAN" ; |
3704 | case ExpressionType::COMPARE_GREATERTHAN: |
3705 | return "COMPARE_GREATERTHAN" ; |
3706 | case ExpressionType::COMPARE_LESSTHANOREQUALTO: |
3707 | return "COMPARE_LESSTHANOREQUALTO" ; |
3708 | case ExpressionType::COMPARE_GREATERTHANOREQUALTO: |
3709 | return "COMPARE_GREATERTHANOREQUALTO" ; |
3710 | case ExpressionType::COMPARE_IN: |
3711 | return "COMPARE_IN" ; |
3712 | case ExpressionType::COMPARE_NOT_IN: |
3713 | return "COMPARE_NOT_IN" ; |
3714 | case ExpressionType::COMPARE_DISTINCT_FROM: |
3715 | return "COMPARE_DISTINCT_FROM" ; |
3716 | case ExpressionType::COMPARE_BETWEEN: |
3717 | return "COMPARE_BETWEEN" ; |
3718 | case ExpressionType::COMPARE_NOT_BETWEEN: |
3719 | return "COMPARE_NOT_BETWEEN" ; |
3720 | case ExpressionType::COMPARE_NOT_DISTINCT_FROM: |
3721 | return "COMPARE_NOT_DISTINCT_FROM" ; |
3722 | case ExpressionType::CONJUNCTION_AND: |
3723 | return "CONJUNCTION_AND" ; |
3724 | case ExpressionType::CONJUNCTION_OR: |
3725 | return "CONJUNCTION_OR" ; |
3726 | case ExpressionType::VALUE_CONSTANT: |
3727 | return "VALUE_CONSTANT" ; |
3728 | case ExpressionType::VALUE_PARAMETER: |
3729 | return "VALUE_PARAMETER" ; |
3730 | case ExpressionType::VALUE_TUPLE: |
3731 | return "VALUE_TUPLE" ; |
3732 | case ExpressionType::VALUE_TUPLE_ADDRESS: |
3733 | return "VALUE_TUPLE_ADDRESS" ; |
3734 | case ExpressionType::VALUE_NULL: |
3735 | return "VALUE_NULL" ; |
3736 | case ExpressionType::VALUE_VECTOR: |
3737 | return "VALUE_VECTOR" ; |
3738 | case ExpressionType::VALUE_SCALAR: |
3739 | return "VALUE_SCALAR" ; |
3740 | case ExpressionType::VALUE_DEFAULT: |
3741 | return "VALUE_DEFAULT" ; |
3742 | case ExpressionType::AGGREGATE: |
3743 | return "AGGREGATE" ; |
3744 | case ExpressionType::BOUND_AGGREGATE: |
3745 | return "BOUND_AGGREGATE" ; |
3746 | case ExpressionType::GROUPING_FUNCTION: |
3747 | return "GROUPING_FUNCTION" ; |
3748 | case ExpressionType::WINDOW_AGGREGATE: |
3749 | return "WINDOW_AGGREGATE" ; |
3750 | case ExpressionType::WINDOW_RANK: |
3751 | return "WINDOW_RANK" ; |
3752 | case ExpressionType::WINDOW_RANK_DENSE: |
3753 | return "WINDOW_RANK_DENSE" ; |
3754 | case ExpressionType::WINDOW_NTILE: |
3755 | return "WINDOW_NTILE" ; |
3756 | case ExpressionType::WINDOW_PERCENT_RANK: |
3757 | return "WINDOW_PERCENT_RANK" ; |
3758 | case ExpressionType::WINDOW_CUME_DIST: |
3759 | return "WINDOW_CUME_DIST" ; |
3760 | case ExpressionType::WINDOW_ROW_NUMBER: |
3761 | return "WINDOW_ROW_NUMBER" ; |
3762 | case ExpressionType::WINDOW_FIRST_VALUE: |
3763 | return "WINDOW_FIRST_VALUE" ; |
3764 | case ExpressionType::WINDOW_LAST_VALUE: |
3765 | return "WINDOW_LAST_VALUE" ; |
3766 | case ExpressionType::WINDOW_LEAD: |
3767 | return "WINDOW_LEAD" ; |
3768 | case ExpressionType::WINDOW_LAG: |
3769 | return "WINDOW_LAG" ; |
3770 | case ExpressionType::WINDOW_NTH_VALUE: |
3771 | return "WINDOW_NTH_VALUE" ; |
3772 | case ExpressionType::FUNCTION: |
3773 | return "FUNCTION" ; |
3774 | case ExpressionType::BOUND_FUNCTION: |
3775 | return "BOUND_FUNCTION" ; |
3776 | case ExpressionType::CASE_EXPR: |
3777 | return "CASE_EXPR" ; |
3778 | case ExpressionType::OPERATOR_NULLIF: |
3779 | return "OPERATOR_NULLIF" ; |
3780 | case ExpressionType::OPERATOR_COALESCE: |
3781 | return "OPERATOR_COALESCE" ; |
3782 | case ExpressionType::ARRAY_EXTRACT: |
3783 | return "ARRAY_EXTRACT" ; |
3784 | case ExpressionType::ARRAY_SLICE: |
3785 | return "ARRAY_SLICE" ; |
3786 | case ExpressionType::STRUCT_EXTRACT: |
3787 | return "STRUCT_EXTRACT" ; |
3788 | case ExpressionType::ARRAY_CONSTRUCTOR: |
3789 | return "ARRAY_CONSTRUCTOR" ; |
3790 | case ExpressionType::ARROW: |
3791 | return "ARROW" ; |
3792 | case ExpressionType::SUBQUERY: |
3793 | return "SUBQUERY" ; |
3794 | case ExpressionType::STAR: |
3795 | return "STAR" ; |
3796 | case ExpressionType::TABLE_STAR: |
3797 | return "TABLE_STAR" ; |
3798 | case ExpressionType::PLACEHOLDER: |
3799 | return "PLACEHOLDER" ; |
3800 | case ExpressionType::COLUMN_REF: |
3801 | return "COLUMN_REF" ; |
3802 | case ExpressionType::FUNCTION_REF: |
3803 | return "FUNCTION_REF" ; |
3804 | case ExpressionType::TABLE_REF: |
3805 | return "TABLE_REF" ; |
3806 | case ExpressionType::CAST: |
3807 | return "CAST" ; |
3808 | case ExpressionType::BOUND_REF: |
3809 | return "BOUND_REF" ; |
3810 | case ExpressionType::BOUND_COLUMN_REF: |
3811 | return "BOUND_COLUMN_REF" ; |
3812 | case ExpressionType::BOUND_UNNEST: |
3813 | return "BOUND_UNNEST" ; |
3814 | case ExpressionType::COLLATE: |
3815 | return "COLLATE" ; |
3816 | case ExpressionType::LAMBDA: |
3817 | return "LAMBDA" ; |
3818 | case ExpressionType::POSITIONAL_REFERENCE: |
3819 | return "POSITIONAL_REFERENCE" ; |
3820 | case ExpressionType::BOUND_LAMBDA_REF: |
3821 | return "BOUND_LAMBDA_REF" ; |
3822 | default: |
3823 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
3824 | } |
3825 | } |
3826 | |
3827 | template <> |
3828 | ExpressionType EnumUtil::FromString<ExpressionType>(const char *value) { |
3829 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
3830 | return ExpressionType::INVALID; |
3831 | } |
3832 | if (StringUtil::Equals(s1: value, s2: "OPERATOR_CAST" )) { |
3833 | return ExpressionType::OPERATOR_CAST; |
3834 | } |
3835 | if (StringUtil::Equals(s1: value, s2: "OPERATOR_NOT" )) { |
3836 | return ExpressionType::OPERATOR_NOT; |
3837 | } |
3838 | if (StringUtil::Equals(s1: value, s2: "OPERATOR_IS_NULL" )) { |
3839 | return ExpressionType::OPERATOR_IS_NULL; |
3840 | } |
3841 | if (StringUtil::Equals(s1: value, s2: "OPERATOR_IS_NOT_NULL" )) { |
3842 | return ExpressionType::OPERATOR_IS_NOT_NULL; |
3843 | } |
3844 | if (StringUtil::Equals(s1: value, s2: "COMPARE_EQUAL" )) { |
3845 | return ExpressionType::COMPARE_EQUAL; |
3846 | } |
3847 | if (StringUtil::Equals(s1: value, s2: "COMPARE_NOTEQUAL" )) { |
3848 | return ExpressionType::COMPARE_NOTEQUAL; |
3849 | } |
3850 | if (StringUtil::Equals(s1: value, s2: "COMPARE_LESSTHAN" )) { |
3851 | return ExpressionType::COMPARE_LESSTHAN; |
3852 | } |
3853 | if (StringUtil::Equals(s1: value, s2: "COMPARE_GREATERTHAN" )) { |
3854 | return ExpressionType::COMPARE_GREATERTHAN; |
3855 | } |
3856 | if (StringUtil::Equals(s1: value, s2: "COMPARE_LESSTHANOREQUALTO" )) { |
3857 | return ExpressionType::COMPARE_LESSTHANOREQUALTO; |
3858 | } |
3859 | if (StringUtil::Equals(s1: value, s2: "COMPARE_GREATERTHANOREQUALTO" )) { |
3860 | return ExpressionType::COMPARE_GREATERTHANOREQUALTO; |
3861 | } |
3862 | if (StringUtil::Equals(s1: value, s2: "COMPARE_IN" )) { |
3863 | return ExpressionType::COMPARE_IN; |
3864 | } |
3865 | if (StringUtil::Equals(s1: value, s2: "COMPARE_NOT_IN" )) { |
3866 | return ExpressionType::COMPARE_NOT_IN; |
3867 | } |
3868 | if (StringUtil::Equals(s1: value, s2: "COMPARE_DISTINCT_FROM" )) { |
3869 | return ExpressionType::COMPARE_DISTINCT_FROM; |
3870 | } |
3871 | if (StringUtil::Equals(s1: value, s2: "COMPARE_BETWEEN" )) { |
3872 | return ExpressionType::COMPARE_BETWEEN; |
3873 | } |
3874 | if (StringUtil::Equals(s1: value, s2: "COMPARE_NOT_BETWEEN" )) { |
3875 | return ExpressionType::COMPARE_NOT_BETWEEN; |
3876 | } |
3877 | if (StringUtil::Equals(s1: value, s2: "COMPARE_NOT_DISTINCT_FROM" )) { |
3878 | return ExpressionType::COMPARE_NOT_DISTINCT_FROM; |
3879 | } |
3880 | if (StringUtil::Equals(s1: value, s2: "CONJUNCTION_AND" )) { |
3881 | return ExpressionType::CONJUNCTION_AND; |
3882 | } |
3883 | if (StringUtil::Equals(s1: value, s2: "CONJUNCTION_OR" )) { |
3884 | return ExpressionType::CONJUNCTION_OR; |
3885 | } |
3886 | if (StringUtil::Equals(s1: value, s2: "VALUE_CONSTANT" )) { |
3887 | return ExpressionType::VALUE_CONSTANT; |
3888 | } |
3889 | if (StringUtil::Equals(s1: value, s2: "VALUE_PARAMETER" )) { |
3890 | return ExpressionType::VALUE_PARAMETER; |
3891 | } |
3892 | if (StringUtil::Equals(s1: value, s2: "VALUE_TUPLE" )) { |
3893 | return ExpressionType::VALUE_TUPLE; |
3894 | } |
3895 | if (StringUtil::Equals(s1: value, s2: "VALUE_TUPLE_ADDRESS" )) { |
3896 | return ExpressionType::VALUE_TUPLE_ADDRESS; |
3897 | } |
3898 | if (StringUtil::Equals(s1: value, s2: "VALUE_NULL" )) { |
3899 | return ExpressionType::VALUE_NULL; |
3900 | } |
3901 | if (StringUtil::Equals(s1: value, s2: "VALUE_VECTOR" )) { |
3902 | return ExpressionType::VALUE_VECTOR; |
3903 | } |
3904 | if (StringUtil::Equals(s1: value, s2: "VALUE_SCALAR" )) { |
3905 | return ExpressionType::VALUE_SCALAR; |
3906 | } |
3907 | if (StringUtil::Equals(s1: value, s2: "VALUE_DEFAULT" )) { |
3908 | return ExpressionType::VALUE_DEFAULT; |
3909 | } |
3910 | if (StringUtil::Equals(s1: value, s2: "AGGREGATE" )) { |
3911 | return ExpressionType::AGGREGATE; |
3912 | } |
3913 | if (StringUtil::Equals(s1: value, s2: "BOUND_AGGREGATE" )) { |
3914 | return ExpressionType::BOUND_AGGREGATE; |
3915 | } |
3916 | if (StringUtil::Equals(s1: value, s2: "GROUPING_FUNCTION" )) { |
3917 | return ExpressionType::GROUPING_FUNCTION; |
3918 | } |
3919 | if (StringUtil::Equals(s1: value, s2: "WINDOW_AGGREGATE" )) { |
3920 | return ExpressionType::WINDOW_AGGREGATE; |
3921 | } |
3922 | if (StringUtil::Equals(s1: value, s2: "WINDOW_RANK" )) { |
3923 | return ExpressionType::WINDOW_RANK; |
3924 | } |
3925 | if (StringUtil::Equals(s1: value, s2: "WINDOW_RANK_DENSE" )) { |
3926 | return ExpressionType::WINDOW_RANK_DENSE; |
3927 | } |
3928 | if (StringUtil::Equals(s1: value, s2: "WINDOW_NTILE" )) { |
3929 | return ExpressionType::WINDOW_NTILE; |
3930 | } |
3931 | if (StringUtil::Equals(s1: value, s2: "WINDOW_PERCENT_RANK" )) { |
3932 | return ExpressionType::WINDOW_PERCENT_RANK; |
3933 | } |
3934 | if (StringUtil::Equals(s1: value, s2: "WINDOW_CUME_DIST" )) { |
3935 | return ExpressionType::WINDOW_CUME_DIST; |
3936 | } |
3937 | if (StringUtil::Equals(s1: value, s2: "WINDOW_ROW_NUMBER" )) { |
3938 | return ExpressionType::WINDOW_ROW_NUMBER; |
3939 | } |
3940 | if (StringUtil::Equals(s1: value, s2: "WINDOW_FIRST_VALUE" )) { |
3941 | return ExpressionType::WINDOW_FIRST_VALUE; |
3942 | } |
3943 | if (StringUtil::Equals(s1: value, s2: "WINDOW_LAST_VALUE" )) { |
3944 | return ExpressionType::WINDOW_LAST_VALUE; |
3945 | } |
3946 | if (StringUtil::Equals(s1: value, s2: "WINDOW_LEAD" )) { |
3947 | return ExpressionType::WINDOW_LEAD; |
3948 | } |
3949 | if (StringUtil::Equals(s1: value, s2: "WINDOW_LAG" )) { |
3950 | return ExpressionType::WINDOW_LAG; |
3951 | } |
3952 | if (StringUtil::Equals(s1: value, s2: "WINDOW_NTH_VALUE" )) { |
3953 | return ExpressionType::WINDOW_NTH_VALUE; |
3954 | } |
3955 | if (StringUtil::Equals(s1: value, s2: "FUNCTION" )) { |
3956 | return ExpressionType::FUNCTION; |
3957 | } |
3958 | if (StringUtil::Equals(s1: value, s2: "BOUND_FUNCTION" )) { |
3959 | return ExpressionType::BOUND_FUNCTION; |
3960 | } |
3961 | if (StringUtil::Equals(s1: value, s2: "CASE_EXPR" )) { |
3962 | return ExpressionType::CASE_EXPR; |
3963 | } |
3964 | if (StringUtil::Equals(s1: value, s2: "OPERATOR_NULLIF" )) { |
3965 | return ExpressionType::OPERATOR_NULLIF; |
3966 | } |
3967 | if (StringUtil::Equals(s1: value, s2: "OPERATOR_COALESCE" )) { |
3968 | return ExpressionType::OPERATOR_COALESCE; |
3969 | } |
3970 | if (StringUtil::Equals(s1: value, s2: "ARRAY_EXTRACT" )) { |
3971 | return ExpressionType::ARRAY_EXTRACT; |
3972 | } |
3973 | if (StringUtil::Equals(s1: value, s2: "ARRAY_SLICE" )) { |
3974 | return ExpressionType::ARRAY_SLICE; |
3975 | } |
3976 | if (StringUtil::Equals(s1: value, s2: "STRUCT_EXTRACT" )) { |
3977 | return ExpressionType::STRUCT_EXTRACT; |
3978 | } |
3979 | if (StringUtil::Equals(s1: value, s2: "ARRAY_CONSTRUCTOR" )) { |
3980 | return ExpressionType::ARRAY_CONSTRUCTOR; |
3981 | } |
3982 | if (StringUtil::Equals(s1: value, s2: "ARROW" )) { |
3983 | return ExpressionType::ARROW; |
3984 | } |
3985 | if (StringUtil::Equals(s1: value, s2: "SUBQUERY" )) { |
3986 | return ExpressionType::SUBQUERY; |
3987 | } |
3988 | if (StringUtil::Equals(s1: value, s2: "STAR" )) { |
3989 | return ExpressionType::STAR; |
3990 | } |
3991 | if (StringUtil::Equals(s1: value, s2: "TABLE_STAR" )) { |
3992 | return ExpressionType::TABLE_STAR; |
3993 | } |
3994 | if (StringUtil::Equals(s1: value, s2: "PLACEHOLDER" )) { |
3995 | return ExpressionType::PLACEHOLDER; |
3996 | } |
3997 | if (StringUtil::Equals(s1: value, s2: "COLUMN_REF" )) { |
3998 | return ExpressionType::COLUMN_REF; |
3999 | } |
4000 | if (StringUtil::Equals(s1: value, s2: "FUNCTION_REF" )) { |
4001 | return ExpressionType::FUNCTION_REF; |
4002 | } |
4003 | if (StringUtil::Equals(s1: value, s2: "TABLE_REF" )) { |
4004 | return ExpressionType::TABLE_REF; |
4005 | } |
4006 | if (StringUtil::Equals(s1: value, s2: "CAST" )) { |
4007 | return ExpressionType::CAST; |
4008 | } |
4009 | if (StringUtil::Equals(s1: value, s2: "BOUND_REF" )) { |
4010 | return ExpressionType::BOUND_REF; |
4011 | } |
4012 | if (StringUtil::Equals(s1: value, s2: "BOUND_COLUMN_REF" )) { |
4013 | return ExpressionType::BOUND_COLUMN_REF; |
4014 | } |
4015 | if (StringUtil::Equals(s1: value, s2: "BOUND_UNNEST" )) { |
4016 | return ExpressionType::BOUND_UNNEST; |
4017 | } |
4018 | if (StringUtil::Equals(s1: value, s2: "COLLATE" )) { |
4019 | return ExpressionType::COLLATE; |
4020 | } |
4021 | if (StringUtil::Equals(s1: value, s2: "LAMBDA" )) { |
4022 | return ExpressionType::LAMBDA; |
4023 | } |
4024 | if (StringUtil::Equals(s1: value, s2: "POSITIONAL_REFERENCE" )) { |
4025 | return ExpressionType::POSITIONAL_REFERENCE; |
4026 | } |
4027 | if (StringUtil::Equals(s1: value, s2: "BOUND_LAMBDA_REF" )) { |
4028 | return ExpressionType::BOUND_LAMBDA_REF; |
4029 | } |
4030 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4031 | } |
4032 | |
4033 | template <> |
4034 | const char *EnumUtil::ToChars<ExpressionClass>(ExpressionClass value) { |
4035 | switch (value) { |
4036 | case ExpressionClass::INVALID: |
4037 | return "INVALID" ; |
4038 | case ExpressionClass::AGGREGATE: |
4039 | return "AGGREGATE" ; |
4040 | case ExpressionClass::CASE: |
4041 | return "CASE" ; |
4042 | case ExpressionClass::CAST: |
4043 | return "CAST" ; |
4044 | case ExpressionClass::COLUMN_REF: |
4045 | return "COLUMN_REF" ; |
4046 | case ExpressionClass::COMPARISON: |
4047 | return "COMPARISON" ; |
4048 | case ExpressionClass::CONJUNCTION: |
4049 | return "CONJUNCTION" ; |
4050 | case ExpressionClass::CONSTANT: |
4051 | return "CONSTANT" ; |
4052 | case ExpressionClass::DEFAULT: |
4053 | return "DEFAULT" ; |
4054 | case ExpressionClass::FUNCTION: |
4055 | return "FUNCTION" ; |
4056 | case ExpressionClass::OPERATOR: |
4057 | return "OPERATOR" ; |
4058 | case ExpressionClass::STAR: |
4059 | return "STAR" ; |
4060 | case ExpressionClass::SUBQUERY: |
4061 | return "SUBQUERY" ; |
4062 | case ExpressionClass::WINDOW: |
4063 | return "WINDOW" ; |
4064 | case ExpressionClass::PARAMETER: |
4065 | return "PARAMETER" ; |
4066 | case ExpressionClass::COLLATE: |
4067 | return "COLLATE" ; |
4068 | case ExpressionClass::LAMBDA: |
4069 | return "LAMBDA" ; |
4070 | case ExpressionClass::POSITIONAL_REFERENCE: |
4071 | return "POSITIONAL_REFERENCE" ; |
4072 | case ExpressionClass::BETWEEN: |
4073 | return "BETWEEN" ; |
4074 | case ExpressionClass::BOUND_AGGREGATE: |
4075 | return "BOUND_AGGREGATE" ; |
4076 | case ExpressionClass::BOUND_CASE: |
4077 | return "BOUND_CASE" ; |
4078 | case ExpressionClass::BOUND_CAST: |
4079 | return "BOUND_CAST" ; |
4080 | case ExpressionClass::BOUND_COLUMN_REF: |
4081 | return "BOUND_COLUMN_REF" ; |
4082 | case ExpressionClass::BOUND_COMPARISON: |
4083 | return "BOUND_COMPARISON" ; |
4084 | case ExpressionClass::BOUND_CONJUNCTION: |
4085 | return "BOUND_CONJUNCTION" ; |
4086 | case ExpressionClass::BOUND_CONSTANT: |
4087 | return "BOUND_CONSTANT" ; |
4088 | case ExpressionClass::BOUND_DEFAULT: |
4089 | return "BOUND_DEFAULT" ; |
4090 | case ExpressionClass::BOUND_FUNCTION: |
4091 | return "BOUND_FUNCTION" ; |
4092 | case ExpressionClass::BOUND_OPERATOR: |
4093 | return "BOUND_OPERATOR" ; |
4094 | case ExpressionClass::BOUND_PARAMETER: |
4095 | return "BOUND_PARAMETER" ; |
4096 | case ExpressionClass::BOUND_REF: |
4097 | return "BOUND_REF" ; |
4098 | case ExpressionClass::BOUND_SUBQUERY: |
4099 | return "BOUND_SUBQUERY" ; |
4100 | case ExpressionClass::BOUND_WINDOW: |
4101 | return "BOUND_WINDOW" ; |
4102 | case ExpressionClass::BOUND_BETWEEN: |
4103 | return "BOUND_BETWEEN" ; |
4104 | case ExpressionClass::BOUND_UNNEST: |
4105 | return "BOUND_UNNEST" ; |
4106 | case ExpressionClass::BOUND_LAMBDA: |
4107 | return "BOUND_LAMBDA" ; |
4108 | case ExpressionClass::BOUND_LAMBDA_REF: |
4109 | return "BOUND_LAMBDA_REF" ; |
4110 | case ExpressionClass::BOUND_EXPRESSION: |
4111 | return "BOUND_EXPRESSION" ; |
4112 | default: |
4113 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4114 | } |
4115 | } |
4116 | |
4117 | template <> |
4118 | ExpressionClass EnumUtil::FromString<ExpressionClass>(const char *value) { |
4119 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
4120 | return ExpressionClass::INVALID; |
4121 | } |
4122 | if (StringUtil::Equals(s1: value, s2: "AGGREGATE" )) { |
4123 | return ExpressionClass::AGGREGATE; |
4124 | } |
4125 | if (StringUtil::Equals(s1: value, s2: "CASE" )) { |
4126 | return ExpressionClass::CASE; |
4127 | } |
4128 | if (StringUtil::Equals(s1: value, s2: "CAST" )) { |
4129 | return ExpressionClass::CAST; |
4130 | } |
4131 | if (StringUtil::Equals(s1: value, s2: "COLUMN_REF" )) { |
4132 | return ExpressionClass::COLUMN_REF; |
4133 | } |
4134 | if (StringUtil::Equals(s1: value, s2: "COMPARISON" )) { |
4135 | return ExpressionClass::COMPARISON; |
4136 | } |
4137 | if (StringUtil::Equals(s1: value, s2: "CONJUNCTION" )) { |
4138 | return ExpressionClass::CONJUNCTION; |
4139 | } |
4140 | if (StringUtil::Equals(s1: value, s2: "CONSTANT" )) { |
4141 | return ExpressionClass::CONSTANT; |
4142 | } |
4143 | if (StringUtil::Equals(s1: value, s2: "DEFAULT" )) { |
4144 | return ExpressionClass::DEFAULT; |
4145 | } |
4146 | if (StringUtil::Equals(s1: value, s2: "FUNCTION" )) { |
4147 | return ExpressionClass::FUNCTION; |
4148 | } |
4149 | if (StringUtil::Equals(s1: value, s2: "OPERATOR" )) { |
4150 | return ExpressionClass::OPERATOR; |
4151 | } |
4152 | if (StringUtil::Equals(s1: value, s2: "STAR" )) { |
4153 | return ExpressionClass::STAR; |
4154 | } |
4155 | if (StringUtil::Equals(s1: value, s2: "SUBQUERY" )) { |
4156 | return ExpressionClass::SUBQUERY; |
4157 | } |
4158 | if (StringUtil::Equals(s1: value, s2: "WINDOW" )) { |
4159 | return ExpressionClass::WINDOW; |
4160 | } |
4161 | if (StringUtil::Equals(s1: value, s2: "PARAMETER" )) { |
4162 | return ExpressionClass::PARAMETER; |
4163 | } |
4164 | if (StringUtil::Equals(s1: value, s2: "COLLATE" )) { |
4165 | return ExpressionClass::COLLATE; |
4166 | } |
4167 | if (StringUtil::Equals(s1: value, s2: "LAMBDA" )) { |
4168 | return ExpressionClass::LAMBDA; |
4169 | } |
4170 | if (StringUtil::Equals(s1: value, s2: "POSITIONAL_REFERENCE" )) { |
4171 | return ExpressionClass::POSITIONAL_REFERENCE; |
4172 | } |
4173 | if (StringUtil::Equals(s1: value, s2: "BETWEEN" )) { |
4174 | return ExpressionClass::BETWEEN; |
4175 | } |
4176 | if (StringUtil::Equals(s1: value, s2: "BOUND_AGGREGATE" )) { |
4177 | return ExpressionClass::BOUND_AGGREGATE; |
4178 | } |
4179 | if (StringUtil::Equals(s1: value, s2: "BOUND_CASE" )) { |
4180 | return ExpressionClass::BOUND_CASE; |
4181 | } |
4182 | if (StringUtil::Equals(s1: value, s2: "BOUND_CAST" )) { |
4183 | return ExpressionClass::BOUND_CAST; |
4184 | } |
4185 | if (StringUtil::Equals(s1: value, s2: "BOUND_COLUMN_REF" )) { |
4186 | return ExpressionClass::BOUND_COLUMN_REF; |
4187 | } |
4188 | if (StringUtil::Equals(s1: value, s2: "BOUND_COMPARISON" )) { |
4189 | return ExpressionClass::BOUND_COMPARISON; |
4190 | } |
4191 | if (StringUtil::Equals(s1: value, s2: "BOUND_CONJUNCTION" )) { |
4192 | return ExpressionClass::BOUND_CONJUNCTION; |
4193 | } |
4194 | if (StringUtil::Equals(s1: value, s2: "BOUND_CONSTANT" )) { |
4195 | return ExpressionClass::BOUND_CONSTANT; |
4196 | } |
4197 | if (StringUtil::Equals(s1: value, s2: "BOUND_DEFAULT" )) { |
4198 | return ExpressionClass::BOUND_DEFAULT; |
4199 | } |
4200 | if (StringUtil::Equals(s1: value, s2: "BOUND_FUNCTION" )) { |
4201 | return ExpressionClass::BOUND_FUNCTION; |
4202 | } |
4203 | if (StringUtil::Equals(s1: value, s2: "BOUND_OPERATOR" )) { |
4204 | return ExpressionClass::BOUND_OPERATOR; |
4205 | } |
4206 | if (StringUtil::Equals(s1: value, s2: "BOUND_PARAMETER" )) { |
4207 | return ExpressionClass::BOUND_PARAMETER; |
4208 | } |
4209 | if (StringUtil::Equals(s1: value, s2: "BOUND_REF" )) { |
4210 | return ExpressionClass::BOUND_REF; |
4211 | } |
4212 | if (StringUtil::Equals(s1: value, s2: "BOUND_SUBQUERY" )) { |
4213 | return ExpressionClass::BOUND_SUBQUERY; |
4214 | } |
4215 | if (StringUtil::Equals(s1: value, s2: "BOUND_WINDOW" )) { |
4216 | return ExpressionClass::BOUND_WINDOW; |
4217 | } |
4218 | if (StringUtil::Equals(s1: value, s2: "BOUND_BETWEEN" )) { |
4219 | return ExpressionClass::BOUND_BETWEEN; |
4220 | } |
4221 | if (StringUtil::Equals(s1: value, s2: "BOUND_UNNEST" )) { |
4222 | return ExpressionClass::BOUND_UNNEST; |
4223 | } |
4224 | if (StringUtil::Equals(s1: value, s2: "BOUND_LAMBDA" )) { |
4225 | return ExpressionClass::BOUND_LAMBDA; |
4226 | } |
4227 | if (StringUtil::Equals(s1: value, s2: "BOUND_LAMBDA_REF" )) { |
4228 | return ExpressionClass::BOUND_LAMBDA_REF; |
4229 | } |
4230 | if (StringUtil::Equals(s1: value, s2: "BOUND_EXPRESSION" )) { |
4231 | return ExpressionClass::BOUND_EXPRESSION; |
4232 | } |
4233 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4234 | } |
4235 | |
4236 | template <> |
4237 | const char *EnumUtil::ToChars<PendingExecutionResult>(PendingExecutionResult value) { |
4238 | switch (value) { |
4239 | case PendingExecutionResult::RESULT_READY: |
4240 | return "RESULT_READY" ; |
4241 | case PendingExecutionResult::RESULT_NOT_READY: |
4242 | return "RESULT_NOT_READY" ; |
4243 | case PendingExecutionResult::EXECUTION_ERROR: |
4244 | return "EXECUTION_ERROR" ; |
4245 | default: |
4246 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4247 | } |
4248 | } |
4249 | |
4250 | template <> |
4251 | PendingExecutionResult EnumUtil::FromString<PendingExecutionResult>(const char *value) { |
4252 | if (StringUtil::Equals(s1: value, s2: "RESULT_READY" )) { |
4253 | return PendingExecutionResult::RESULT_READY; |
4254 | } |
4255 | if (StringUtil::Equals(s1: value, s2: "RESULT_NOT_READY" )) { |
4256 | return PendingExecutionResult::RESULT_NOT_READY; |
4257 | } |
4258 | if (StringUtil::Equals(s1: value, s2: "EXECUTION_ERROR" )) { |
4259 | return PendingExecutionResult::EXECUTION_ERROR; |
4260 | } |
4261 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4262 | } |
4263 | |
4264 | template <> |
4265 | const char *EnumUtil::ToChars<WindowAggregationMode>(WindowAggregationMode value) { |
4266 | switch (value) { |
4267 | case WindowAggregationMode::WINDOW: |
4268 | return "WINDOW" ; |
4269 | case WindowAggregationMode::COMBINE: |
4270 | return "COMBINE" ; |
4271 | case WindowAggregationMode::SEPARATE: |
4272 | return "SEPARATE" ; |
4273 | default: |
4274 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4275 | } |
4276 | } |
4277 | |
4278 | template <> |
4279 | WindowAggregationMode EnumUtil::FromString<WindowAggregationMode>(const char *value) { |
4280 | if (StringUtil::Equals(s1: value, s2: "WINDOW" )) { |
4281 | return WindowAggregationMode::WINDOW; |
4282 | } |
4283 | if (StringUtil::Equals(s1: value, s2: "COMBINE" )) { |
4284 | return WindowAggregationMode::COMBINE; |
4285 | } |
4286 | if (StringUtil::Equals(s1: value, s2: "SEPARATE" )) { |
4287 | return WindowAggregationMode::SEPARATE; |
4288 | } |
4289 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4290 | } |
4291 | |
4292 | template <> |
4293 | const char *EnumUtil::ToChars<SubqueryType>(SubqueryType value) { |
4294 | switch (value) { |
4295 | case SubqueryType::INVALID: |
4296 | return "INVALID" ; |
4297 | case SubqueryType::SCALAR: |
4298 | return "SCALAR" ; |
4299 | case SubqueryType::EXISTS: |
4300 | return "EXISTS" ; |
4301 | case SubqueryType::NOT_EXISTS: |
4302 | return "NOT_EXISTS" ; |
4303 | case SubqueryType::ANY: |
4304 | return "ANY" ; |
4305 | default: |
4306 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4307 | } |
4308 | } |
4309 | |
4310 | template <> |
4311 | SubqueryType EnumUtil::FromString<SubqueryType>(const char *value) { |
4312 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
4313 | return SubqueryType::INVALID; |
4314 | } |
4315 | if (StringUtil::Equals(s1: value, s2: "SCALAR" )) { |
4316 | return SubqueryType::SCALAR; |
4317 | } |
4318 | if (StringUtil::Equals(s1: value, s2: "EXISTS" )) { |
4319 | return SubqueryType::EXISTS; |
4320 | } |
4321 | if (StringUtil::Equals(s1: value, s2: "NOT_EXISTS" )) { |
4322 | return SubqueryType::NOT_EXISTS; |
4323 | } |
4324 | if (StringUtil::Equals(s1: value, s2: "ANY" )) { |
4325 | return SubqueryType::ANY; |
4326 | } |
4327 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4328 | } |
4329 | |
4330 | template <> |
4331 | const char *EnumUtil::ToChars<OrderType>(OrderType value) { |
4332 | switch (value) { |
4333 | case OrderType::INVALID: |
4334 | return "INVALID" ; |
4335 | case OrderType::ORDER_DEFAULT: |
4336 | return "ORDER_DEFAULT" ; |
4337 | case OrderType::ASCENDING: |
4338 | return "ASCENDING" ; |
4339 | case OrderType::DESCENDING: |
4340 | return "DESCENDING" ; |
4341 | default: |
4342 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4343 | } |
4344 | } |
4345 | |
4346 | template <> |
4347 | OrderType EnumUtil::FromString<OrderType>(const char *value) { |
4348 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
4349 | return OrderType::INVALID; |
4350 | } |
4351 | if (StringUtil::Equals(s1: value, s2: "ORDER_DEFAULT" ) || StringUtil::Equals(s1: value, s2: "DEFAULT" )) { |
4352 | return OrderType::ORDER_DEFAULT; |
4353 | } |
4354 | if (StringUtil::Equals(s1: value, s2: "ASCENDING" ) || StringUtil::Equals(s1: value, s2: "ASC" )) { |
4355 | return OrderType::ASCENDING; |
4356 | } |
4357 | if (StringUtil::Equals(s1: value, s2: "DESCENDING" ) || StringUtil::Equals(s1: value, s2: "DESC" )) { |
4358 | return OrderType::DESCENDING; |
4359 | } |
4360 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4361 | } |
4362 | |
4363 | template <> |
4364 | const char *EnumUtil::ToChars<OrderByNullType>(OrderByNullType value) { |
4365 | switch (value) { |
4366 | case OrderByNullType::INVALID: |
4367 | return "INVALID" ; |
4368 | case OrderByNullType::ORDER_DEFAULT: |
4369 | return "ORDER_DEFAULT" ; |
4370 | case OrderByNullType::NULLS_FIRST: |
4371 | return "NULLS_FIRST" ; |
4372 | case OrderByNullType::NULLS_LAST: |
4373 | return "NULLS_LAST" ; |
4374 | default: |
4375 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4376 | } |
4377 | } |
4378 | |
4379 | template <> |
4380 | OrderByNullType EnumUtil::FromString<OrderByNullType>(const char *value) { |
4381 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
4382 | return OrderByNullType::INVALID; |
4383 | } |
4384 | if (StringUtil::Equals(s1: value, s2: "ORDER_DEFAULT" ) || StringUtil::Equals(s1: value, s2: "DEFAULT" )) { |
4385 | return OrderByNullType::ORDER_DEFAULT; |
4386 | } |
4387 | if (StringUtil::Equals(s1: value, s2: "NULLS_FIRST" ) || StringUtil::Equals(s1: value, s2: "NULLS FIRST" )) { |
4388 | return OrderByNullType::NULLS_FIRST; |
4389 | } |
4390 | if (StringUtil::Equals(s1: value, s2: "NULLS_LAST" ) || StringUtil::Equals(s1: value, s2: "NULLS LAST" )) { |
4391 | return OrderByNullType::NULLS_LAST; |
4392 | } |
4393 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4394 | } |
4395 | |
4396 | template <> |
4397 | const char *EnumUtil::ToChars<DefaultOrderByNullType>(DefaultOrderByNullType value) { |
4398 | switch (value) { |
4399 | case DefaultOrderByNullType::INVALID: |
4400 | return "INVALID" ; |
4401 | case DefaultOrderByNullType::NULLS_FIRST: |
4402 | return "NULLS_FIRST" ; |
4403 | case DefaultOrderByNullType::NULLS_LAST: |
4404 | return "NULLS_LAST" ; |
4405 | case DefaultOrderByNullType::NULLS_FIRST_ON_ASC_LAST_ON_DESC: |
4406 | return "NULLS_FIRST_ON_ASC_LAST_ON_DESC" ; |
4407 | case DefaultOrderByNullType::NULLS_LAST_ON_ASC_FIRST_ON_DESC: |
4408 | return "NULLS_LAST_ON_ASC_FIRST_ON_DESC" ; |
4409 | default: |
4410 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4411 | } |
4412 | } |
4413 | |
4414 | template <> |
4415 | DefaultOrderByNullType EnumUtil::FromString<DefaultOrderByNullType>(const char *value) { |
4416 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
4417 | return DefaultOrderByNullType::INVALID; |
4418 | } |
4419 | if (StringUtil::Equals(s1: value, s2: "NULLS_FIRST" )) { |
4420 | return DefaultOrderByNullType::NULLS_FIRST; |
4421 | } |
4422 | if (StringUtil::Equals(s1: value, s2: "NULLS_LAST" )) { |
4423 | return DefaultOrderByNullType::NULLS_LAST; |
4424 | } |
4425 | if (StringUtil::Equals(s1: value, s2: "NULLS_FIRST_ON_ASC_LAST_ON_DESC" )) { |
4426 | return DefaultOrderByNullType::NULLS_FIRST_ON_ASC_LAST_ON_DESC; |
4427 | } |
4428 | if (StringUtil::Equals(s1: value, s2: "NULLS_LAST_ON_ASC_FIRST_ON_DESC" )) { |
4429 | return DefaultOrderByNullType::NULLS_LAST_ON_ASC_FIRST_ON_DESC; |
4430 | } |
4431 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4432 | } |
4433 | |
4434 | template <> |
4435 | const char *EnumUtil::ToChars<DatePartSpecifier>(DatePartSpecifier value) { |
4436 | switch (value) { |
4437 | case DatePartSpecifier::YEAR: |
4438 | return "YEAR" ; |
4439 | case DatePartSpecifier::MONTH: |
4440 | return "MONTH" ; |
4441 | case DatePartSpecifier::DAY: |
4442 | return "DAY" ; |
4443 | case DatePartSpecifier::DECADE: |
4444 | return "DECADE" ; |
4445 | case DatePartSpecifier::CENTURY: |
4446 | return "CENTURY" ; |
4447 | case DatePartSpecifier::MILLENNIUM: |
4448 | return "MILLENNIUM" ; |
4449 | case DatePartSpecifier::MICROSECONDS: |
4450 | return "MICROSECONDS" ; |
4451 | case DatePartSpecifier::MILLISECONDS: |
4452 | return "MILLISECONDS" ; |
4453 | case DatePartSpecifier::SECOND: |
4454 | return "SECOND" ; |
4455 | case DatePartSpecifier::MINUTE: |
4456 | return "MINUTE" ; |
4457 | case DatePartSpecifier::HOUR: |
4458 | return "HOUR" ; |
4459 | case DatePartSpecifier::EPOCH: |
4460 | return "EPOCH" ; |
4461 | case DatePartSpecifier::DOW: |
4462 | return "DOW" ; |
4463 | case DatePartSpecifier::ISODOW: |
4464 | return "ISODOW" ; |
4465 | case DatePartSpecifier::WEEK: |
4466 | return "WEEK" ; |
4467 | case DatePartSpecifier::ISOYEAR: |
4468 | return "ISOYEAR" ; |
4469 | case DatePartSpecifier::QUARTER: |
4470 | return "QUARTER" ; |
4471 | case DatePartSpecifier::DOY: |
4472 | return "DOY" ; |
4473 | case DatePartSpecifier::YEARWEEK: |
4474 | return "YEARWEEK" ; |
4475 | case DatePartSpecifier::ERA: |
4476 | return "ERA" ; |
4477 | case DatePartSpecifier::TIMEZONE: |
4478 | return "TIMEZONE" ; |
4479 | case DatePartSpecifier::TIMEZONE_HOUR: |
4480 | return "TIMEZONE_HOUR" ; |
4481 | case DatePartSpecifier::TIMEZONE_MINUTE: |
4482 | return "TIMEZONE_MINUTE" ; |
4483 | default: |
4484 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4485 | } |
4486 | } |
4487 | |
4488 | template <> |
4489 | DatePartSpecifier EnumUtil::FromString<DatePartSpecifier>(const char *value) { |
4490 | if (StringUtil::Equals(s1: value, s2: "YEAR" )) { |
4491 | return DatePartSpecifier::YEAR; |
4492 | } |
4493 | if (StringUtil::Equals(s1: value, s2: "MONTH" )) { |
4494 | return DatePartSpecifier::MONTH; |
4495 | } |
4496 | if (StringUtil::Equals(s1: value, s2: "DAY" )) { |
4497 | return DatePartSpecifier::DAY; |
4498 | } |
4499 | if (StringUtil::Equals(s1: value, s2: "DECADE" )) { |
4500 | return DatePartSpecifier::DECADE; |
4501 | } |
4502 | if (StringUtil::Equals(s1: value, s2: "CENTURY" )) { |
4503 | return DatePartSpecifier::CENTURY; |
4504 | } |
4505 | if (StringUtil::Equals(s1: value, s2: "MILLENNIUM" )) { |
4506 | return DatePartSpecifier::MILLENNIUM; |
4507 | } |
4508 | if (StringUtil::Equals(s1: value, s2: "MICROSECONDS" )) { |
4509 | return DatePartSpecifier::MICROSECONDS; |
4510 | } |
4511 | if (StringUtil::Equals(s1: value, s2: "MILLISECONDS" )) { |
4512 | return DatePartSpecifier::MILLISECONDS; |
4513 | } |
4514 | if (StringUtil::Equals(s1: value, s2: "SECOND" )) { |
4515 | return DatePartSpecifier::SECOND; |
4516 | } |
4517 | if (StringUtil::Equals(s1: value, s2: "MINUTE" )) { |
4518 | return DatePartSpecifier::MINUTE; |
4519 | } |
4520 | if (StringUtil::Equals(s1: value, s2: "HOUR" )) { |
4521 | return DatePartSpecifier::HOUR; |
4522 | } |
4523 | if (StringUtil::Equals(s1: value, s2: "EPOCH" )) { |
4524 | return DatePartSpecifier::EPOCH; |
4525 | } |
4526 | if (StringUtil::Equals(s1: value, s2: "DOW" )) { |
4527 | return DatePartSpecifier::DOW; |
4528 | } |
4529 | if (StringUtil::Equals(s1: value, s2: "ISODOW" )) { |
4530 | return DatePartSpecifier::ISODOW; |
4531 | } |
4532 | if (StringUtil::Equals(s1: value, s2: "WEEK" )) { |
4533 | return DatePartSpecifier::WEEK; |
4534 | } |
4535 | if (StringUtil::Equals(s1: value, s2: "ISOYEAR" )) { |
4536 | return DatePartSpecifier::ISOYEAR; |
4537 | } |
4538 | if (StringUtil::Equals(s1: value, s2: "QUARTER" )) { |
4539 | return DatePartSpecifier::QUARTER; |
4540 | } |
4541 | if (StringUtil::Equals(s1: value, s2: "DOY" )) { |
4542 | return DatePartSpecifier::DOY; |
4543 | } |
4544 | if (StringUtil::Equals(s1: value, s2: "YEARWEEK" )) { |
4545 | return DatePartSpecifier::YEARWEEK; |
4546 | } |
4547 | if (StringUtil::Equals(s1: value, s2: "ERA" )) { |
4548 | return DatePartSpecifier::ERA; |
4549 | } |
4550 | if (StringUtil::Equals(s1: value, s2: "TIMEZONE" )) { |
4551 | return DatePartSpecifier::TIMEZONE; |
4552 | } |
4553 | if (StringUtil::Equals(s1: value, s2: "TIMEZONE_HOUR" )) { |
4554 | return DatePartSpecifier::TIMEZONE_HOUR; |
4555 | } |
4556 | if (StringUtil::Equals(s1: value, s2: "TIMEZONE_MINUTE" )) { |
4557 | return DatePartSpecifier::TIMEZONE_MINUTE; |
4558 | } |
4559 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4560 | } |
4561 | |
4562 | template <> |
4563 | const char *EnumUtil::ToChars<OnEntryNotFound>(OnEntryNotFound value) { |
4564 | switch (value) { |
4565 | case OnEntryNotFound::THROW_EXCEPTION: |
4566 | return "THROW_EXCEPTION" ; |
4567 | case OnEntryNotFound::RETURN_NULL: |
4568 | return "RETURN_NULL" ; |
4569 | default: |
4570 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4571 | } |
4572 | } |
4573 | |
4574 | template <> |
4575 | OnEntryNotFound EnumUtil::FromString<OnEntryNotFound>(const char *value) { |
4576 | if (StringUtil::Equals(s1: value, s2: "THROW_EXCEPTION" )) { |
4577 | return OnEntryNotFound::THROW_EXCEPTION; |
4578 | } |
4579 | if (StringUtil::Equals(s1: value, s2: "RETURN_NULL" )) { |
4580 | return OnEntryNotFound::RETURN_NULL; |
4581 | } |
4582 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4583 | } |
4584 | |
4585 | template <> |
4586 | const char *EnumUtil::ToChars<LogicalOperatorType>(LogicalOperatorType value) { |
4587 | switch (value) { |
4588 | case LogicalOperatorType::LOGICAL_INVALID: |
4589 | return "LOGICAL_INVALID" ; |
4590 | case LogicalOperatorType::LOGICAL_PROJECTION: |
4591 | return "LOGICAL_PROJECTION" ; |
4592 | case LogicalOperatorType::LOGICAL_FILTER: |
4593 | return "LOGICAL_FILTER" ; |
4594 | case LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY: |
4595 | return "LOGICAL_AGGREGATE_AND_GROUP_BY" ; |
4596 | case LogicalOperatorType::LOGICAL_WINDOW: |
4597 | return "LOGICAL_WINDOW" ; |
4598 | case LogicalOperatorType::LOGICAL_UNNEST: |
4599 | return "LOGICAL_UNNEST" ; |
4600 | case LogicalOperatorType::LOGICAL_LIMIT: |
4601 | return "LOGICAL_LIMIT" ; |
4602 | case LogicalOperatorType::LOGICAL_ORDER_BY: |
4603 | return "LOGICAL_ORDER_BY" ; |
4604 | case LogicalOperatorType::LOGICAL_TOP_N: |
4605 | return "LOGICAL_TOP_N" ; |
4606 | case LogicalOperatorType::LOGICAL_COPY_TO_FILE: |
4607 | return "LOGICAL_COPY_TO_FILE" ; |
4608 | case LogicalOperatorType::LOGICAL_DISTINCT: |
4609 | return "LOGICAL_DISTINCT" ; |
4610 | case LogicalOperatorType::LOGICAL_SAMPLE: |
4611 | return "LOGICAL_SAMPLE" ; |
4612 | case LogicalOperatorType::LOGICAL_LIMIT_PERCENT: |
4613 | return "LOGICAL_LIMIT_PERCENT" ; |
4614 | case LogicalOperatorType::LOGICAL_PIVOT: |
4615 | return "LOGICAL_PIVOT" ; |
4616 | case LogicalOperatorType::LOGICAL_GET: |
4617 | return "LOGICAL_GET" ; |
4618 | case LogicalOperatorType::LOGICAL_CHUNK_GET: |
4619 | return "LOGICAL_CHUNK_GET" ; |
4620 | case LogicalOperatorType::LOGICAL_DELIM_GET: |
4621 | return "LOGICAL_DELIM_GET" ; |
4622 | case LogicalOperatorType::LOGICAL_EXPRESSION_GET: |
4623 | return "LOGICAL_EXPRESSION_GET" ; |
4624 | case LogicalOperatorType::LOGICAL_DUMMY_SCAN: |
4625 | return "LOGICAL_DUMMY_SCAN" ; |
4626 | case LogicalOperatorType::LOGICAL_EMPTY_RESULT: |
4627 | return "LOGICAL_EMPTY_RESULT" ; |
4628 | case LogicalOperatorType::LOGICAL_CTE_REF: |
4629 | return "LOGICAL_CTE_REF" ; |
4630 | case LogicalOperatorType::LOGICAL_JOIN: |
4631 | return "LOGICAL_JOIN" ; |
4632 | case LogicalOperatorType::LOGICAL_DELIM_JOIN: |
4633 | return "LOGICAL_DELIM_JOIN" ; |
4634 | case LogicalOperatorType::LOGICAL_COMPARISON_JOIN: |
4635 | return "LOGICAL_COMPARISON_JOIN" ; |
4636 | case LogicalOperatorType::LOGICAL_ANY_JOIN: |
4637 | return "LOGICAL_ANY_JOIN" ; |
4638 | case LogicalOperatorType::LOGICAL_CROSS_PRODUCT: |
4639 | return "LOGICAL_CROSS_PRODUCT" ; |
4640 | case LogicalOperatorType::LOGICAL_POSITIONAL_JOIN: |
4641 | return "LOGICAL_POSITIONAL_JOIN" ; |
4642 | case LogicalOperatorType::LOGICAL_ASOF_JOIN: |
4643 | return "LOGICAL_ASOF_JOIN" ; |
4644 | case LogicalOperatorType::LOGICAL_UNION: |
4645 | return "LOGICAL_UNION" ; |
4646 | case LogicalOperatorType::LOGICAL_EXCEPT: |
4647 | return "LOGICAL_EXCEPT" ; |
4648 | case LogicalOperatorType::LOGICAL_INTERSECT: |
4649 | return "LOGICAL_INTERSECT" ; |
4650 | case LogicalOperatorType::LOGICAL_RECURSIVE_CTE: |
4651 | return "LOGICAL_RECURSIVE_CTE" ; |
4652 | case LogicalOperatorType::LOGICAL_INSERT: |
4653 | return "LOGICAL_INSERT" ; |
4654 | case LogicalOperatorType::LOGICAL_DELETE: |
4655 | return "LOGICAL_DELETE" ; |
4656 | case LogicalOperatorType::LOGICAL_UPDATE: |
4657 | return "LOGICAL_UPDATE" ; |
4658 | case LogicalOperatorType::LOGICAL_ALTER: |
4659 | return "LOGICAL_ALTER" ; |
4660 | case LogicalOperatorType::LOGICAL_CREATE_TABLE: |
4661 | return "LOGICAL_CREATE_TABLE" ; |
4662 | case LogicalOperatorType::LOGICAL_CREATE_INDEX: |
4663 | return "LOGICAL_CREATE_INDEX" ; |
4664 | case LogicalOperatorType::LOGICAL_CREATE_SEQUENCE: |
4665 | return "LOGICAL_CREATE_SEQUENCE" ; |
4666 | case LogicalOperatorType::LOGICAL_CREATE_VIEW: |
4667 | return "LOGICAL_CREATE_VIEW" ; |
4668 | case LogicalOperatorType::LOGICAL_CREATE_SCHEMA: |
4669 | return "LOGICAL_CREATE_SCHEMA" ; |
4670 | case LogicalOperatorType::LOGICAL_CREATE_MACRO: |
4671 | return "LOGICAL_CREATE_MACRO" ; |
4672 | case LogicalOperatorType::LOGICAL_DROP: |
4673 | return "LOGICAL_DROP" ; |
4674 | case LogicalOperatorType::LOGICAL_PRAGMA: |
4675 | return "LOGICAL_PRAGMA" ; |
4676 | case LogicalOperatorType::LOGICAL_TRANSACTION: |
4677 | return "LOGICAL_TRANSACTION" ; |
4678 | case LogicalOperatorType::LOGICAL_CREATE_TYPE: |
4679 | return "LOGICAL_CREATE_TYPE" ; |
4680 | case LogicalOperatorType::LOGICAL_ATTACH: |
4681 | return "LOGICAL_ATTACH" ; |
4682 | case LogicalOperatorType::LOGICAL_DETACH: |
4683 | return "LOGICAL_DETACH" ; |
4684 | case LogicalOperatorType::LOGICAL_EXPLAIN: |
4685 | return "LOGICAL_EXPLAIN" ; |
4686 | case LogicalOperatorType::LOGICAL_SHOW: |
4687 | return "LOGICAL_SHOW" ; |
4688 | case LogicalOperatorType::LOGICAL_PREPARE: |
4689 | return "LOGICAL_PREPARE" ; |
4690 | case LogicalOperatorType::LOGICAL_EXECUTE: |
4691 | return "LOGICAL_EXECUTE" ; |
4692 | case LogicalOperatorType::LOGICAL_EXPORT: |
4693 | return "LOGICAL_EXPORT" ; |
4694 | case LogicalOperatorType::LOGICAL_VACUUM: |
4695 | return "LOGICAL_VACUUM" ; |
4696 | case LogicalOperatorType::LOGICAL_SET: |
4697 | return "LOGICAL_SET" ; |
4698 | case LogicalOperatorType::LOGICAL_LOAD: |
4699 | return "LOGICAL_LOAD" ; |
4700 | case LogicalOperatorType::LOGICAL_RESET: |
4701 | return "LOGICAL_RESET" ; |
4702 | case LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR: |
4703 | return "LOGICAL_EXTENSION_OPERATOR" ; |
4704 | default: |
4705 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4706 | } |
4707 | } |
4708 | |
4709 | template <> |
4710 | LogicalOperatorType EnumUtil::FromString<LogicalOperatorType>(const char *value) { |
4711 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_INVALID" )) { |
4712 | return LogicalOperatorType::LOGICAL_INVALID; |
4713 | } |
4714 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_PROJECTION" )) { |
4715 | return LogicalOperatorType::LOGICAL_PROJECTION; |
4716 | } |
4717 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_FILTER" )) { |
4718 | return LogicalOperatorType::LOGICAL_FILTER; |
4719 | } |
4720 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_AGGREGATE_AND_GROUP_BY" )) { |
4721 | return LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY; |
4722 | } |
4723 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_WINDOW" )) { |
4724 | return LogicalOperatorType::LOGICAL_WINDOW; |
4725 | } |
4726 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_UNNEST" )) { |
4727 | return LogicalOperatorType::LOGICAL_UNNEST; |
4728 | } |
4729 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_LIMIT" )) { |
4730 | return LogicalOperatorType::LOGICAL_LIMIT; |
4731 | } |
4732 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_ORDER_BY" )) { |
4733 | return LogicalOperatorType::LOGICAL_ORDER_BY; |
4734 | } |
4735 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_TOP_N" )) { |
4736 | return LogicalOperatorType::LOGICAL_TOP_N; |
4737 | } |
4738 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_COPY_TO_FILE" )) { |
4739 | return LogicalOperatorType::LOGICAL_COPY_TO_FILE; |
4740 | } |
4741 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_DISTINCT" )) { |
4742 | return LogicalOperatorType::LOGICAL_DISTINCT; |
4743 | } |
4744 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_SAMPLE" )) { |
4745 | return LogicalOperatorType::LOGICAL_SAMPLE; |
4746 | } |
4747 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_LIMIT_PERCENT" )) { |
4748 | return LogicalOperatorType::LOGICAL_LIMIT_PERCENT; |
4749 | } |
4750 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_PIVOT" )) { |
4751 | return LogicalOperatorType::LOGICAL_PIVOT; |
4752 | } |
4753 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_GET" )) { |
4754 | return LogicalOperatorType::LOGICAL_GET; |
4755 | } |
4756 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CHUNK_GET" )) { |
4757 | return LogicalOperatorType::LOGICAL_CHUNK_GET; |
4758 | } |
4759 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_DELIM_GET" )) { |
4760 | return LogicalOperatorType::LOGICAL_DELIM_GET; |
4761 | } |
4762 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_EXPRESSION_GET" )) { |
4763 | return LogicalOperatorType::LOGICAL_EXPRESSION_GET; |
4764 | } |
4765 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_DUMMY_SCAN" )) { |
4766 | return LogicalOperatorType::LOGICAL_DUMMY_SCAN; |
4767 | } |
4768 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_EMPTY_RESULT" )) { |
4769 | return LogicalOperatorType::LOGICAL_EMPTY_RESULT; |
4770 | } |
4771 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CTE_REF" )) { |
4772 | return LogicalOperatorType::LOGICAL_CTE_REF; |
4773 | } |
4774 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_JOIN" )) { |
4775 | return LogicalOperatorType::LOGICAL_JOIN; |
4776 | } |
4777 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_DELIM_JOIN" )) { |
4778 | return LogicalOperatorType::LOGICAL_DELIM_JOIN; |
4779 | } |
4780 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_COMPARISON_JOIN" )) { |
4781 | return LogicalOperatorType::LOGICAL_COMPARISON_JOIN; |
4782 | } |
4783 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_ANY_JOIN" )) { |
4784 | return LogicalOperatorType::LOGICAL_ANY_JOIN; |
4785 | } |
4786 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CROSS_PRODUCT" )) { |
4787 | return LogicalOperatorType::LOGICAL_CROSS_PRODUCT; |
4788 | } |
4789 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_POSITIONAL_JOIN" )) { |
4790 | return LogicalOperatorType::LOGICAL_POSITIONAL_JOIN; |
4791 | } |
4792 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_ASOF_JOIN" )) { |
4793 | return LogicalOperatorType::LOGICAL_ASOF_JOIN; |
4794 | } |
4795 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_UNION" )) { |
4796 | return LogicalOperatorType::LOGICAL_UNION; |
4797 | } |
4798 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_EXCEPT" )) { |
4799 | return LogicalOperatorType::LOGICAL_EXCEPT; |
4800 | } |
4801 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_INTERSECT" )) { |
4802 | return LogicalOperatorType::LOGICAL_INTERSECT; |
4803 | } |
4804 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_RECURSIVE_CTE" )) { |
4805 | return LogicalOperatorType::LOGICAL_RECURSIVE_CTE; |
4806 | } |
4807 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_INSERT" )) { |
4808 | return LogicalOperatorType::LOGICAL_INSERT; |
4809 | } |
4810 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_DELETE" )) { |
4811 | return LogicalOperatorType::LOGICAL_DELETE; |
4812 | } |
4813 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_UPDATE" )) { |
4814 | return LogicalOperatorType::LOGICAL_UPDATE; |
4815 | } |
4816 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_ALTER" )) { |
4817 | return LogicalOperatorType::LOGICAL_ALTER; |
4818 | } |
4819 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CREATE_TABLE" )) { |
4820 | return LogicalOperatorType::LOGICAL_CREATE_TABLE; |
4821 | } |
4822 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CREATE_INDEX" )) { |
4823 | return LogicalOperatorType::LOGICAL_CREATE_INDEX; |
4824 | } |
4825 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CREATE_SEQUENCE" )) { |
4826 | return LogicalOperatorType::LOGICAL_CREATE_SEQUENCE; |
4827 | } |
4828 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CREATE_VIEW" )) { |
4829 | return LogicalOperatorType::LOGICAL_CREATE_VIEW; |
4830 | } |
4831 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CREATE_SCHEMA" )) { |
4832 | return LogicalOperatorType::LOGICAL_CREATE_SCHEMA; |
4833 | } |
4834 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CREATE_MACRO" )) { |
4835 | return LogicalOperatorType::LOGICAL_CREATE_MACRO; |
4836 | } |
4837 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_DROP" )) { |
4838 | return LogicalOperatorType::LOGICAL_DROP; |
4839 | } |
4840 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_PRAGMA" )) { |
4841 | return LogicalOperatorType::LOGICAL_PRAGMA; |
4842 | } |
4843 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_TRANSACTION" )) { |
4844 | return LogicalOperatorType::LOGICAL_TRANSACTION; |
4845 | } |
4846 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_CREATE_TYPE" )) { |
4847 | return LogicalOperatorType::LOGICAL_CREATE_TYPE; |
4848 | } |
4849 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_ATTACH" )) { |
4850 | return LogicalOperatorType::LOGICAL_ATTACH; |
4851 | } |
4852 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_DETACH" )) { |
4853 | return LogicalOperatorType::LOGICAL_DETACH; |
4854 | } |
4855 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_EXPLAIN" )) { |
4856 | return LogicalOperatorType::LOGICAL_EXPLAIN; |
4857 | } |
4858 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_SHOW" )) { |
4859 | return LogicalOperatorType::LOGICAL_SHOW; |
4860 | } |
4861 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_PREPARE" )) { |
4862 | return LogicalOperatorType::LOGICAL_PREPARE; |
4863 | } |
4864 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_EXECUTE" )) { |
4865 | return LogicalOperatorType::LOGICAL_EXECUTE; |
4866 | } |
4867 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_EXPORT" )) { |
4868 | return LogicalOperatorType::LOGICAL_EXPORT; |
4869 | } |
4870 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_VACUUM" )) { |
4871 | return LogicalOperatorType::LOGICAL_VACUUM; |
4872 | } |
4873 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_SET" )) { |
4874 | return LogicalOperatorType::LOGICAL_SET; |
4875 | } |
4876 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_LOAD" )) { |
4877 | return LogicalOperatorType::LOGICAL_LOAD; |
4878 | } |
4879 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_RESET" )) { |
4880 | return LogicalOperatorType::LOGICAL_RESET; |
4881 | } |
4882 | if (StringUtil::Equals(s1: value, s2: "LOGICAL_EXTENSION_OPERATOR" )) { |
4883 | return LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR; |
4884 | } |
4885 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4886 | } |
4887 | |
4888 | template <> |
4889 | const char *EnumUtil::ToChars<OperatorResultType>(OperatorResultType value) { |
4890 | switch (value) { |
4891 | case OperatorResultType::NEED_MORE_INPUT: |
4892 | return "NEED_MORE_INPUT" ; |
4893 | case OperatorResultType::HAVE_MORE_OUTPUT: |
4894 | return "HAVE_MORE_OUTPUT" ; |
4895 | case OperatorResultType::FINISHED: |
4896 | return "FINISHED" ; |
4897 | case OperatorResultType::BLOCKED: |
4898 | return "BLOCKED" ; |
4899 | default: |
4900 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4901 | } |
4902 | } |
4903 | |
4904 | template <> |
4905 | OperatorResultType EnumUtil::FromString<OperatorResultType>(const char *value) { |
4906 | if (StringUtil::Equals(s1: value, s2: "NEED_MORE_INPUT" )) { |
4907 | return OperatorResultType::NEED_MORE_INPUT; |
4908 | } |
4909 | if (StringUtil::Equals(s1: value, s2: "HAVE_MORE_OUTPUT" )) { |
4910 | return OperatorResultType::HAVE_MORE_OUTPUT; |
4911 | } |
4912 | if (StringUtil::Equals(s1: value, s2: "FINISHED" )) { |
4913 | return OperatorResultType::FINISHED; |
4914 | } |
4915 | if (StringUtil::Equals(s1: value, s2: "BLOCKED" )) { |
4916 | return OperatorResultType::BLOCKED; |
4917 | } |
4918 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4919 | } |
4920 | |
4921 | template <> |
4922 | const char *EnumUtil::ToChars<OperatorFinalizeResultType>(OperatorFinalizeResultType value) { |
4923 | switch (value) { |
4924 | case OperatorFinalizeResultType::HAVE_MORE_OUTPUT: |
4925 | return "HAVE_MORE_OUTPUT" ; |
4926 | case OperatorFinalizeResultType::FINISHED: |
4927 | return "FINISHED" ; |
4928 | default: |
4929 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4930 | } |
4931 | } |
4932 | |
4933 | template <> |
4934 | OperatorFinalizeResultType EnumUtil::FromString<OperatorFinalizeResultType>(const char *value) { |
4935 | if (StringUtil::Equals(s1: value, s2: "HAVE_MORE_OUTPUT" )) { |
4936 | return OperatorFinalizeResultType::HAVE_MORE_OUTPUT; |
4937 | } |
4938 | if (StringUtil::Equals(s1: value, s2: "FINISHED" )) { |
4939 | return OperatorFinalizeResultType::FINISHED; |
4940 | } |
4941 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4942 | } |
4943 | |
4944 | template <> |
4945 | const char *EnumUtil::ToChars<SourceResultType>(SourceResultType value) { |
4946 | switch (value) { |
4947 | case SourceResultType::HAVE_MORE_OUTPUT: |
4948 | return "HAVE_MORE_OUTPUT" ; |
4949 | case SourceResultType::FINISHED: |
4950 | return "FINISHED" ; |
4951 | case SourceResultType::BLOCKED: |
4952 | return "BLOCKED" ; |
4953 | default: |
4954 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4955 | } |
4956 | } |
4957 | |
4958 | template <> |
4959 | SourceResultType EnumUtil::FromString<SourceResultType>(const char *value) { |
4960 | if (StringUtil::Equals(s1: value, s2: "HAVE_MORE_OUTPUT" )) { |
4961 | return SourceResultType::HAVE_MORE_OUTPUT; |
4962 | } |
4963 | if (StringUtil::Equals(s1: value, s2: "FINISHED" )) { |
4964 | return SourceResultType::FINISHED; |
4965 | } |
4966 | if (StringUtil::Equals(s1: value, s2: "BLOCKED" )) { |
4967 | return SourceResultType::BLOCKED; |
4968 | } |
4969 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4970 | } |
4971 | |
4972 | template <> |
4973 | const char *EnumUtil::ToChars<SinkResultType>(SinkResultType value) { |
4974 | switch (value) { |
4975 | case SinkResultType::NEED_MORE_INPUT: |
4976 | return "NEED_MORE_INPUT" ; |
4977 | case SinkResultType::FINISHED: |
4978 | return "FINISHED" ; |
4979 | case SinkResultType::BLOCKED: |
4980 | return "BLOCKED" ; |
4981 | default: |
4982 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
4983 | } |
4984 | } |
4985 | |
4986 | template <> |
4987 | SinkResultType EnumUtil::FromString<SinkResultType>(const char *value) { |
4988 | if (StringUtil::Equals(s1: value, s2: "NEED_MORE_INPUT" )) { |
4989 | return SinkResultType::NEED_MORE_INPUT; |
4990 | } |
4991 | if (StringUtil::Equals(s1: value, s2: "FINISHED" )) { |
4992 | return SinkResultType::FINISHED; |
4993 | } |
4994 | if (StringUtil::Equals(s1: value, s2: "BLOCKED" )) { |
4995 | return SinkResultType::BLOCKED; |
4996 | } |
4997 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
4998 | } |
4999 | |
5000 | template <> |
5001 | const char *EnumUtil::ToChars<SinkFinalizeType>(SinkFinalizeType value) { |
5002 | switch (value) { |
5003 | case SinkFinalizeType::READY: |
5004 | return "READY" ; |
5005 | case SinkFinalizeType::NO_OUTPUT_POSSIBLE: |
5006 | return "NO_OUTPUT_POSSIBLE" ; |
5007 | default: |
5008 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5009 | } |
5010 | } |
5011 | |
5012 | template <> |
5013 | SinkFinalizeType EnumUtil::FromString<SinkFinalizeType>(const char *value) { |
5014 | if (StringUtil::Equals(s1: value, s2: "READY" )) { |
5015 | return SinkFinalizeType::READY; |
5016 | } |
5017 | if (StringUtil::Equals(s1: value, s2: "NO_OUTPUT_POSSIBLE" )) { |
5018 | return SinkFinalizeType::NO_OUTPUT_POSSIBLE; |
5019 | } |
5020 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5021 | } |
5022 | |
5023 | template <> |
5024 | const char *EnumUtil::ToChars<JoinRefType>(JoinRefType value) { |
5025 | switch (value) { |
5026 | case JoinRefType::REGULAR: |
5027 | return "REGULAR" ; |
5028 | case JoinRefType::NATURAL: |
5029 | return "NATURAL" ; |
5030 | case JoinRefType::CROSS: |
5031 | return "CROSS" ; |
5032 | case JoinRefType::POSITIONAL: |
5033 | return "POSITIONAL" ; |
5034 | case JoinRefType::ASOF: |
5035 | return "ASOF" ; |
5036 | default: |
5037 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5038 | } |
5039 | } |
5040 | |
5041 | template <> |
5042 | JoinRefType EnumUtil::FromString<JoinRefType>(const char *value) { |
5043 | if (StringUtil::Equals(s1: value, s2: "REGULAR" )) { |
5044 | return JoinRefType::REGULAR; |
5045 | } |
5046 | if (StringUtil::Equals(s1: value, s2: "NATURAL" )) { |
5047 | return JoinRefType::NATURAL; |
5048 | } |
5049 | if (StringUtil::Equals(s1: value, s2: "CROSS" )) { |
5050 | return JoinRefType::CROSS; |
5051 | } |
5052 | if (StringUtil::Equals(s1: value, s2: "POSITIONAL" )) { |
5053 | return JoinRefType::POSITIONAL; |
5054 | } |
5055 | if (StringUtil::Equals(s1: value, s2: "ASOF" )) { |
5056 | return JoinRefType::ASOF; |
5057 | } |
5058 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5059 | } |
5060 | |
5061 | template <> |
5062 | const char *EnumUtil::ToChars<UndoFlags>(UndoFlags value) { |
5063 | switch (value) { |
5064 | case UndoFlags::EMPTY_ENTRY: |
5065 | return "EMPTY_ENTRY" ; |
5066 | case UndoFlags::CATALOG_ENTRY: |
5067 | return "CATALOG_ENTRY" ; |
5068 | case UndoFlags::INSERT_TUPLE: |
5069 | return "INSERT_TUPLE" ; |
5070 | case UndoFlags::DELETE_TUPLE: |
5071 | return "DELETE_TUPLE" ; |
5072 | case UndoFlags::UPDATE_TUPLE: |
5073 | return "UPDATE_TUPLE" ; |
5074 | default: |
5075 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5076 | } |
5077 | } |
5078 | |
5079 | template <> |
5080 | UndoFlags EnumUtil::FromString<UndoFlags>(const char *value) { |
5081 | if (StringUtil::Equals(s1: value, s2: "EMPTY_ENTRY" )) { |
5082 | return UndoFlags::EMPTY_ENTRY; |
5083 | } |
5084 | if (StringUtil::Equals(s1: value, s2: "CATALOG_ENTRY" )) { |
5085 | return UndoFlags::CATALOG_ENTRY; |
5086 | } |
5087 | if (StringUtil::Equals(s1: value, s2: "INSERT_TUPLE" )) { |
5088 | return UndoFlags::INSERT_TUPLE; |
5089 | } |
5090 | if (StringUtil::Equals(s1: value, s2: "DELETE_TUPLE" )) { |
5091 | return UndoFlags::DELETE_TUPLE; |
5092 | } |
5093 | if (StringUtil::Equals(s1: value, s2: "UPDATE_TUPLE" )) { |
5094 | return UndoFlags::UPDATE_TUPLE; |
5095 | } |
5096 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5097 | } |
5098 | |
5099 | template <> |
5100 | const char *EnumUtil::ToChars<SetOperationType>(SetOperationType value) { |
5101 | switch (value) { |
5102 | case SetOperationType::NONE: |
5103 | return "NONE" ; |
5104 | case SetOperationType::UNION: |
5105 | return "UNION" ; |
5106 | case SetOperationType::EXCEPT: |
5107 | return "EXCEPT" ; |
5108 | case SetOperationType::INTERSECT: |
5109 | return "INTERSECT" ; |
5110 | case SetOperationType::UNION_BY_NAME: |
5111 | return "UNION_BY_NAME" ; |
5112 | default: |
5113 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5114 | } |
5115 | } |
5116 | |
5117 | template <> |
5118 | SetOperationType EnumUtil::FromString<SetOperationType>(const char *value) { |
5119 | if (StringUtil::Equals(s1: value, s2: "NONE" )) { |
5120 | return SetOperationType::NONE; |
5121 | } |
5122 | if (StringUtil::Equals(s1: value, s2: "UNION" )) { |
5123 | return SetOperationType::UNION; |
5124 | } |
5125 | if (StringUtil::Equals(s1: value, s2: "EXCEPT" )) { |
5126 | return SetOperationType::EXCEPT; |
5127 | } |
5128 | if (StringUtil::Equals(s1: value, s2: "INTERSECT" )) { |
5129 | return SetOperationType::INTERSECT; |
5130 | } |
5131 | if (StringUtil::Equals(s1: value, s2: "UNION_BY_NAME" )) { |
5132 | return SetOperationType::UNION_BY_NAME; |
5133 | } |
5134 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5135 | } |
5136 | |
5137 | template <> |
5138 | const char *EnumUtil::ToChars<OptimizerType>(OptimizerType value) { |
5139 | switch (value) { |
5140 | case OptimizerType::INVALID: |
5141 | return "INVALID" ; |
5142 | case OptimizerType::EXPRESSION_REWRITER: |
5143 | return "EXPRESSION_REWRITER" ; |
5144 | case OptimizerType::FILTER_PULLUP: |
5145 | return "FILTER_PULLUP" ; |
5146 | case OptimizerType::FILTER_PUSHDOWN: |
5147 | return "FILTER_PUSHDOWN" ; |
5148 | case OptimizerType::REGEX_RANGE: |
5149 | return "REGEX_RANGE" ; |
5150 | case OptimizerType::IN_CLAUSE: |
5151 | return "IN_CLAUSE" ; |
5152 | case OptimizerType::JOIN_ORDER: |
5153 | return "JOIN_ORDER" ; |
5154 | case OptimizerType::DELIMINATOR: |
5155 | return "DELIMINATOR" ; |
5156 | case OptimizerType::UNNEST_REWRITER: |
5157 | return "UNNEST_REWRITER" ; |
5158 | case OptimizerType::UNUSED_COLUMNS: |
5159 | return "UNUSED_COLUMNS" ; |
5160 | case OptimizerType::STATISTICS_PROPAGATION: |
5161 | return "STATISTICS_PROPAGATION" ; |
5162 | case OptimizerType::COMMON_SUBEXPRESSIONS: |
5163 | return "COMMON_SUBEXPRESSIONS" ; |
5164 | case OptimizerType::COMMON_AGGREGATE: |
5165 | return "COMMON_AGGREGATE" ; |
5166 | case OptimizerType::COLUMN_LIFETIME: |
5167 | return "COLUMN_LIFETIME" ; |
5168 | case OptimizerType::TOP_N: |
5169 | return "TOP_N" ; |
5170 | case OptimizerType::REORDER_FILTER: |
5171 | return "REORDER_FILTER" ; |
5172 | case OptimizerType::EXTENSION: |
5173 | return "EXTENSION" ; |
5174 | default: |
5175 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5176 | } |
5177 | } |
5178 | |
5179 | template <> |
5180 | OptimizerType EnumUtil::FromString<OptimizerType>(const char *value) { |
5181 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
5182 | return OptimizerType::INVALID; |
5183 | } |
5184 | if (StringUtil::Equals(s1: value, s2: "EXPRESSION_REWRITER" )) { |
5185 | return OptimizerType::EXPRESSION_REWRITER; |
5186 | } |
5187 | if (StringUtil::Equals(s1: value, s2: "FILTER_PULLUP" )) { |
5188 | return OptimizerType::FILTER_PULLUP; |
5189 | } |
5190 | if (StringUtil::Equals(s1: value, s2: "FILTER_PUSHDOWN" )) { |
5191 | return OptimizerType::FILTER_PUSHDOWN; |
5192 | } |
5193 | if (StringUtil::Equals(s1: value, s2: "REGEX_RANGE" )) { |
5194 | return OptimizerType::REGEX_RANGE; |
5195 | } |
5196 | if (StringUtil::Equals(s1: value, s2: "IN_CLAUSE" )) { |
5197 | return OptimizerType::IN_CLAUSE; |
5198 | } |
5199 | if (StringUtil::Equals(s1: value, s2: "JOIN_ORDER" )) { |
5200 | return OptimizerType::JOIN_ORDER; |
5201 | } |
5202 | if (StringUtil::Equals(s1: value, s2: "DELIMINATOR" )) { |
5203 | return OptimizerType::DELIMINATOR; |
5204 | } |
5205 | if (StringUtil::Equals(s1: value, s2: "UNNEST_REWRITER" )) { |
5206 | return OptimizerType::UNNEST_REWRITER; |
5207 | } |
5208 | if (StringUtil::Equals(s1: value, s2: "UNUSED_COLUMNS" )) { |
5209 | return OptimizerType::UNUSED_COLUMNS; |
5210 | } |
5211 | if (StringUtil::Equals(s1: value, s2: "STATISTICS_PROPAGATION" )) { |
5212 | return OptimizerType::STATISTICS_PROPAGATION; |
5213 | } |
5214 | if (StringUtil::Equals(s1: value, s2: "COMMON_SUBEXPRESSIONS" )) { |
5215 | return OptimizerType::COMMON_SUBEXPRESSIONS; |
5216 | } |
5217 | if (StringUtil::Equals(s1: value, s2: "COMMON_AGGREGATE" )) { |
5218 | return OptimizerType::COMMON_AGGREGATE; |
5219 | } |
5220 | if (StringUtil::Equals(s1: value, s2: "COLUMN_LIFETIME" )) { |
5221 | return OptimizerType::COLUMN_LIFETIME; |
5222 | } |
5223 | if (StringUtil::Equals(s1: value, s2: "TOP_N" )) { |
5224 | return OptimizerType::TOP_N; |
5225 | } |
5226 | if (StringUtil::Equals(s1: value, s2: "REORDER_FILTER" )) { |
5227 | return OptimizerType::REORDER_FILTER; |
5228 | } |
5229 | if (StringUtil::Equals(s1: value, s2: "EXTENSION" )) { |
5230 | return OptimizerType::EXTENSION; |
5231 | } |
5232 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5233 | } |
5234 | |
5235 | template <> |
5236 | const char *EnumUtil::ToChars<CompressionType>(CompressionType value) { |
5237 | switch (value) { |
5238 | case CompressionType::COMPRESSION_AUTO: |
5239 | return "COMPRESSION_AUTO" ; |
5240 | case CompressionType::COMPRESSION_UNCOMPRESSED: |
5241 | return "COMPRESSION_UNCOMPRESSED" ; |
5242 | case CompressionType::COMPRESSION_CONSTANT: |
5243 | return "COMPRESSION_CONSTANT" ; |
5244 | case CompressionType::COMPRESSION_RLE: |
5245 | return "COMPRESSION_RLE" ; |
5246 | case CompressionType::COMPRESSION_DICTIONARY: |
5247 | return "COMPRESSION_DICTIONARY" ; |
5248 | case CompressionType::COMPRESSION_PFOR_DELTA: |
5249 | return "COMPRESSION_PFOR_DELTA" ; |
5250 | case CompressionType::COMPRESSION_BITPACKING: |
5251 | return "COMPRESSION_BITPACKING" ; |
5252 | case CompressionType::COMPRESSION_FSST: |
5253 | return "COMPRESSION_FSST" ; |
5254 | case CompressionType::COMPRESSION_CHIMP: |
5255 | return "COMPRESSION_CHIMP" ; |
5256 | case CompressionType::COMPRESSION_PATAS: |
5257 | return "COMPRESSION_PATAS" ; |
5258 | case CompressionType::COMPRESSION_COUNT: |
5259 | return "COMPRESSION_COUNT" ; |
5260 | default: |
5261 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5262 | } |
5263 | } |
5264 | |
5265 | template <> |
5266 | CompressionType EnumUtil::FromString<CompressionType>(const char *value) { |
5267 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_AUTO" )) { |
5268 | return CompressionType::COMPRESSION_AUTO; |
5269 | } |
5270 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_UNCOMPRESSED" )) { |
5271 | return CompressionType::COMPRESSION_UNCOMPRESSED; |
5272 | } |
5273 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_CONSTANT" )) { |
5274 | return CompressionType::COMPRESSION_CONSTANT; |
5275 | } |
5276 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_RLE" )) { |
5277 | return CompressionType::COMPRESSION_RLE; |
5278 | } |
5279 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_DICTIONARY" )) { |
5280 | return CompressionType::COMPRESSION_DICTIONARY; |
5281 | } |
5282 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_PFOR_DELTA" )) { |
5283 | return CompressionType::COMPRESSION_PFOR_DELTA; |
5284 | } |
5285 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_BITPACKING" )) { |
5286 | return CompressionType::COMPRESSION_BITPACKING; |
5287 | } |
5288 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_FSST" )) { |
5289 | return CompressionType::COMPRESSION_FSST; |
5290 | } |
5291 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_CHIMP" )) { |
5292 | return CompressionType::COMPRESSION_CHIMP; |
5293 | } |
5294 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_PATAS" )) { |
5295 | return CompressionType::COMPRESSION_PATAS; |
5296 | } |
5297 | if (StringUtil::Equals(s1: value, s2: "COMPRESSION_COUNT" )) { |
5298 | return CompressionType::COMPRESSION_COUNT; |
5299 | } |
5300 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5301 | } |
5302 | |
5303 | template <> |
5304 | const char *EnumUtil::ToChars<AggregateHandling>(AggregateHandling value) { |
5305 | switch (value) { |
5306 | case AggregateHandling::STANDARD_HANDLING: |
5307 | return "STANDARD_HANDLING" ; |
5308 | case AggregateHandling::NO_AGGREGATES_ALLOWED: |
5309 | return "NO_AGGREGATES_ALLOWED" ; |
5310 | case AggregateHandling::FORCE_AGGREGATES: |
5311 | return "FORCE_AGGREGATES" ; |
5312 | default: |
5313 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5314 | } |
5315 | } |
5316 | |
5317 | template <> |
5318 | AggregateHandling EnumUtil::FromString<AggregateHandling>(const char *value) { |
5319 | if (StringUtil::Equals(s1: value, s2: "STANDARD_HANDLING" )) { |
5320 | return AggregateHandling::STANDARD_HANDLING; |
5321 | } |
5322 | if (StringUtil::Equals(s1: value, s2: "NO_AGGREGATES_ALLOWED" )) { |
5323 | return AggregateHandling::NO_AGGREGATES_ALLOWED; |
5324 | } |
5325 | if (StringUtil::Equals(s1: value, s2: "FORCE_AGGREGATES" )) { |
5326 | return AggregateHandling::FORCE_AGGREGATES; |
5327 | } |
5328 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5329 | } |
5330 | |
5331 | template <> |
5332 | const char *EnumUtil::ToChars<TableReferenceType>(TableReferenceType value) { |
5333 | switch (value) { |
5334 | case TableReferenceType::INVALID: |
5335 | return "INVALID" ; |
5336 | case TableReferenceType::BASE_TABLE: |
5337 | return "BASE_TABLE" ; |
5338 | case TableReferenceType::SUBQUERY: |
5339 | return "SUBQUERY" ; |
5340 | case TableReferenceType::JOIN: |
5341 | return "JOIN" ; |
5342 | case TableReferenceType::TABLE_FUNCTION: |
5343 | return "TABLE_FUNCTION" ; |
5344 | case TableReferenceType::EXPRESSION_LIST: |
5345 | return "EXPRESSION_LIST" ; |
5346 | case TableReferenceType::CTE: |
5347 | return "CTE" ; |
5348 | case TableReferenceType::EMPTY: |
5349 | return "EMPTY" ; |
5350 | case TableReferenceType::PIVOT: |
5351 | return "PIVOT" ; |
5352 | default: |
5353 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5354 | } |
5355 | } |
5356 | |
5357 | template <> |
5358 | TableReferenceType EnumUtil::FromString<TableReferenceType>(const char *value) { |
5359 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
5360 | return TableReferenceType::INVALID; |
5361 | } |
5362 | if (StringUtil::Equals(s1: value, s2: "BASE_TABLE" )) { |
5363 | return TableReferenceType::BASE_TABLE; |
5364 | } |
5365 | if (StringUtil::Equals(s1: value, s2: "SUBQUERY" )) { |
5366 | return TableReferenceType::SUBQUERY; |
5367 | } |
5368 | if (StringUtil::Equals(s1: value, s2: "JOIN" )) { |
5369 | return TableReferenceType::JOIN; |
5370 | } |
5371 | if (StringUtil::Equals(s1: value, s2: "TABLE_FUNCTION" )) { |
5372 | return TableReferenceType::TABLE_FUNCTION; |
5373 | } |
5374 | if (StringUtil::Equals(s1: value, s2: "EXPRESSION_LIST" )) { |
5375 | return TableReferenceType::EXPRESSION_LIST; |
5376 | } |
5377 | if (StringUtil::Equals(s1: value, s2: "CTE" )) { |
5378 | return TableReferenceType::CTE; |
5379 | } |
5380 | if (StringUtil::Equals(s1: value, s2: "EMPTY" )) { |
5381 | return TableReferenceType::EMPTY; |
5382 | } |
5383 | if (StringUtil::Equals(s1: value, s2: "PIVOT" )) { |
5384 | return TableReferenceType::PIVOT; |
5385 | } |
5386 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5387 | } |
5388 | |
5389 | template <> |
5390 | const char *EnumUtil::ToChars<RelationType>(RelationType value) { |
5391 | switch (value) { |
5392 | case RelationType::INVALID_RELATION: |
5393 | return "INVALID_RELATION" ; |
5394 | case RelationType::TABLE_RELATION: |
5395 | return "TABLE_RELATION" ; |
5396 | case RelationType::PROJECTION_RELATION: |
5397 | return "PROJECTION_RELATION" ; |
5398 | case RelationType::FILTER_RELATION: |
5399 | return "FILTER_RELATION" ; |
5400 | case RelationType::EXPLAIN_RELATION: |
5401 | return "EXPLAIN_RELATION" ; |
5402 | case RelationType::CROSS_PRODUCT_RELATION: |
5403 | return "CROSS_PRODUCT_RELATION" ; |
5404 | case RelationType::JOIN_RELATION: |
5405 | return "JOIN_RELATION" ; |
5406 | case RelationType::AGGREGATE_RELATION: |
5407 | return "AGGREGATE_RELATION" ; |
5408 | case RelationType::SET_OPERATION_RELATION: |
5409 | return "SET_OPERATION_RELATION" ; |
5410 | case RelationType::DISTINCT_RELATION: |
5411 | return "DISTINCT_RELATION" ; |
5412 | case RelationType::LIMIT_RELATION: |
5413 | return "LIMIT_RELATION" ; |
5414 | case RelationType::ORDER_RELATION: |
5415 | return "ORDER_RELATION" ; |
5416 | case RelationType::CREATE_VIEW_RELATION: |
5417 | return "CREATE_VIEW_RELATION" ; |
5418 | case RelationType::CREATE_TABLE_RELATION: |
5419 | return "CREATE_TABLE_RELATION" ; |
5420 | case RelationType::INSERT_RELATION: |
5421 | return "INSERT_RELATION" ; |
5422 | case RelationType::VALUE_LIST_RELATION: |
5423 | return "VALUE_LIST_RELATION" ; |
5424 | case RelationType::DELETE_RELATION: |
5425 | return "DELETE_RELATION" ; |
5426 | case RelationType::UPDATE_RELATION: |
5427 | return "UPDATE_RELATION" ; |
5428 | case RelationType::WRITE_CSV_RELATION: |
5429 | return "WRITE_CSV_RELATION" ; |
5430 | case RelationType::WRITE_PARQUET_RELATION: |
5431 | return "WRITE_PARQUET_RELATION" ; |
5432 | case RelationType::READ_CSV_RELATION: |
5433 | return "READ_CSV_RELATION" ; |
5434 | case RelationType::SUBQUERY_RELATION: |
5435 | return "SUBQUERY_RELATION" ; |
5436 | case RelationType::TABLE_FUNCTION_RELATION: |
5437 | return "TABLE_FUNCTION_RELATION" ; |
5438 | case RelationType::VIEW_RELATION: |
5439 | return "VIEW_RELATION" ; |
5440 | case RelationType::QUERY_RELATION: |
5441 | return "QUERY_RELATION" ; |
5442 | default: |
5443 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5444 | } |
5445 | } |
5446 | |
5447 | template <> |
5448 | RelationType EnumUtil::FromString<RelationType>(const char *value) { |
5449 | if (StringUtil::Equals(s1: value, s2: "INVALID_RELATION" )) { |
5450 | return RelationType::INVALID_RELATION; |
5451 | } |
5452 | if (StringUtil::Equals(s1: value, s2: "TABLE_RELATION" )) { |
5453 | return RelationType::TABLE_RELATION; |
5454 | } |
5455 | if (StringUtil::Equals(s1: value, s2: "PROJECTION_RELATION" )) { |
5456 | return RelationType::PROJECTION_RELATION; |
5457 | } |
5458 | if (StringUtil::Equals(s1: value, s2: "FILTER_RELATION" )) { |
5459 | return RelationType::FILTER_RELATION; |
5460 | } |
5461 | if (StringUtil::Equals(s1: value, s2: "EXPLAIN_RELATION" )) { |
5462 | return RelationType::EXPLAIN_RELATION; |
5463 | } |
5464 | if (StringUtil::Equals(s1: value, s2: "CROSS_PRODUCT_RELATION" )) { |
5465 | return RelationType::CROSS_PRODUCT_RELATION; |
5466 | } |
5467 | if (StringUtil::Equals(s1: value, s2: "JOIN_RELATION" )) { |
5468 | return RelationType::JOIN_RELATION; |
5469 | } |
5470 | if (StringUtil::Equals(s1: value, s2: "AGGREGATE_RELATION" )) { |
5471 | return RelationType::AGGREGATE_RELATION; |
5472 | } |
5473 | if (StringUtil::Equals(s1: value, s2: "SET_OPERATION_RELATION" )) { |
5474 | return RelationType::SET_OPERATION_RELATION; |
5475 | } |
5476 | if (StringUtil::Equals(s1: value, s2: "DISTINCT_RELATION" )) { |
5477 | return RelationType::DISTINCT_RELATION; |
5478 | } |
5479 | if (StringUtil::Equals(s1: value, s2: "LIMIT_RELATION" )) { |
5480 | return RelationType::LIMIT_RELATION; |
5481 | } |
5482 | if (StringUtil::Equals(s1: value, s2: "ORDER_RELATION" )) { |
5483 | return RelationType::ORDER_RELATION; |
5484 | } |
5485 | if (StringUtil::Equals(s1: value, s2: "CREATE_VIEW_RELATION" )) { |
5486 | return RelationType::CREATE_VIEW_RELATION; |
5487 | } |
5488 | if (StringUtil::Equals(s1: value, s2: "CREATE_TABLE_RELATION" )) { |
5489 | return RelationType::CREATE_TABLE_RELATION; |
5490 | } |
5491 | if (StringUtil::Equals(s1: value, s2: "INSERT_RELATION" )) { |
5492 | return RelationType::INSERT_RELATION; |
5493 | } |
5494 | if (StringUtil::Equals(s1: value, s2: "VALUE_LIST_RELATION" )) { |
5495 | return RelationType::VALUE_LIST_RELATION; |
5496 | } |
5497 | if (StringUtil::Equals(s1: value, s2: "DELETE_RELATION" )) { |
5498 | return RelationType::DELETE_RELATION; |
5499 | } |
5500 | if (StringUtil::Equals(s1: value, s2: "UPDATE_RELATION" )) { |
5501 | return RelationType::UPDATE_RELATION; |
5502 | } |
5503 | if (StringUtil::Equals(s1: value, s2: "WRITE_CSV_RELATION" )) { |
5504 | return RelationType::WRITE_CSV_RELATION; |
5505 | } |
5506 | if (StringUtil::Equals(s1: value, s2: "WRITE_PARQUET_RELATION" )) { |
5507 | return RelationType::WRITE_PARQUET_RELATION; |
5508 | } |
5509 | if (StringUtil::Equals(s1: value, s2: "READ_CSV_RELATION" )) { |
5510 | return RelationType::READ_CSV_RELATION; |
5511 | } |
5512 | if (StringUtil::Equals(s1: value, s2: "SUBQUERY_RELATION" )) { |
5513 | return RelationType::SUBQUERY_RELATION; |
5514 | } |
5515 | if (StringUtil::Equals(s1: value, s2: "TABLE_FUNCTION_RELATION" )) { |
5516 | return RelationType::TABLE_FUNCTION_RELATION; |
5517 | } |
5518 | if (StringUtil::Equals(s1: value, s2: "VIEW_RELATION" )) { |
5519 | return RelationType::VIEW_RELATION; |
5520 | } |
5521 | if (StringUtil::Equals(s1: value, s2: "QUERY_RELATION" )) { |
5522 | return RelationType::QUERY_RELATION; |
5523 | } |
5524 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5525 | } |
5526 | |
5527 | template <> |
5528 | const char *EnumUtil::ToChars<FilterPropagateResult>(FilterPropagateResult value) { |
5529 | switch (value) { |
5530 | case FilterPropagateResult::NO_PRUNING_POSSIBLE: |
5531 | return "NO_PRUNING_POSSIBLE" ; |
5532 | case FilterPropagateResult::FILTER_ALWAYS_TRUE: |
5533 | return "FILTER_ALWAYS_TRUE" ; |
5534 | case FilterPropagateResult::FILTER_ALWAYS_FALSE: |
5535 | return "FILTER_ALWAYS_FALSE" ; |
5536 | case FilterPropagateResult::FILTER_TRUE_OR_NULL: |
5537 | return "FILTER_TRUE_OR_NULL" ; |
5538 | case FilterPropagateResult::FILTER_FALSE_OR_NULL: |
5539 | return "FILTER_FALSE_OR_NULL" ; |
5540 | default: |
5541 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5542 | } |
5543 | } |
5544 | |
5545 | template <> |
5546 | FilterPropagateResult EnumUtil::FromString<FilterPropagateResult>(const char *value) { |
5547 | if (StringUtil::Equals(s1: value, s2: "NO_PRUNING_POSSIBLE" )) { |
5548 | return FilterPropagateResult::NO_PRUNING_POSSIBLE; |
5549 | } |
5550 | if (StringUtil::Equals(s1: value, s2: "FILTER_ALWAYS_TRUE" )) { |
5551 | return FilterPropagateResult::FILTER_ALWAYS_TRUE; |
5552 | } |
5553 | if (StringUtil::Equals(s1: value, s2: "FILTER_ALWAYS_FALSE" )) { |
5554 | return FilterPropagateResult::FILTER_ALWAYS_FALSE; |
5555 | } |
5556 | if (StringUtil::Equals(s1: value, s2: "FILTER_TRUE_OR_NULL" )) { |
5557 | return FilterPropagateResult::FILTER_TRUE_OR_NULL; |
5558 | } |
5559 | if (StringUtil::Equals(s1: value, s2: "FILTER_FALSE_OR_NULL" )) { |
5560 | return FilterPropagateResult::FILTER_FALSE_OR_NULL; |
5561 | } |
5562 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5563 | } |
5564 | |
5565 | template <> |
5566 | const char *EnumUtil::ToChars<IndexType>(IndexType value) { |
5567 | switch (value) { |
5568 | case IndexType::INVALID: |
5569 | return "INVALID" ; |
5570 | case IndexType::ART: |
5571 | return "ART" ; |
5572 | default: |
5573 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5574 | } |
5575 | } |
5576 | |
5577 | template <> |
5578 | IndexType EnumUtil::FromString<IndexType>(const char *value) { |
5579 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
5580 | return IndexType::INVALID; |
5581 | } |
5582 | if (StringUtil::Equals(s1: value, s2: "ART" )) { |
5583 | return IndexType::ART; |
5584 | } |
5585 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5586 | } |
5587 | |
5588 | template <> |
5589 | const char *EnumUtil::ToChars<ExplainOutputType>(ExplainOutputType value) { |
5590 | switch (value) { |
5591 | case ExplainOutputType::ALL: |
5592 | return "ALL" ; |
5593 | case ExplainOutputType::OPTIMIZED_ONLY: |
5594 | return "OPTIMIZED_ONLY" ; |
5595 | case ExplainOutputType::PHYSICAL_ONLY: |
5596 | return "PHYSICAL_ONLY" ; |
5597 | default: |
5598 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5599 | } |
5600 | } |
5601 | |
5602 | template <> |
5603 | ExplainOutputType EnumUtil::FromString<ExplainOutputType>(const char *value) { |
5604 | if (StringUtil::Equals(s1: value, s2: "ALL" )) { |
5605 | return ExplainOutputType::ALL; |
5606 | } |
5607 | if (StringUtil::Equals(s1: value, s2: "OPTIMIZED_ONLY" )) { |
5608 | return ExplainOutputType::OPTIMIZED_ONLY; |
5609 | } |
5610 | if (StringUtil::Equals(s1: value, s2: "PHYSICAL_ONLY" )) { |
5611 | return ExplainOutputType::PHYSICAL_ONLY; |
5612 | } |
5613 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5614 | } |
5615 | |
5616 | template <> |
5617 | const char *EnumUtil::ToChars<NType>(NType value) { |
5618 | switch (value) { |
5619 | case NType::PREFIX_SEGMENT: |
5620 | return "PREFIX_SEGMENT" ; |
5621 | case NType::LEAF_SEGMENT: |
5622 | return "LEAF_SEGMENT" ; |
5623 | case NType::LEAF: |
5624 | return "LEAF" ; |
5625 | case NType::NODE_4: |
5626 | return "NODE_4" ; |
5627 | case NType::NODE_16: |
5628 | return "NODE_16" ; |
5629 | case NType::NODE_48: |
5630 | return "NODE_48" ; |
5631 | case NType::NODE_256: |
5632 | return "NODE_256" ; |
5633 | default: |
5634 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5635 | } |
5636 | } |
5637 | |
5638 | template <> |
5639 | NType EnumUtil::FromString<NType>(const char *value) { |
5640 | if (StringUtil::Equals(s1: value, s2: "PREFIX_SEGMENT" )) { |
5641 | return NType::PREFIX_SEGMENT; |
5642 | } |
5643 | if (StringUtil::Equals(s1: value, s2: "LEAF_SEGMENT" )) { |
5644 | return NType::LEAF_SEGMENT; |
5645 | } |
5646 | if (StringUtil::Equals(s1: value, s2: "LEAF" )) { |
5647 | return NType::LEAF; |
5648 | } |
5649 | if (StringUtil::Equals(s1: value, s2: "NODE_4" )) { |
5650 | return NType::NODE_4; |
5651 | } |
5652 | if (StringUtil::Equals(s1: value, s2: "NODE_16" )) { |
5653 | return NType::NODE_16; |
5654 | } |
5655 | if (StringUtil::Equals(s1: value, s2: "NODE_48" )) { |
5656 | return NType::NODE_48; |
5657 | } |
5658 | if (StringUtil::Equals(s1: value, s2: "NODE_256" )) { |
5659 | return NType::NODE_256; |
5660 | } |
5661 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5662 | } |
5663 | |
5664 | template <> |
5665 | const char *EnumUtil::ToChars<VerifyExistenceType>(VerifyExistenceType value) { |
5666 | switch (value) { |
5667 | case VerifyExistenceType::APPEND: |
5668 | return "APPEND" ; |
5669 | case VerifyExistenceType::APPEND_FK: |
5670 | return "APPEND_FK" ; |
5671 | case VerifyExistenceType::DELETE_FK: |
5672 | return "DELETE_FK" ; |
5673 | default: |
5674 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5675 | } |
5676 | } |
5677 | |
5678 | template <> |
5679 | VerifyExistenceType EnumUtil::FromString<VerifyExistenceType>(const char *value) { |
5680 | if (StringUtil::Equals(s1: value, s2: "APPEND" )) { |
5681 | return VerifyExistenceType::APPEND; |
5682 | } |
5683 | if (StringUtil::Equals(s1: value, s2: "APPEND_FK" )) { |
5684 | return VerifyExistenceType::APPEND_FK; |
5685 | } |
5686 | if (StringUtil::Equals(s1: value, s2: "DELETE_FK" )) { |
5687 | return VerifyExistenceType::DELETE_FK; |
5688 | } |
5689 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5690 | } |
5691 | |
5692 | template <> |
5693 | const char *EnumUtil::ToChars<ParserMode>(ParserMode value) { |
5694 | switch (value) { |
5695 | case ParserMode::PARSING: |
5696 | return "PARSING" ; |
5697 | case ParserMode::SNIFFING_DIALECT: |
5698 | return "SNIFFING_DIALECT" ; |
5699 | case ParserMode::SNIFFING_DATATYPES: |
5700 | return "SNIFFING_DATATYPES" ; |
5701 | case ParserMode::PARSING_HEADER: |
5702 | return "PARSING_HEADER" ; |
5703 | default: |
5704 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5705 | } |
5706 | } |
5707 | |
5708 | template <> |
5709 | ParserMode EnumUtil::FromString<ParserMode>(const char *value) { |
5710 | if (StringUtil::Equals(s1: value, s2: "PARSING" )) { |
5711 | return ParserMode::PARSING; |
5712 | } |
5713 | if (StringUtil::Equals(s1: value, s2: "SNIFFING_DIALECT" )) { |
5714 | return ParserMode::SNIFFING_DIALECT; |
5715 | } |
5716 | if (StringUtil::Equals(s1: value, s2: "SNIFFING_DATATYPES" )) { |
5717 | return ParserMode::SNIFFING_DATATYPES; |
5718 | } |
5719 | if (StringUtil::Equals(s1: value, s2: "PARSING_HEADER" )) { |
5720 | return ParserMode::PARSING_HEADER; |
5721 | } |
5722 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5723 | } |
5724 | |
5725 | template <> |
5726 | const char *EnumUtil::ToChars<ErrorType>(ErrorType value) { |
5727 | switch (value) { |
5728 | case ErrorType::UNSIGNED_EXTENSION: |
5729 | return "UNSIGNED_EXTENSION" ; |
5730 | case ErrorType::INVALIDATED_TRANSACTION: |
5731 | return "INVALIDATED_TRANSACTION" ; |
5732 | case ErrorType::INVALIDATED_DATABASE: |
5733 | return "INVALIDATED_DATABASE" ; |
5734 | case ErrorType::ERROR_COUNT: |
5735 | return "ERROR_COUNT" ; |
5736 | case ErrorType::INVALID: |
5737 | return "INVALID" ; |
5738 | default: |
5739 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5740 | } |
5741 | } |
5742 | |
5743 | template <> |
5744 | ErrorType EnumUtil::FromString<ErrorType>(const char *value) { |
5745 | if (StringUtil::Equals(s1: value, s2: "UNSIGNED_EXTENSION" )) { |
5746 | return ErrorType::UNSIGNED_EXTENSION; |
5747 | } |
5748 | if (StringUtil::Equals(s1: value, s2: "INVALIDATED_TRANSACTION" )) { |
5749 | return ErrorType::INVALIDATED_TRANSACTION; |
5750 | } |
5751 | if (StringUtil::Equals(s1: value, s2: "INVALIDATED_DATABASE" )) { |
5752 | return ErrorType::INVALIDATED_DATABASE; |
5753 | } |
5754 | if (StringUtil::Equals(s1: value, s2: "ERROR_COUNT" )) { |
5755 | return ErrorType::ERROR_COUNT; |
5756 | } |
5757 | if (StringUtil::Equals(s1: value, s2: "INVALID" )) { |
5758 | return ErrorType::INVALID; |
5759 | } |
5760 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5761 | } |
5762 | |
5763 | template <> |
5764 | const char *EnumUtil::ToChars<AppenderType>(AppenderType value) { |
5765 | switch (value) { |
5766 | case AppenderType::LOGICAL: |
5767 | return "LOGICAL" ; |
5768 | case AppenderType::PHYSICAL: |
5769 | return "PHYSICAL" ; |
5770 | default: |
5771 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5772 | } |
5773 | } |
5774 | |
5775 | template <> |
5776 | AppenderType EnumUtil::FromString<AppenderType>(const char *value) { |
5777 | if (StringUtil::Equals(s1: value, s2: "LOGICAL" )) { |
5778 | return AppenderType::LOGICAL; |
5779 | } |
5780 | if (StringUtil::Equals(s1: value, s2: "PHYSICAL" )) { |
5781 | return AppenderType::PHYSICAL; |
5782 | } |
5783 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5784 | } |
5785 | |
5786 | template <> |
5787 | const char *EnumUtil::ToChars<CheckpointAbort>(CheckpointAbort value) { |
5788 | switch (value) { |
5789 | case CheckpointAbort::NO_ABORT: |
5790 | return "NO_ABORT" ; |
5791 | case CheckpointAbort::DEBUG_ABORT_BEFORE_TRUNCATE: |
5792 | return "DEBUG_ABORT_BEFORE_TRUNCATE" ; |
5793 | case CheckpointAbort::DEBUG_ABORT_BEFORE_HEADER: |
5794 | return "DEBUG_ABORT_BEFORE_HEADER" ; |
5795 | case CheckpointAbort::DEBUG_ABORT_AFTER_FREE_LIST_WRITE: |
5796 | return "DEBUG_ABORT_AFTER_FREE_LIST_WRITE" ; |
5797 | default: |
5798 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5799 | } |
5800 | } |
5801 | |
5802 | template <> |
5803 | CheckpointAbort EnumUtil::FromString<CheckpointAbort>(const char *value) { |
5804 | if (StringUtil::Equals(s1: value, s2: "NO_ABORT" )) { |
5805 | return CheckpointAbort::NO_ABORT; |
5806 | } |
5807 | if (StringUtil::Equals(s1: value, s2: "DEBUG_ABORT_BEFORE_TRUNCATE" )) { |
5808 | return CheckpointAbort::DEBUG_ABORT_BEFORE_TRUNCATE; |
5809 | } |
5810 | if (StringUtil::Equals(s1: value, s2: "DEBUG_ABORT_BEFORE_HEADER" )) { |
5811 | return CheckpointAbort::DEBUG_ABORT_BEFORE_HEADER; |
5812 | } |
5813 | if (StringUtil::Equals(s1: value, s2: "DEBUG_ABORT_AFTER_FREE_LIST_WRITE" )) { |
5814 | return CheckpointAbort::DEBUG_ABORT_AFTER_FREE_LIST_WRITE; |
5815 | } |
5816 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5817 | } |
5818 | |
5819 | template <> |
5820 | const char *EnumUtil::ToChars<ExtensionLoadResult>(ExtensionLoadResult value) { |
5821 | switch (value) { |
5822 | case ExtensionLoadResult::LOADED_EXTENSION: |
5823 | return "LOADED_EXTENSION" ; |
5824 | case ExtensionLoadResult::EXTENSION_UNKNOWN: |
5825 | return "EXTENSION_UNKNOWN" ; |
5826 | case ExtensionLoadResult::NOT_LOADED: |
5827 | return "NOT_LOADED" ; |
5828 | default: |
5829 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5830 | } |
5831 | } |
5832 | |
5833 | template <> |
5834 | ExtensionLoadResult EnumUtil::FromString<ExtensionLoadResult>(const char *value) { |
5835 | if (StringUtil::Equals(s1: value, s2: "LOADED_EXTENSION" )) { |
5836 | return ExtensionLoadResult::LOADED_EXTENSION; |
5837 | } |
5838 | if (StringUtil::Equals(s1: value, s2: "EXTENSION_UNKNOWN" )) { |
5839 | return ExtensionLoadResult::EXTENSION_UNKNOWN; |
5840 | } |
5841 | if (StringUtil::Equals(s1: value, s2: "NOT_LOADED" )) { |
5842 | return ExtensionLoadResult::NOT_LOADED; |
5843 | } |
5844 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5845 | } |
5846 | |
5847 | template <> |
5848 | const char *EnumUtil::ToChars<QueryResultType>(QueryResultType value) { |
5849 | switch (value) { |
5850 | case QueryResultType::MATERIALIZED_RESULT: |
5851 | return "MATERIALIZED_RESULT" ; |
5852 | case QueryResultType::STREAM_RESULT: |
5853 | return "STREAM_RESULT" ; |
5854 | case QueryResultType::PENDING_RESULT: |
5855 | return "PENDING_RESULT" ; |
5856 | default: |
5857 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5858 | } |
5859 | } |
5860 | |
5861 | template <> |
5862 | QueryResultType EnumUtil::FromString<QueryResultType>(const char *value) { |
5863 | if (StringUtil::Equals(s1: value, s2: "MATERIALIZED_RESULT" )) { |
5864 | return QueryResultType::MATERIALIZED_RESULT; |
5865 | } |
5866 | if (StringUtil::Equals(s1: value, s2: "STREAM_RESULT" )) { |
5867 | return QueryResultType::STREAM_RESULT; |
5868 | } |
5869 | if (StringUtil::Equals(s1: value, s2: "PENDING_RESULT" )) { |
5870 | return QueryResultType::PENDING_RESULT; |
5871 | } |
5872 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5873 | } |
5874 | |
5875 | template <> |
5876 | const char *EnumUtil::ToChars<CAPIResultSetType>(CAPIResultSetType value) { |
5877 | switch (value) { |
5878 | case CAPIResultSetType::CAPI_RESULT_TYPE_NONE: |
5879 | return "CAPI_RESULT_TYPE_NONE" ; |
5880 | case CAPIResultSetType::CAPI_RESULT_TYPE_MATERIALIZED: |
5881 | return "CAPI_RESULT_TYPE_MATERIALIZED" ; |
5882 | case CAPIResultSetType::CAPI_RESULT_TYPE_STREAMING: |
5883 | return "CAPI_RESULT_TYPE_STREAMING" ; |
5884 | case CAPIResultSetType::CAPI_RESULT_TYPE_DEPRECATED: |
5885 | return "CAPI_RESULT_TYPE_DEPRECATED" ; |
5886 | default: |
5887 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%d' not implemented" , params: value)); |
5888 | } |
5889 | } |
5890 | |
5891 | template <> |
5892 | CAPIResultSetType EnumUtil::FromString<CAPIResultSetType>(const char *value) { |
5893 | if (StringUtil::Equals(s1: value, s2: "CAPI_RESULT_TYPE_NONE" )) { |
5894 | return CAPIResultSetType::CAPI_RESULT_TYPE_NONE; |
5895 | } |
5896 | if (StringUtil::Equals(s1: value, s2: "CAPI_RESULT_TYPE_MATERIALIZED" )) { |
5897 | return CAPIResultSetType::CAPI_RESULT_TYPE_MATERIALIZED; |
5898 | } |
5899 | if (StringUtil::Equals(s1: value, s2: "CAPI_RESULT_TYPE_STREAMING" )) { |
5900 | return CAPIResultSetType::CAPI_RESULT_TYPE_STREAMING; |
5901 | } |
5902 | if (StringUtil::Equals(s1: value, s2: "CAPI_RESULT_TYPE_DEPRECATED" )) { |
5903 | return CAPIResultSetType::CAPI_RESULT_TYPE_DEPRECATED; |
5904 | } |
5905 | throw NotImplementedException(StringUtil::Format(fmt_str: "Enum value: '%s' not implemented" , params: value)); |
5906 | } |
5907 | |
5908 | } // namespace duckdb |
5909 | |