duckdb 0.7.2-dev3546.0 → 0.7.2-dev3666.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/database.cpp +1 -0
- package/src/duckdb/extension/json/buffered_json_reader.cpp +56 -17
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +56 -31
- package/src/duckdb/extension/json/include/json_common.hpp +5 -4
- package/src/duckdb/extension/json/include/json_executors.hpp +13 -18
- package/src/duckdb/extension/json/include/json_functions.hpp +3 -0
- package/src/duckdb/extension/json/include/json_scan.hpp +106 -153
- package/src/duckdb/extension/json/include/json_transform.hpp +2 -2
- package/src/duckdb/extension/json/json_common.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +94 -38
- package/src/duckdb/extension/json/json_functions/json_contains.cpp +7 -8
- package/src/duckdb/extension/json/json_functions/json_create.cpp +7 -7
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +4 -4
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +4 -4
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +7 -5
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +10 -8
- package/src/duckdb/extension/json/json_functions/json_valid.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/read_json.cpp +166 -169
- package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +37 -16
- package/src/duckdb/extension/json/json_functions.cpp +11 -4
- package/src/duckdb/extension/json/json_scan.cpp +593 -374
- package/src/duckdb/extension/parquet/parquet-extension.cpp +5 -0
- package/src/duckdb/src/common/file_system.cpp +26 -6
- package/src/duckdb/src/common/local_file_system.cpp +0 -13
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +12 -6
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +10 -0
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +5 -3
- package/src/duckdb/src/function/table/copy_csv.cpp +66 -12
- package/src/duckdb/src/function/table/read_csv.cpp +13 -3
- package/src/duckdb/src/function/table/version/pragma_version.cpp +8 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/column_dependency_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/exception.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +5 -0
- package/src/duckdb/src/include/duckdb/common/http_state.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/hugeint.hpp +6 -6
- package/src/duckdb/src/include/duckdb/common/limits.hpp +46 -46
- package/src/duckdb/src/include/duckdb/common/operator/cast_operators.hpp +8 -8
- package/src/duckdb/src/include/duckdb/common/operator/comparison_operators.hpp +6 -6
- package/src/duckdb/src/include/duckdb/common/operator/convert_to_string.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp +2 -4
- package/src/duckdb/src/include/duckdb/common/operator/string_cast.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/operator/subtract.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/preserved_error.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +7 -7
- package/src/duckdb/src/include/duckdb/common/types/chunk_collection.hpp +10 -10
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +12 -12
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_iterators.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/winapi.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +8 -3
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +10 -14
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/udf_function.hpp +56 -50
- package/src/duckdb/src/include/duckdb/main/appender.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/connection.hpp +8 -9
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +3 -3
- package/src/duckdb/src/include/duckdb/main/relation.hpp +6 -7
- package/src/duckdb/src/include/duckdb/optimizer/optimizer_extension.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +7 -7
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +9 -4
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +1 -1
- package/src/duckdb/src/storage/single_file_block_manager.cpp +0 -4
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +5735 -5773
@@ -19,10 +19,10 @@ namespace duckdb {
|
|
19
19
|
|
20
20
|
template <class T>
|
21
21
|
struct NumericLimits {
|
22
|
-
|
22
|
+
static constexpr T Minimum() {
|
23
23
|
return std::numeric_limits<T>::lowest();
|
24
24
|
};
|
25
|
-
|
25
|
+
static constexpr T Maximum() {
|
26
26
|
return std::numeric_limits<T>::max();
|
27
27
|
};
|
28
28
|
DUCKDB_API static bool IsSigned();
|
@@ -31,169 +31,169 @@ struct NumericLimits {
|
|
31
31
|
|
32
32
|
template <>
|
33
33
|
struct NumericLimits<int8_t> {
|
34
|
-
|
34
|
+
static constexpr int8_t Minimum() {
|
35
35
|
return std::numeric_limits<int8_t>::lowest();
|
36
36
|
};
|
37
|
-
|
37
|
+
static constexpr int8_t Maximum() {
|
38
38
|
return std::numeric_limits<int8_t>::max();
|
39
39
|
};
|
40
|
-
|
40
|
+
static bool IsSigned() {
|
41
41
|
return true;
|
42
42
|
}
|
43
|
-
|
43
|
+
static idx_t Digits() {
|
44
44
|
return 3;
|
45
45
|
}
|
46
46
|
};
|
47
47
|
template <>
|
48
48
|
struct NumericLimits<int16_t> {
|
49
|
-
|
49
|
+
static constexpr int16_t Minimum() {
|
50
50
|
return std::numeric_limits<int16_t>::lowest();
|
51
51
|
};
|
52
|
-
|
52
|
+
static constexpr int16_t Maximum() {
|
53
53
|
return std::numeric_limits<int16_t>::max();
|
54
54
|
};
|
55
|
-
|
55
|
+
static bool IsSigned() {
|
56
56
|
return true;
|
57
57
|
}
|
58
|
-
|
58
|
+
static idx_t Digits() {
|
59
59
|
return 5;
|
60
60
|
}
|
61
61
|
};
|
62
62
|
template <>
|
63
63
|
struct NumericLimits<int32_t> {
|
64
|
-
|
64
|
+
static constexpr int32_t Minimum() {
|
65
65
|
return std::numeric_limits<int32_t>::lowest();
|
66
66
|
};
|
67
|
-
|
67
|
+
static constexpr int32_t Maximum() {
|
68
68
|
return std::numeric_limits<int32_t>::max();
|
69
69
|
};
|
70
|
-
|
70
|
+
static bool IsSigned() {
|
71
71
|
return true;
|
72
72
|
}
|
73
|
-
|
73
|
+
static idx_t Digits() {
|
74
74
|
return 10;
|
75
75
|
}
|
76
76
|
};
|
77
77
|
|
78
78
|
template <>
|
79
79
|
struct NumericLimits<int64_t> {
|
80
|
-
|
80
|
+
static constexpr int64_t Minimum() {
|
81
81
|
return std::numeric_limits<int64_t>::lowest();
|
82
82
|
};
|
83
|
-
|
83
|
+
static constexpr int64_t Maximum() {
|
84
84
|
return std::numeric_limits<int64_t>::max();
|
85
85
|
};
|
86
|
-
|
86
|
+
static bool IsSigned() {
|
87
87
|
return true;
|
88
88
|
}
|
89
|
-
|
89
|
+
static idx_t Digits() {
|
90
90
|
return 19;
|
91
91
|
}
|
92
92
|
};
|
93
93
|
template <>
|
94
94
|
struct NumericLimits<hugeint_t> {
|
95
|
-
|
95
|
+
static constexpr hugeint_t Minimum() {
|
96
96
|
return {std::numeric_limits<int64_t>::lowest(), 1};
|
97
97
|
};
|
98
|
-
|
98
|
+
static constexpr hugeint_t Maximum() {
|
99
99
|
return {std::numeric_limits<int64_t>::max(), std::numeric_limits<uint64_t>::max()};
|
100
100
|
};
|
101
|
-
|
101
|
+
static bool IsSigned() {
|
102
102
|
return true;
|
103
103
|
}
|
104
|
-
|
104
|
+
static idx_t Digits() {
|
105
105
|
return 39;
|
106
106
|
}
|
107
107
|
};
|
108
108
|
|
109
109
|
template <>
|
110
110
|
struct NumericLimits<uint8_t> {
|
111
|
-
|
111
|
+
static constexpr uint8_t Minimum() {
|
112
112
|
return std::numeric_limits<uint8_t>::lowest();
|
113
113
|
};
|
114
|
-
|
114
|
+
static constexpr uint8_t Maximum() {
|
115
115
|
return std::numeric_limits<uint8_t>::max();
|
116
116
|
};
|
117
|
-
|
117
|
+
static bool IsSigned() {
|
118
118
|
return false;
|
119
119
|
}
|
120
|
-
|
120
|
+
static idx_t Digits() {
|
121
121
|
return 3;
|
122
122
|
}
|
123
123
|
};
|
124
124
|
|
125
125
|
template <>
|
126
126
|
struct NumericLimits<uint16_t> {
|
127
|
-
|
127
|
+
static constexpr uint16_t Minimum() {
|
128
128
|
return std::numeric_limits<uint16_t>::lowest();
|
129
129
|
};
|
130
|
-
|
130
|
+
static constexpr uint16_t Maximum() {
|
131
131
|
return std::numeric_limits<uint16_t>::max();
|
132
132
|
};
|
133
|
-
|
133
|
+
static bool IsSigned() {
|
134
134
|
return false;
|
135
135
|
}
|
136
|
-
|
136
|
+
static idx_t Digits() {
|
137
137
|
return 5;
|
138
138
|
}
|
139
139
|
};
|
140
140
|
template <>
|
141
141
|
struct NumericLimits<uint32_t> {
|
142
|
-
|
142
|
+
static constexpr uint32_t Minimum() {
|
143
143
|
return std::numeric_limits<uint32_t>::lowest();
|
144
144
|
};
|
145
|
-
|
145
|
+
static constexpr uint32_t Maximum() {
|
146
146
|
return std::numeric_limits<uint32_t>::max();
|
147
147
|
};
|
148
|
-
|
148
|
+
static bool IsSigned() {
|
149
149
|
return false;
|
150
150
|
}
|
151
|
-
|
151
|
+
static idx_t Digits() {
|
152
152
|
return 10;
|
153
153
|
}
|
154
154
|
};
|
155
155
|
template <>
|
156
156
|
struct NumericLimits<uint64_t> {
|
157
|
-
|
157
|
+
static constexpr uint64_t Minimum() {
|
158
158
|
return std::numeric_limits<uint64_t>::lowest();
|
159
159
|
};
|
160
|
-
|
160
|
+
static constexpr uint64_t Maximum() {
|
161
161
|
return std::numeric_limits<uint64_t>::max();
|
162
162
|
};
|
163
|
-
|
163
|
+
static bool IsSigned() {
|
164
164
|
return false;
|
165
165
|
}
|
166
|
-
|
166
|
+
static idx_t Digits() {
|
167
167
|
return 20;
|
168
168
|
}
|
169
169
|
};
|
170
170
|
template <>
|
171
171
|
struct NumericLimits<float> {
|
172
|
-
|
172
|
+
static constexpr float Minimum() {
|
173
173
|
return std::numeric_limits<float>::lowest();
|
174
174
|
};
|
175
|
-
|
175
|
+
static constexpr float Maximum() {
|
176
176
|
return std::numeric_limits<float>::max();
|
177
177
|
};
|
178
|
-
|
178
|
+
static bool IsSigned() {
|
179
179
|
return true;
|
180
180
|
}
|
181
|
-
|
181
|
+
static idx_t Digits() {
|
182
182
|
return 127;
|
183
183
|
}
|
184
184
|
};
|
185
185
|
template <>
|
186
186
|
struct NumericLimits<double> {
|
187
|
-
|
187
|
+
static constexpr double Minimum() {
|
188
188
|
return std::numeric_limits<double>::lowest();
|
189
189
|
};
|
190
|
-
|
190
|
+
static constexpr double Maximum() {
|
191
191
|
return std::numeric_limits<double>::max();
|
192
192
|
};
|
193
|
-
|
193
|
+
static bool IsSigned() {
|
194
194
|
return true;
|
195
195
|
}
|
196
|
-
|
196
|
+
static idx_t Digits() {
|
197
197
|
return 250;
|
198
198
|
}
|
199
199
|
};
|
@@ -22,21 +22,21 @@ class Vector;
|
|
22
22
|
|
23
23
|
struct TryCast {
|
24
24
|
template <class SRC, class DST>
|
25
|
-
|
25
|
+
static inline bool Operation(SRC input, DST &result, bool strict = false) {
|
26
26
|
throw NotImplementedException("Unimplemented type for cast (%s -> %s)", GetTypeId<SRC>(), GetTypeId<DST>());
|
27
27
|
}
|
28
28
|
};
|
29
29
|
|
30
30
|
struct TryCastErrorMessage {
|
31
31
|
template <class SRC, class DST>
|
32
|
-
|
32
|
+
static inline bool Operation(SRC input, DST &result, string *error_message, bool strict = false) {
|
33
33
|
throw NotImplementedException("Unimplemented type for cast (%s -> %s)", GetTypeId<SRC>(), GetTypeId<DST>());
|
34
34
|
}
|
35
35
|
};
|
36
36
|
|
37
37
|
struct TryCastErrorMessageCommaSeparated {
|
38
38
|
template <class SRC, class DST>
|
39
|
-
|
39
|
+
static inline bool Operation(SRC input, DST &result, string *error_message, bool strict = false) {
|
40
40
|
throw NotImplementedException("Unimplemented type for cast (%s -> %s)", GetTypeId<SRC>(), GetTypeId<DST>());
|
41
41
|
}
|
42
42
|
};
|
@@ -520,21 +520,21 @@ DUCKDB_API bool TryCastErrorMessage::Operation(string_t input, interval_t &resul
|
|
520
520
|
//===--------------------------------------------------------------------===//
|
521
521
|
struct TryCastToTimestampNS {
|
522
522
|
template <class SRC, class DST>
|
523
|
-
|
523
|
+
static inline bool Operation(SRC input, DST &result, bool strict = false) {
|
524
524
|
throw InternalException("Unsupported type for try cast to timestamp (ns)");
|
525
525
|
}
|
526
526
|
};
|
527
527
|
|
528
528
|
struct TryCastToTimestampMS {
|
529
529
|
template <class SRC, class DST>
|
530
|
-
|
530
|
+
static inline bool Operation(SRC input, DST &result, bool strict = false) {
|
531
531
|
throw InternalException("Unsupported type for try cast to timestamp (ms)");
|
532
532
|
}
|
533
533
|
};
|
534
534
|
|
535
535
|
struct TryCastToTimestampSec {
|
536
536
|
template <class SRC, class DST>
|
537
|
-
|
537
|
+
static inline bool Operation(SRC input, DST &result, bool strict = false) {
|
538
538
|
throw InternalException("Unsupported type for try cast to timestamp (s)");
|
539
539
|
}
|
540
540
|
};
|
@@ -702,8 +702,8 @@ duckdb::string_t CastFromUUID::Operation(duckdb::hugeint_t input, Vector &vector
|
|
702
702
|
|
703
703
|
struct TryCastToUUID {
|
704
704
|
template <class SRC, class DST>
|
705
|
-
|
706
|
-
|
705
|
+
static inline bool Operation(SRC input, DST &result, Vector &result_vector, string *error_message,
|
706
|
+
bool strict = false) {
|
707
707
|
throw InternalException("Unsupported type for try cast to uuid");
|
708
708
|
}
|
709
709
|
};
|
@@ -23,41 +23,41 @@ namespace duckdb {
|
|
23
23
|
//===--------------------------------------------------------------------===//
|
24
24
|
struct Equals {
|
25
25
|
template <class T>
|
26
|
-
|
26
|
+
static inline bool Operation(const T &left, const T &right) {
|
27
27
|
return left == right;
|
28
28
|
}
|
29
29
|
};
|
30
30
|
struct NotEquals {
|
31
31
|
template <class T>
|
32
|
-
|
32
|
+
static inline bool Operation(const T &left, const T &right) {
|
33
33
|
return !Equals::Operation(left, right);
|
34
34
|
}
|
35
35
|
};
|
36
36
|
|
37
37
|
struct GreaterThan {
|
38
38
|
template <class T>
|
39
|
-
|
39
|
+
static inline bool Operation(const T &left, const T &right) {
|
40
40
|
return left > right;
|
41
41
|
}
|
42
42
|
};
|
43
43
|
|
44
44
|
struct GreaterThanEquals {
|
45
45
|
template <class T>
|
46
|
-
|
46
|
+
static inline bool Operation(const T &left, const T &right) {
|
47
47
|
return !GreaterThan::Operation(right, left);
|
48
48
|
}
|
49
49
|
};
|
50
50
|
|
51
51
|
struct LessThan {
|
52
52
|
template <class T>
|
53
|
-
|
53
|
+
static inline bool Operation(const T &left, const T &right) {
|
54
54
|
return GreaterThan::Operation(right, left);
|
55
55
|
}
|
56
56
|
};
|
57
57
|
|
58
58
|
struct LessThanEquals {
|
59
59
|
template <class T>
|
60
|
-
|
60
|
+
static inline bool Operation(const T &left, const T &right) {
|
61
61
|
return !GreaterThan::Operation(left, right);
|
62
62
|
}
|
63
63
|
};
|
@@ -17,7 +17,7 @@ namespace duckdb {
|
|
17
17
|
|
18
18
|
struct ConvertToString {
|
19
19
|
template <class SRC>
|
20
|
-
|
20
|
+
static inline string Operation(SRC input) {
|
21
21
|
throw InternalException("Unrecognized type for ConvertToString %s", GetTypeId<SRC>());
|
22
22
|
}
|
23
23
|
};
|
@@ -17,16 +17,14 @@ namespace duckdb {
|
|
17
17
|
//===--------------------------------------------------------------------===//
|
18
18
|
struct TryCastToDecimal {
|
19
19
|
template <class SRC, class DST>
|
20
|
-
|
21
|
-
uint8_t scale) {
|
20
|
+
static inline bool Operation(SRC input, DST &result, string *error_message, uint8_t width, uint8_t scale) {
|
22
21
|
throw NotImplementedException("Unimplemented type for TryCastToDecimal!");
|
23
22
|
}
|
24
23
|
};
|
25
24
|
|
26
25
|
struct TryCastToDecimalCommaSeparated {
|
27
26
|
template <class SRC, class DST>
|
28
|
-
|
29
|
-
uint8_t scale) {
|
27
|
+
static inline bool Operation(SRC input, DST &result, string *error_message, uint8_t width, uint8_t scale) {
|
30
28
|
throw NotImplementedException("Unimplemented type for TryCastToDecimal!");
|
31
29
|
}
|
32
30
|
};
|
@@ -20,7 +20,7 @@ class Vector;
|
|
20
20
|
|
21
21
|
struct StringCast {
|
22
22
|
template <class SRC>
|
23
|
-
|
23
|
+
static inline string_t Operation(SRC input, Vector &result) {
|
24
24
|
throw NotImplementedException("Unimplemented type for string cast!");
|
25
25
|
}
|
26
26
|
};
|
@@ -72,7 +72,7 @@ bool TrySubtractOperator::Operation(hugeint_t left, hugeint_t right, hugeint_t &
|
|
72
72
|
|
73
73
|
struct SubtractOperatorOverflowCheck {
|
74
74
|
template <class TA, class TB, class TR>
|
75
|
-
|
75
|
+
static inline TR Operation(TA left, TB right) {
|
76
76
|
TR result;
|
77
77
|
if (!TrySubtractOperator::Operation(left, right, result)) {
|
78
78
|
throw OutOfRangeException("Overflow in subtraction of %s (%d - %d)!", TypeIdToString(GetTypeId<TA>()), left,
|
@@ -39,7 +39,7 @@ public:
|
|
39
39
|
//! Let's us do things like 'if (error)'
|
40
40
|
DUCKDB_API operator bool() const;
|
41
41
|
DUCKDB_API bool operator==(const PreservedError &other) const;
|
42
|
-
|
42
|
+
const shared_ptr<Exception> &GetError() {
|
43
43
|
return exception_instance;
|
44
44
|
}
|
45
45
|
|
@@ -15,7 +15,7 @@ enum class RegexOptions : uint8_t { NONE, CASE_INSENSITIVE };
|
|
15
15
|
class Regex {
|
16
16
|
public:
|
17
17
|
DUCKDB_API Regex(const std::string &pattern, RegexOptions options = RegexOptions::NONE);
|
18
|
-
|
18
|
+
Regex(const char *pattern, RegexOptions options = RegexOptions::NONE) : Regex(std::string(pattern)) {
|
19
19
|
}
|
20
20
|
const duckdb_re2::RE2 &GetRegex() const {
|
21
21
|
return *regex;
|
@@ -45,25 +45,25 @@ public:
|
|
45
45
|
throw InvalidInputException("Invalid input for binary digit: %s", string(c, 1));
|
46
46
|
}
|
47
47
|
|
48
|
-
|
48
|
+
static bool CharacterIsSpace(char c) {
|
49
49
|
return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r';
|
50
50
|
}
|
51
|
-
|
51
|
+
static bool CharacterIsNewline(char c) {
|
52
52
|
return c == '\n' || c == '\r';
|
53
53
|
}
|
54
|
-
|
54
|
+
static bool CharacterIsDigit(char c) {
|
55
55
|
return c >= '0' && c <= '9';
|
56
56
|
}
|
57
|
-
|
57
|
+
static bool CharacterIsHex(char c) {
|
58
58
|
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
|
59
59
|
}
|
60
|
-
|
60
|
+
static char CharacterToLower(char c) {
|
61
61
|
if (c >= 'A' && c <= 'Z') {
|
62
62
|
return c - ('A' - 'a');
|
63
63
|
}
|
64
64
|
return c;
|
65
65
|
}
|
66
|
-
|
66
|
+
static char CharacterIsAlpha(char c) {
|
67
67
|
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
|
68
68
|
}
|
69
69
|
static bool CharacterIsOperator(char c) {
|
@@ -200,7 +200,7 @@ public:
|
|
200
200
|
|
201
201
|
//! Returns true if two null-terminated strings are equal or point to the same address.
|
202
202
|
//! Returns false if only one of the strings is nullptr
|
203
|
-
|
203
|
+
static bool Equals(const char *s1, const char *s2) {
|
204
204
|
if (s1 == s2) {
|
205
205
|
return true;
|
206
206
|
}
|
@@ -30,7 +30,7 @@ public:
|
|
30
30
|
explicit ChunkCollection(ClientContext &context);
|
31
31
|
|
32
32
|
//! The types of columns in the ChunkCollection
|
33
|
-
|
33
|
+
vector<LogicalType> &Types() {
|
34
34
|
return types;
|
35
35
|
}
|
36
36
|
const vector<LogicalType> &Types() const {
|
@@ -38,12 +38,12 @@ public:
|
|
38
38
|
}
|
39
39
|
|
40
40
|
//! The amount of rows in the ChunkCollection
|
41
|
-
|
41
|
+
const idx_t &Count() const {
|
42
42
|
return count;
|
43
43
|
}
|
44
44
|
|
45
45
|
//! The amount of columns in the ChunkCollection
|
46
|
-
|
46
|
+
idx_t ColumnCount() const {
|
47
47
|
return types.size();
|
48
48
|
}
|
49
49
|
|
@@ -76,12 +76,12 @@ public:
|
|
76
76
|
DUCKDB_API void Print() const;
|
77
77
|
|
78
78
|
//! Gets a reference to the chunk at the given index
|
79
|
-
|
79
|
+
DataChunk &GetChunkForRow(idx_t row_index) {
|
80
80
|
return *chunks[LocateChunk(row_index)];
|
81
81
|
}
|
82
82
|
|
83
83
|
//! Gets a reference to the chunk at the given index
|
84
|
-
|
84
|
+
DataChunk &GetChunk(idx_t chunk_index) {
|
85
85
|
D_ASSERT(chunk_index < chunks.size());
|
86
86
|
return *chunks[chunk_index];
|
87
87
|
}
|
@@ -90,21 +90,21 @@ public:
|
|
90
90
|
return *chunks[chunk_index];
|
91
91
|
}
|
92
92
|
|
93
|
-
|
93
|
+
const vector<unique_ptr<DataChunk>> &Chunks() {
|
94
94
|
return chunks;
|
95
95
|
}
|
96
96
|
|
97
|
-
|
97
|
+
idx_t ChunkCount() const {
|
98
98
|
return chunks.size();
|
99
99
|
}
|
100
100
|
|
101
|
-
|
101
|
+
void Reset() {
|
102
102
|
count = 0;
|
103
103
|
chunks.clear();
|
104
104
|
types.clear();
|
105
105
|
}
|
106
106
|
|
107
|
-
|
107
|
+
unique_ptr<DataChunk> Fetch() {
|
108
108
|
if (ChunkCount() == 0) {
|
109
109
|
return nullptr;
|
110
110
|
}
|
@@ -115,7 +115,7 @@ public:
|
|
115
115
|
}
|
116
116
|
|
117
117
|
//! Locates the chunk that belongs to the specific index
|
118
|
-
|
118
|
+
idx_t LocateChunk(idx_t index) {
|
119
119
|
idx_t result = index / STANDARD_VECTOR_SIZE;
|
120
120
|
D_ASSERT(result < chunks.size());
|
121
121
|
return result;
|
@@ -44,20 +44,20 @@ public:
|
|
44
44
|
|
45
45
|
public:
|
46
46
|
//! The types of columns in the ColumnDataCollection
|
47
|
-
|
47
|
+
vector<LogicalType> &Types() {
|
48
48
|
return types;
|
49
49
|
}
|
50
|
-
|
50
|
+
const vector<LogicalType> &Types() const {
|
51
51
|
return types;
|
52
52
|
}
|
53
53
|
|
54
54
|
//! The amount of rows in the ColumnDataCollection
|
55
|
-
|
55
|
+
const idx_t &Count() const {
|
56
56
|
return count;
|
57
57
|
}
|
58
58
|
|
59
59
|
//! The amount of columns in the ColumnDataCollection
|
60
|
-
|
60
|
+
idx_t ColumnCount() const {
|
61
61
|
return types.size();
|
62
62
|
}
|
63
63
|
|
@@ -177,32 +177,32 @@ public:
|
|
177
177
|
|
178
178
|
public:
|
179
179
|
// container API
|
180
|
-
|
180
|
+
bool empty() const {
|
181
181
|
return rows.empty();
|
182
182
|
}
|
183
|
-
|
183
|
+
idx_t size() const {
|
184
184
|
return rows.size();
|
185
185
|
}
|
186
186
|
|
187
187
|
DUCKDB_API ColumnDataRow &operator[](idx_t i);
|
188
188
|
DUCKDB_API const ColumnDataRow &operator[](idx_t i) const;
|
189
189
|
|
190
|
-
|
190
|
+
vector<ColumnDataRow>::iterator begin() {
|
191
191
|
return rows.begin();
|
192
192
|
}
|
193
|
-
|
193
|
+
vector<ColumnDataRow>::iterator end() {
|
194
194
|
return rows.end();
|
195
195
|
}
|
196
|
-
|
196
|
+
vector<ColumnDataRow>::const_iterator cbegin() const {
|
197
197
|
return rows.cbegin();
|
198
198
|
}
|
199
|
-
|
199
|
+
vector<ColumnDataRow>::const_iterator cend() const {
|
200
200
|
return rows.cend();
|
201
201
|
}
|
202
|
-
|
202
|
+
vector<ColumnDataRow>::const_iterator begin() const {
|
203
203
|
return rows.begin();
|
204
204
|
}
|
205
|
-
|
205
|
+
vector<ColumnDataRow>::const_iterator end() const {
|
206
206
|
return rows.end();
|
207
207
|
}
|
208
208
|
|
package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_iterators.hpp
CHANGED
@@ -43,10 +43,10 @@ private:
|
|
43
43
|
};
|
44
44
|
|
45
45
|
public:
|
46
|
-
|
46
|
+
ColumnDataChunkIterator begin() {
|
47
47
|
return ColumnDataChunkIterator(&collection, column_ids);
|
48
48
|
}
|
49
|
-
|
49
|
+
ColumnDataChunkIterator end() {
|
50
50
|
return ColumnDataChunkIterator(nullptr, vector<column_t>());
|
51
51
|
}
|
52
52
|
};
|
@@ -165,7 +165,7 @@ public:
|
|
165
165
|
|
166
166
|
//! Create a blob Value from a data pointer and a length: no bytes are interpreted
|
167
167
|
DUCKDB_API static Value BLOB(const_data_ptr_t data, idx_t len);
|
168
|
-
|
168
|
+
static Value BLOB_RAW(const string &data) { // NOLINT
|
169
169
|
return Value::BLOB((const_data_ptr_t)data.c_str(), data.size());
|
170
170
|
}
|
171
171
|
//! Creates a blob by casting a specified string to a blob (i.e. interpreting \x characters)
|
@@ -308,14 +308,14 @@ struct LogicalType {
|
|
308
308
|
DUCKDB_API static LogicalType FormatDeserialize(FormatDeserializer &deserializer);
|
309
309
|
|
310
310
|
|
311
|
-
|
311
|
+
static bool TypeIsTimestamp(LogicalTypeId id) {
|
312
312
|
return (id == LogicalTypeId::TIMESTAMP ||
|
313
313
|
id == LogicalTypeId::TIMESTAMP_MS ||
|
314
314
|
id == LogicalTypeId::TIMESTAMP_NS ||
|
315
315
|
id == LogicalTypeId::TIMESTAMP_SEC ||
|
316
316
|
id == LogicalTypeId::TIMESTAMP_TZ);
|
317
317
|
}
|
318
|
-
|
318
|
+
static bool TypeIsTimestamp(const LogicalType& type) {
|
319
319
|
return TypeIsTimestamp(type.id());
|
320
320
|
}
|
321
321
|
DUCKDB_API string ToString() const;
|
@@ -48,7 +48,7 @@ struct ExecuteFunctionState : public ExpressionState {
|
|
48
48
|
unique_ptr<FunctionLocalState> local_state;
|
49
49
|
|
50
50
|
public:
|
51
|
-
|
51
|
+
static FunctionLocalState *GetFunctionState(ExpressionState &state) {
|
52
52
|
return ((ExecuteFunctionState &)state).local_state.get();
|
53
53
|
}
|
54
54
|
};
|