duckdb 0.7.2-dev2320.0 → 0.7.2-dev2410.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/data_chunk.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +2 -2
- package/src/duckdb/extension/icu/icu-makedate.cpp +52 -0
- package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/calendar.cpp +4 -0
- package/src/duckdb/extension/icu/third_party/icu/i18n/dangical.cpp +28 -28
- package/src/duckdb/extension/icu/third_party/icu/i18n/dangical.h +4 -4
- package/src/duckdb/extension/json/include/json_common.hpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_create.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +1 -1
- package/src/duckdb/extension/json/json_functions.cpp +2 -2
- package/src/duckdb/extension/json/json_serializer.cpp +1 -1
- package/src/duckdb/extension/parquet/column_reader.cpp +1 -1
- package/src/duckdb/extension/parquet/column_writer.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +2 -2
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +2 -2
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/file_buffer.cpp +8 -0
- package/src/duckdb/src/common/operator/cast_operators.cpp +24 -25
- package/src/duckdb/src/common/radix_partitioning.cpp +34 -0
- package/src/duckdb/src/common/row_operations/row_heap_scatter.cpp +2 -2
- package/src/duckdb/src/common/row_operations/row_scatter.cpp +1 -1
- package/src/duckdb/src/common/sort/partition_state.cpp +44 -124
- package/src/duckdb/src/common/sort/sorted_block.cpp +1 -1
- package/src/duckdb/src/common/types/bit.cpp +18 -18
- package/src/duckdb/src/common/types/blob.cpp +7 -7
- package/src/duckdb/src/common/types/column/column_data_allocator.cpp +1 -1
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +1 -1
- package/src/duckdb/src/common/types/hash.cpp +1 -1
- package/src/duckdb/src/common/types/hyperloglog.cpp +1 -1
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +2 -2
- package/src/duckdb/src/common/types/string_heap.cpp +2 -2
- package/src/duckdb/src/common/types/string_type.cpp +2 -2
- package/src/duckdb/src/common/types/timestamp.cpp +1 -1
- package/src/duckdb/src/common/types/vector.cpp +7 -7
- package/src/duckdb/src/execution/index/art/art_key.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +144 -31
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +698 -0
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_asof_join.cpp +7 -1
- package/src/duckdb/src/function/aggregate/distributive/arg_min_max.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/bitagg.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/bitstring_agg.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/kurtosis.cpp +3 -2
- package/src/duckdb/src/function/aggregate/distributive/minmax.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/skew.cpp +5 -1
- package/src/duckdb/src/function/aggregate/distributive/string_agg.cpp +1 -1
- package/src/duckdb/src/function/cast/list_casts.cpp +1 -1
- package/src/duckdb/src/function/cast/struct_cast.cpp +1 -1
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +3 -3
- package/src/duckdb/src/function/scalar/bit/bitstring.cpp +1 -1
- package/src/duckdb/src/function/scalar/blob/encode.cpp +1 -1
- package/src/duckdb/src/function/scalar/date/strftime.cpp +3 -3
- package/src/duckdb/src/function/scalar/generic/current_setting.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/list_sort.cpp +30 -56
- package/src/duckdb/src/function/scalar/string/ascii.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/concat.cpp +6 -6
- package/src/duckdb/src/function/scalar/string/contains.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/damerau_levenshtein.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/hex.cpp +4 -4
- package/src/duckdb/src/function/scalar/string/instr.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/jaccard.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/jaro_winkler.cpp +5 -5
- package/src/duckdb/src/function/scalar/string/length.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/levenshtein.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/like.cpp +10 -11
- package/src/duckdb/src/function/scalar/string/mismatches.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/nfc_normalize.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/pad.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/prefix.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/printf.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +4 -4
- package/src/duckdb/src/function/scalar/string/repeat.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/replace.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/reverse.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/starts_with.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/string_split.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/strip_accents.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/substring.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/suffix.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/translate.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/trim.cpp +3 -3
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +1 -1
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -7
- package/src/duckdb/src/function/scalar/union/union_extract.cpp +1 -1
- package/src/duckdb/src/function/table/copy_csv.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +2 -2
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/common/crypto/md5.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/enums/debug_initialize.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/enums/order_type.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/radix.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +11 -60
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +8 -6
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/outer_join_marker.hpp +6 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +93 -0
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +17 -0
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/capi/cast/utils.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/config.hpp +7 -2
- package/src/duckdb/src/include/duckdb/main/settings.hpp +13 -3
- package/src/duckdb/src/include/duckdb/optimizer/cse_optimizer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +4 -2
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/aggregate_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +4 -3
- package/src/duckdb/src/include/duckdb/planner/expression_binder/check_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/constant_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/insert_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/lateral_binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/qualify_binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/relation_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/returning_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/update_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/where_binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +12 -9
- package/src/duckdb/src/include/duckdb/storage/block_manager.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +11 -5
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +1 -1
- package/src/duckdb/src/main/capi/cast/from_decimal-c.cpp +1 -1
- package/src/duckdb/src/main/capi/result-c.cpp +2 -2
- package/src/duckdb/src/main/config.cpp +26 -0
- package/src/duckdb/src/main/settings/settings.cpp +31 -8
- package/src/duckdb/src/optimizer/cse_optimizer.cpp +9 -8
- package/src/duckdb/src/parser/expression/subquery_expression.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -0
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +33 -29
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +8 -10
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +8 -7
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +6 -6
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +6 -14
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +2 -5
- package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +1 -1
- package/src/duckdb/src/planner/binder/query_node/plan_select_node.cpp +8 -8
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +5 -5
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +2 -2
- package/src/duckdb/src/planner/binder/tableref/plan_expressionlistref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +4 -4
- package/src/duckdb/src/planner/expression.cpp +2 -1
- package/src/duckdb/src/planner/expression_binder/aggregate_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder/check_binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/constant_binder.cpp +3 -3
- package/src/duckdb/src/planner/expression_binder/group_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/having_binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder/index_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/insert_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +3 -3
- package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder/relation_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/returning_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +3 -3
- package/src/duckdb/src/planner/expression_binder/update_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/where_binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder.cpp +12 -12
- package/src/duckdb/src/storage/buffer/block_manager.cpp +1 -2
- package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +2 -2
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +1 -1
- package/src/duckdb/src/storage/compression/fsst.cpp +3 -3
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +1 -1
- package/src/duckdb/src/storage/meta_block_writer.cpp +4 -0
- package/src/duckdb/src/storage/partial_block_manager.cpp +11 -4
- package/src/duckdb/src/storage/single_file_block_manager.cpp +16 -9
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +5 -2
- package/src/duckdb/src/storage/statistics/string_stats.cpp +2 -2
- package/src/duckdb/src/storage/storage_manager.cpp +7 -2
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +21 -1
- package/src/duckdb/ub_src_execution_operator_join.cpp +2 -0
- package/src/statement.cpp +3 -3
@@ -52,7 +52,7 @@ SinkResultType PhysicalCreateType::Sink(ExecutionContext &context, GlobalSinkSta
|
|
52
52
|
throw InvalidInputException("Attempted to create ENUM type with NULL value!");
|
53
53
|
}
|
54
54
|
result_ptr[gstate.size++] =
|
55
|
-
StringVector::AddStringOrBlob(gstate.result, src_ptr[idx].
|
55
|
+
StringVector::AddStringOrBlob(gstate.result, src_ptr[idx].GetData(), src_ptr[idx].GetSize());
|
56
56
|
}
|
57
57
|
return SinkResultType::NEED_MORE_INPUT;
|
58
58
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "duckdb/execution/operator/aggregate/physical_window.hpp"
|
2
|
+
#include "duckdb/execution/operator/join/physical_asof_join.hpp"
|
2
3
|
#include "duckdb/execution/operator/join/physical_iejoin.hpp"
|
3
4
|
#include "duckdb/execution/operator/projection/physical_projection.hpp"
|
4
5
|
#include "duckdb/execution/physical_plan_generator.hpp"
|
@@ -39,7 +40,11 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalAsOfJoin &
|
|
39
40
|
}
|
40
41
|
D_ASSERT(asof_idx < op.conditions.size());
|
41
42
|
|
42
|
-
|
43
|
+
if (!ClientConfig::GetConfig(context).force_asof_iejoin) {
|
44
|
+
return make_uniq<PhysicalAsOfJoin>(op, std::move(left), std::move(right));
|
45
|
+
}
|
46
|
+
|
47
|
+
// Debug implementation: IEJoin of Window
|
43
48
|
// LEAD(asof_column, 1, infinity) OVER (PARTITION BY equi_column... ORDER BY asof_column) AS asof_temp
|
44
49
|
auto &asof_comp = op.conditions[asof_idx];
|
45
50
|
auto &asof_column = asof_comp.right;
|
@@ -47,6 +52,7 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalAsOfJoin &
|
|
47
52
|
auto asof_temp = make_uniq<BoundWindowExpression>(ExpressionType::WINDOW_LEAD, asof_type, nullptr, nullptr);
|
48
53
|
asof_temp->children.emplace_back(asof_column->Copy());
|
49
54
|
asof_temp->offset_expr = make_uniq<BoundConstantExpression>(Value::BIGINT(1));
|
55
|
+
// TODO: If infinities are not supported for a type, fake them by looking at LHS statistics?
|
50
56
|
asof_temp->default_expr = make_uniq<BoundConstantExpression>(Value::Infinity(asof_type));
|
51
57
|
for (auto equi_idx : equi_indexes) {
|
52
58
|
asof_temp->partitions.emplace_back(op.conditions[equi_idx].right->Copy());
|
@@ -41,7 +41,7 @@ void ArgMinMaxStateBase::CreateValue(Vector *&value) {
|
|
41
41
|
template <>
|
42
42
|
void ArgMinMaxStateBase::DestroyValue(string_t &value) {
|
43
43
|
if (!value.IsInlined()) {
|
44
|
-
delete[] value.
|
44
|
+
delete[] value.GetData();
|
45
45
|
}
|
46
46
|
}
|
47
47
|
|
@@ -62,7 +62,7 @@ void ArgMinMaxStateBase::AssignValue(string_t &target, string_t new_value, bool
|
|
62
62
|
// non-inlined string, need to allocate space for it
|
63
63
|
auto len = new_value.GetSize();
|
64
64
|
auto ptr = new char[len];
|
65
|
-
memcpy(ptr, new_value.
|
65
|
+
memcpy(ptr, new_value.GetData(), len);
|
66
66
|
|
67
67
|
target = string_t(ptr, len);
|
68
68
|
}
|
@@ -130,7 +130,7 @@ struct BitStringBitwiseOperation : public BitwiseOperation {
|
|
130
130
|
template <class STATE>
|
131
131
|
static void Destroy(AggregateInputData &aggr_input_data, STATE *state) {
|
132
132
|
if (state->is_set && !state->value.IsInlined()) {
|
133
|
-
delete[] state->value.
|
133
|
+
delete[] state->value.GetData();
|
134
134
|
}
|
135
135
|
}
|
136
136
|
|
@@ -142,7 +142,7 @@ struct BitStringBitwiseOperation : public BitwiseOperation {
|
|
142
142
|
} else { // non-inlined string, need to allocate space for it
|
143
143
|
auto len = input.GetSize();
|
144
144
|
auto ptr = new char[len];
|
145
|
-
memcpy(ptr, input.
|
145
|
+
memcpy(ptr, input.GetData(), len);
|
146
146
|
|
147
147
|
state->value = string_t(ptr, len);
|
148
148
|
}
|
@@ -134,7 +134,7 @@ struct BitStringAggOperation {
|
|
134
134
|
} else { // non-inlined string, need to allocate space for it
|
135
135
|
auto len = input.GetSize();
|
136
136
|
auto ptr = new char[len];
|
137
|
-
memcpy(ptr, input.
|
137
|
+
memcpy(ptr, input.GetData(), len);
|
138
138
|
state->value = string_t(ptr, len);
|
139
139
|
}
|
140
140
|
}
|
@@ -151,7 +151,7 @@ struct BitStringAggOperation {
|
|
151
151
|
template <class STATE>
|
152
152
|
static void Destroy(AggregateInputData &aggr_input_data, STATE *state) {
|
153
153
|
if (state->is_set && !state->value.IsInlined()) {
|
154
|
-
delete[] state->value.
|
154
|
+
delete[] state->value.GetData();
|
155
155
|
}
|
156
156
|
}
|
157
157
|
|
@@ -86,7 +86,7 @@ struct FirstFunctionString : public FirstFunctionBase {
|
|
86
86
|
// non-inlined string, need to allocate space for it
|
87
87
|
auto len = value.GetSize();
|
88
88
|
auto ptr = new char[len];
|
89
|
-
memcpy(ptr, value.
|
89
|
+
memcpy(ptr, value.GetData(), len);
|
90
90
|
|
91
91
|
state->value = string_t(ptr, len);
|
92
92
|
}
|
@@ -126,7 +126,7 @@ struct FirstFunctionString : public FirstFunctionBase {
|
|
126
126
|
template <class STATE>
|
127
127
|
static void Destroy(AggregateInputData &aggr_input_data, STATE *state) {
|
128
128
|
if (state->is_set && !state->is_null && !state->value.IsInlined()) {
|
129
|
-
delete[] state->value.
|
129
|
+
delete[] state->value.GetData();
|
130
130
|
}
|
131
131
|
}
|
132
132
|
};
|
@@ -70,9 +70,10 @@ struct KurtosisOperation {
|
|
70
70
|
6 * state->sum_sqr * state->sum * state->sum * temp * temp - 3 * pow(state->sum, 4) * pow(temp, 3));
|
71
71
|
|
72
72
|
double m2 = temp * (state->sum_sqr - state->sum * state->sum * temp);
|
73
|
-
if (
|
73
|
+
if (m2 <= 0 || ((n - 2) * (n - 3)) == 0) { // m2 shouldn't be below 0 but floating points are weird
|
74
74
|
mask.SetInvalid(idx);
|
75
|
-
|
75
|
+
return;
|
76
|
+
}
|
76
77
|
target[idx] = (n - 1) * ((n + 1) * m4 / (m2 * m2) - 3 * (n - 1)) / ((n - 2) * (n - 3));
|
77
78
|
if (!Value::DoubleIsFinite(target[idx])) {
|
78
79
|
throw OutOfRangeException("Kurtosis is out of range!");
|
@@ -144,7 +144,7 @@ struct StringMinMaxBase : public MinMaxBase {
|
|
144
144
|
template <class STATE>
|
145
145
|
static void Destroy(AggregateInputData &aggr_input_data, STATE *state) {
|
146
146
|
if (state->isset && !state->value.IsInlined()) {
|
147
|
-
delete[] state->value.
|
147
|
+
delete[] state->value.GetData();
|
148
148
|
}
|
149
149
|
}
|
150
150
|
|
@@ -157,7 +157,7 @@ struct StringMinMaxBase : public MinMaxBase {
|
|
157
157
|
// non-inlined string, need to allocate space for it
|
158
158
|
auto len = input.GetSize();
|
159
159
|
auto ptr = new char[len];
|
160
|
-
memcpy(ptr, input.
|
160
|
+
memcpy(ptr, input.GetData(), len);
|
161
161
|
|
162
162
|
state->value = string_t(ptr, len);
|
163
163
|
}
|
@@ -56,7 +56,11 @@ struct SkewnessOperation {
|
|
56
56
|
}
|
57
57
|
double n = state->n;
|
58
58
|
double temp = 1 / n;
|
59
|
-
|
59
|
+
auto p = std::pow(temp * (state->sum_sqr - state->sum * state->sum * temp), 3);
|
60
|
+
if (p < 0) {
|
61
|
+
p = 0; // Shouldn't be below 0 but floating points are weird
|
62
|
+
}
|
63
|
+
double div = std::sqrt(p);
|
60
64
|
if (div == 0) {
|
61
65
|
mask.SetInvalid(idx);
|
62
66
|
return;
|
@@ -90,7 +90,7 @@ struct StringAggFunction {
|
|
90
90
|
|
91
91
|
static inline void PerformOperation(StringAggState *state, string_t str, FunctionData *data_p) {
|
92
92
|
auto &data = data_p->Cast<StringAggBindData>();
|
93
|
-
PerformOperation(state, str.
|
93
|
+
PerformOperation(state, str.GetData(), data.sep.c_str(), str.GetSize(), data.sep.size());
|
94
94
|
}
|
95
95
|
|
96
96
|
template <class INPUT_TYPE, class STATE, class OP>
|
@@ -106,7 +106,7 @@ static bool ListToVarcharCast(Vector &source, Vector &result, idx_t count, CastP
|
|
106
106
|
}
|
107
107
|
if (child_validity.RowIsValid(idx)) {
|
108
108
|
auto len = child_data[idx].GetSize();
|
109
|
-
memcpy(dataptr + offset, child_data[idx].
|
109
|
+
memcpy(dataptr + offset, child_data[idx].GetData(), len);
|
110
110
|
offset += len;
|
111
111
|
} else {
|
112
112
|
memcpy(dataptr + offset, "NULL", NULL_LENGTH);
|
@@ -118,7 +118,7 @@ static bool StructToVarcharCast(Vector &source, Vector &result, idx_t count, Cas
|
|
118
118
|
// value
|
119
119
|
if (child_validity.RowIsValid(i)) {
|
120
120
|
auto len = data[i].GetSize();
|
121
|
-
memcpy(dataptr + offset, data[i].
|
121
|
+
memcpy(dataptr + offset, data[i].GetData(), len);
|
122
122
|
offset += len;
|
123
123
|
} else {
|
124
124
|
memcpy(dataptr + offset, "NULL", NULL_LENGTH);
|
@@ -105,7 +105,7 @@ struct SplitStringListOperation {
|
|
105
105
|
|
106
106
|
template <class OP>
|
107
107
|
static bool SplitStringListInternal(const string_t &input, OP &state) {
|
108
|
-
const char *buf = input.
|
108
|
+
const char *buf = input.GetData();
|
109
109
|
idx_t len = input.GetSize();
|
110
110
|
idx_t lvl = 1;
|
111
111
|
idx_t pos = 0;
|
@@ -221,7 +221,7 @@ static bool FindKeyOrValueMap(const char *buf, idx_t len, idx_t &pos, OP &state,
|
|
221
221
|
|
222
222
|
template <class OP>
|
223
223
|
static bool SplitStringMapInternal(const string_t &input, OP &state) {
|
224
|
-
const char *buf = input.
|
224
|
+
const char *buf = input.GetData();
|
225
225
|
idx_t len = input.GetSize();
|
226
226
|
idx_t pos = 0;
|
227
227
|
|
@@ -301,7 +301,7 @@ static bool FindValueStruct(const char *buf, idx_t len, idx_t &pos, Vector &varc
|
|
301
301
|
|
302
302
|
bool VectorStringToStruct::SplitStruct(string_t &input, vector<unique_ptr<Vector>> &varchar_vectors, idx_t &row_idx,
|
303
303
|
string_map_t<idx_t> &child_names, vector<ValidityMask *> &child_masks) {
|
304
|
-
const char *buf = input.
|
304
|
+
const char *buf = input.GetData();
|
305
305
|
idx_t len = input.GetSize();
|
306
306
|
idx_t pos = 0;
|
307
307
|
idx_t child_idx;
|
@@ -68,7 +68,7 @@ static void SetBitOperation(DataChunk &args, ExpressionState &state, Vector &res
|
|
68
68
|
NumericHelper::ToString(Bit::BitLength(input) - 1));
|
69
69
|
}
|
70
70
|
string_t target = StringVector::EmptyString(result, input.GetSize());
|
71
|
-
memcpy(target.GetDataWriteable(), input.
|
71
|
+
memcpy(target.GetDataWriteable(), input.GetData(), input.GetSize());
|
72
72
|
Bit::SetBit(target, n, new_value);
|
73
73
|
return target;
|
74
74
|
});
|
@@ -12,7 +12,7 @@ static void EncodeFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
12
12
|
struct BlobDecodeOperator {
|
13
13
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
14
14
|
static RESULT_TYPE Operation(INPUT_TYPE input) {
|
15
|
-
auto input_data = input.
|
15
|
+
auto input_data = input.GetData();
|
16
16
|
auto input_length = input.GetSize();
|
17
17
|
if (Utf8Proc::Analyze(input_data, input_length) == UnicodeType::INVALID) {
|
18
18
|
throw ConversionException(
|
@@ -154,7 +154,7 @@ idx_t StrfTimeFormat::GetLength(date_t date, dtime_t time, int32_t utc_offset, c
|
|
154
154
|
|
155
155
|
char *StrfTimeFormat::WriteString(char *target, const string_t &str) {
|
156
156
|
idx_t size = str.GetSize();
|
157
|
-
memcpy(target, str.
|
157
|
+
memcpy(target, str.GetData(), size);
|
158
158
|
return target + size;
|
159
159
|
}
|
160
160
|
|
@@ -766,7 +766,7 @@ int32_t StrpTimeFormat::TryParseCollection(const char *data, idx_t &pos, idx_t s
|
|
766
766
|
idx_t collection_count) {
|
767
767
|
for (idx_t c = 0; c < collection_count; c++) {
|
768
768
|
auto &entry = collection[c];
|
769
|
-
auto entry_data = entry.
|
769
|
+
auto entry_data = entry.GetData();
|
770
770
|
auto entry_size = entry.GetSize();
|
771
771
|
// check if this entry matches
|
772
772
|
if (pos + entry_size > size) {
|
@@ -805,7 +805,7 @@ bool StrpTimeFormat::Parse(string_t str, ParseResult &result) {
|
|
805
805
|
result_data[6] = 0;
|
806
806
|
result_data[7] = 0;
|
807
807
|
|
808
|
-
auto data = str.
|
808
|
+
auto data = str.GetData();
|
809
809
|
idx_t size = str.GetSize();
|
810
810
|
// skip leading spaces
|
811
811
|
while (StringUtil::CharacterIsSpace(*data)) {
|
@@ -41,7 +41,7 @@ unique_ptr<FunctionData> CurrentSettingBind(ClientContext &context, ScalarFuncti
|
|
41
41
|
key_child->return_type.id() != LogicalTypeId::VARCHAR || !key_child->IsFoldable()) {
|
42
42
|
throw ParserException("Key name for current_setting needs to be a constant string");
|
43
43
|
}
|
44
|
-
Value key_val = ExpressionExecutor::EvaluateScalar(context, *key_child
|
44
|
+
Value key_val = ExpressionExecutor::EvaluateScalar(context, *key_child);
|
45
45
|
D_ASSERT(key_val.type().id() == LogicalTypeId::VARCHAR);
|
46
46
|
auto &key_str = StringValue::Get(key_val);
|
47
47
|
if (key_val.IsNull() || key_str.empty()) {
|
@@ -244,83 +244,57 @@ static unique_ptr<FunctionData> ListSortBind(ClientContext &context, ScalarFunct
|
|
244
244
|
return make_uniq<ListSortBindData>(order, null_order, bound_function.return_type, child_type, context);
|
245
245
|
}
|
246
246
|
|
247
|
-
|
248
|
-
|
249
|
-
if (!
|
250
|
-
throw InvalidInputException("
|
251
|
-
}
|
252
|
-
Value null_order_value = ExpressionExecutor::EvaluateScalar(context, *arguments[idx]);
|
253
|
-
auto null_order_name = StringUtil::Upper(null_order_value.ToString());
|
254
|
-
const auto null_order_arg = EnumSerializer::StringToEnum<OrderByNullType>(null_order_name.c_str());
|
255
|
-
switch (null_order_arg) {
|
256
|
-
case OrderByNullType::NULLS_FIRST:
|
257
|
-
case OrderByNullType::NULLS_LAST:
|
258
|
-
return null_order_arg;
|
259
|
-
case OrderByNullType::ORDER_DEFAULT:
|
260
|
-
return DBConfig::GetConfig(context).options.default_null_order;
|
261
|
-
default:
|
262
|
-
throw InvalidInputException("Null sorting order must be either NULLS FIRST, NULLS LAST or DEFAULT");
|
247
|
+
template <class T>
|
248
|
+
static T GetOrder(ClientContext &context, Expression &expr) {
|
249
|
+
if (!expr.IsFoldable()) {
|
250
|
+
throw InvalidInputException("Sorting order must be a constant");
|
263
251
|
}
|
252
|
+
Value order_value = ExpressionExecutor::EvaluateScalar(context, expr);
|
253
|
+
auto order_name = StringUtil::Upper(order_value.ToString());
|
254
|
+
return EnumSerializer::StringToEnum<T>(order_name.c_str());
|
264
255
|
}
|
265
256
|
|
266
257
|
static unique_ptr<FunctionData> ListNormalSortBind(ClientContext &context, ScalarFunction &bound_function,
|
267
258
|
vector<unique_ptr<Expression>> &arguments) {
|
268
|
-
|
269
|
-
D_ASSERT(!bound_function.arguments.empty() && bound_function.arguments.size() <= 3);
|
270
259
|
D_ASSERT(!arguments.empty() && arguments.size() <= 3);
|
271
|
-
|
272
|
-
|
273
|
-
auto &config = DBConfig::GetConfig(context);
|
274
|
-
auto order = config.options.default_order_type;
|
275
|
-
auto null_order = config.options.default_null_order;
|
260
|
+
auto order = OrderType::ORDER_DEFAULT;
|
261
|
+
auto null_order = OrderByNullType::ORDER_DEFAULT;
|
276
262
|
|
277
263
|
// get the sorting order
|
278
264
|
if (arguments.size() >= 2) {
|
279
|
-
|
280
|
-
if (!arguments[1]->IsFoldable()) {
|
281
|
-
throw InvalidInputException("Sorting order must be a constant");
|
282
|
-
}
|
283
|
-
Value order_value = ExpressionExecutor::EvaluateScalar(context, *arguments[1]);
|
284
|
-
|
285
|
-
const auto order_name = StringUtil::Upper(order_value.ToString());
|
286
|
-
const auto order_arg = EnumSerializer::StringToEnum<OrderType>(order_name.c_str());
|
287
|
-
switch (order_arg) {
|
288
|
-
case OrderType::ASCENDING:
|
289
|
-
case OrderType::DESCENDING:
|
290
|
-
order = order_arg;
|
291
|
-
break;
|
292
|
-
case OrderType::ORDER_DEFAULT:
|
293
|
-
break;
|
294
|
-
default:
|
295
|
-
throw InvalidInputException("Sorting order must be either ASC, DESC or DEFAULT");
|
296
|
-
}
|
265
|
+
order = GetOrder<OrderType>(context, *arguments[1]);
|
297
266
|
}
|
298
|
-
|
299
267
|
// get the null sorting order
|
300
268
|
if (arguments.size() == 3) {
|
301
|
-
null_order =
|
269
|
+
null_order = GetOrder<OrderByNullType>(context, *arguments[2]);
|
302
270
|
}
|
303
|
-
|
271
|
+
auto &config = DBConfig::GetConfig(context);
|
272
|
+
order = config.ResolveOrder(order);
|
273
|
+
null_order = config.ResolveNullOrder(order, null_order);
|
304
274
|
return ListSortBind(context, bound_function, arguments, order, null_order);
|
305
275
|
}
|
306
276
|
|
307
277
|
static unique_ptr<FunctionData> ListReverseSortBind(ClientContext &context, ScalarFunction &bound_function,
|
308
278
|
vector<unique_ptr<Expression>> &arguments) {
|
279
|
+
auto order = OrderType::ORDER_DEFAULT;
|
280
|
+
auto null_order = OrderByNullType::ORDER_DEFAULT;
|
309
281
|
|
310
|
-
D_ASSERT(bound_function.arguments.size() == 1 || bound_function.arguments.size() == 2);
|
311
|
-
D_ASSERT(arguments.size() == 1 || arguments.size() == 2);
|
312
|
-
|
313
|
-
// set (reverse) default values
|
314
|
-
auto &config = DBConfig::GetConfig(context);
|
315
|
-
auto order =
|
316
|
-
(config.options.default_order_type == OrderType::ASCENDING) ? OrderType::DESCENDING : OrderType::ASCENDING;
|
317
|
-
auto null_order = config.options.default_null_order;
|
318
|
-
|
319
|
-
// get the null sorting order
|
320
282
|
if (arguments.size() == 2) {
|
321
|
-
null_order =
|
283
|
+
null_order = GetOrder<OrderByNullType>(context, *arguments[1]);
|
322
284
|
}
|
323
|
-
|
285
|
+
auto &config = DBConfig::GetConfig(context);
|
286
|
+
order = config.ResolveOrder(order);
|
287
|
+
switch (order) {
|
288
|
+
case OrderType::ASCENDING:
|
289
|
+
order = OrderType::DESCENDING;
|
290
|
+
break;
|
291
|
+
case OrderType::DESCENDING:
|
292
|
+
order = OrderType::ASCENDING;
|
293
|
+
break;
|
294
|
+
default:
|
295
|
+
throw InternalException("Unexpected order type in list reverse sort");
|
296
|
+
}
|
297
|
+
null_order = config.ResolveNullOrder(order, null_order);
|
324
298
|
return ListSortBind(context, bound_function, arguments, order, null_order);
|
325
299
|
}
|
326
300
|
|
@@ -7,7 +7,7 @@ namespace duckdb {
|
|
7
7
|
struct AsciiOperator {
|
8
8
|
template <class TA, class TR>
|
9
9
|
static inline TR Operation(const TA &input) {
|
10
|
-
auto str = input.
|
10
|
+
auto str = input.GetData();
|
11
11
|
if (Utf8Proc::Analyze(str, input.GetSize()) == UnicodeType::ASCII) {
|
12
12
|
return str[0];
|
13
13
|
}
|
@@ -120,7 +120,7 @@ template <bool IS_UPPER>
|
|
120
120
|
struct CaseConvertOperator {
|
121
121
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
122
122
|
static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) {
|
123
|
-
auto input_data = input.
|
123
|
+
auto input_data = input.GetData();
|
124
124
|
auto input_length = input.GetSize();
|
125
125
|
return UnicodeCaseConvert<IS_UPPER>(result, input_data, input_length);
|
126
126
|
}
|
@@ -135,7 +135,7 @@ template <bool IS_UPPER>
|
|
135
135
|
struct CaseConvertOperatorASCII {
|
136
136
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
137
137
|
static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) {
|
138
|
-
auto input_data = input.
|
138
|
+
auto input_data = input.GetData();
|
139
139
|
auto input_length = input.GetSize();
|
140
140
|
return ASCIICaseConvert<IS_UPPER>(result, input_data, input_length);
|
141
141
|
}
|
@@ -66,7 +66,7 @@ static void ConcatFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
66
66
|
}
|
67
67
|
// append the constant vector to each of the strings
|
68
68
|
auto input_data = ConstantVector::GetData<string_t>(input);
|
69
|
-
auto input_ptr = input_data->
|
69
|
+
auto input_ptr = input_data->GetData();
|
70
70
|
auto input_len = input_data->GetSize();
|
71
71
|
for (idx_t i = 0; i < args.size(); i++) {
|
72
72
|
memcpy(result_data[i].GetDataWriteable() + result_lengths[i], input_ptr, input_len);
|
@@ -83,7 +83,7 @@ static void ConcatFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
83
83
|
if (!idata.validity.RowIsValid(idx)) {
|
84
84
|
continue;
|
85
85
|
}
|
86
|
-
auto input_ptr = input_data[idx].
|
86
|
+
auto input_ptr = input_data[idx].GetData();
|
87
87
|
auto input_len = input_data[idx].GetSize();
|
88
88
|
memcpy(result_data[i].GetDataWriteable() + result_lengths[i], input_ptr, input_len);
|
89
89
|
result_lengths[i] += input_len;
|
@@ -98,8 +98,8 @@ static void ConcatFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
98
98
|
static void ConcatOperator(DataChunk &args, ExpressionState &state, Vector &result) {
|
99
99
|
BinaryExecutor::Execute<string_t, string_t, string_t>(
|
100
100
|
args.data[0], args.data[1], result, args.size(), [&](string_t a, string_t b) {
|
101
|
-
auto a_data = a.
|
102
|
-
auto b_data = b.
|
101
|
+
auto a_data = a.GetData();
|
102
|
+
auto b_data = b.GetData();
|
103
103
|
auto a_length = a.GetSize();
|
104
104
|
auto b_length = b.GetSize();
|
105
105
|
|
@@ -167,11 +167,11 @@ static void TemplatedConcatWS(DataChunk &args, string_t *sep_data, const Selecti
|
|
167
167
|
}
|
168
168
|
if (has_results[ridx]) {
|
169
169
|
auto sep_size = sep_data[sep_idx].GetSize();
|
170
|
-
auto sep_ptr = sep_data[sep_idx].
|
170
|
+
auto sep_ptr = sep_data[sep_idx].GetData();
|
171
171
|
memcpy(result_data[ridx].GetDataWriteable() + result_lengths[ridx], sep_ptr, sep_size);
|
172
172
|
result_lengths[ridx] += sep_size;
|
173
173
|
}
|
174
|
-
auto input_ptr = input_data[idx].
|
174
|
+
auto input_ptr = input_data[idx].GetData();
|
175
175
|
auto input_len = input_data[idx].GetSize();
|
176
176
|
memcpy(result_data[ridx].GetDataWriteable() + result_lengths[ridx], input_ptr, input_len);
|
177
177
|
result_lengths[ridx] += input_len;
|
@@ -133,9 +133,9 @@ idx_t ContainsFun::Find(const unsigned char *haystack, idx_t haystack_size, cons
|
|
133
133
|
}
|
134
134
|
|
135
135
|
idx_t ContainsFun::Find(const string_t &haystack_s, const string_t &needle_s) {
|
136
|
-
auto haystack = (const unsigned char *)haystack_s.
|
136
|
+
auto haystack = (const unsigned char *)haystack_s.GetData();
|
137
137
|
auto haystack_size = haystack_s.GetSize();
|
138
|
-
auto needle = (const unsigned char *)needle_s.
|
138
|
+
auto needle = (const unsigned char *)needle_s.GetData();
|
139
139
|
auto needle_size = needle_s.GetSize();
|
140
140
|
if (needle_size == 0) {
|
141
141
|
// empty needle: always true
|
@@ -25,8 +25,8 @@ static idx_t DamerauLevenshteinDistance(const string_t &source, const string_t &
|
|
25
25
|
return source_len * COST_DELETION;
|
26
26
|
}
|
27
27
|
|
28
|
-
const auto source_str = source.
|
29
|
-
const auto target_str = target.
|
28
|
+
const auto source_str = source.GetData();
|
29
|
+
const auto target_str = target.GetData();
|
30
30
|
|
31
31
|
// larger than the largest possible value:
|
32
32
|
const auto inf = source_len * COST_DELETION + target_len * COST_INSERTION + 1;
|
@@ -63,7 +63,7 @@ static void WriteHugeIntBinBytes(hugeint_t x, char *&output, idx_t buffer_size)
|
|
63
63
|
struct HexStrOperator {
|
64
64
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
65
65
|
static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) {
|
66
|
-
auto data = input.
|
66
|
+
auto data = input.GetData();
|
67
67
|
auto size = input.GetSize();
|
68
68
|
|
69
69
|
// Allocate empty space
|
@@ -150,7 +150,7 @@ static void ToHexFunction(DataChunk &args, ExpressionState &state, Vector &resul
|
|
150
150
|
struct BinaryStrOperator {
|
151
151
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
152
152
|
static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) {
|
153
|
-
auto data = input.
|
153
|
+
auto data = input.GetData();
|
154
154
|
auto size = input.GetSize();
|
155
155
|
|
156
156
|
// Allocate empty space
|
@@ -228,7 +228,7 @@ struct BinaryHugeIntOperator {
|
|
228
228
|
struct FromHexOperator {
|
229
229
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
230
230
|
static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) {
|
231
|
-
auto data = input.
|
231
|
+
auto data = input.GetData();
|
232
232
|
auto size = input.GetSize();
|
233
233
|
|
234
234
|
if (size > NumericLimits<uint32_t>::Maximum()) {
|
@@ -265,7 +265,7 @@ struct FromHexOperator {
|
|
265
265
|
struct FromBinaryOperator {
|
266
266
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
267
267
|
static RESULT_TYPE Operation(INPUT_TYPE input, Vector &result) {
|
268
|
-
auto data = input.
|
268
|
+
auto data = input.GetData();
|
269
269
|
auto size = input.GetSize();
|
270
270
|
|
271
271
|
if (size > NumericLimits<uint32_t>::Maximum()) {
|
@@ -16,7 +16,7 @@ struct InstrOperator {
|
|
16
16
|
auto location = ContainsFun::Find(haystack, needle);
|
17
17
|
if (location != DConstants::INVALID_INDEX) {
|
18
18
|
auto len = (utf8proc_ssize_t)location;
|
19
|
-
auto str = reinterpret_cast<const utf8proc_uint8_t *>(haystack.
|
19
|
+
auto str = reinterpret_cast<const utf8proc_uint8_t *>(haystack.GetData());
|
20
20
|
D_ASSERT(len <= (utf8proc_ssize_t)haystack.GetSize());
|
21
21
|
for (++string_position; len > 0; ++string_position) {
|
22
22
|
utf8proc_int32_t codepoint;
|
@@ -9,7 +9,7 @@ namespace duckdb {
|
|
9
9
|
static inline map<char, idx_t> GetSet(const string_t &str) {
|
10
10
|
auto map_of_chars = map<char, idx_t> {};
|
11
11
|
idx_t str_len = str.GetSize();
|
12
|
-
auto s = str.
|
12
|
+
auto s = str.GetData();
|
13
13
|
|
14
14
|
for (idx_t pos = 0; pos < str_len; pos++) {
|
15
15
|
map_of_chars.insert(std::make_pair(s[pos], 1));
|
@@ -5,14 +5,14 @@
|
|
5
5
|
namespace duckdb {
|
6
6
|
|
7
7
|
static inline double JaroScalarFunction(const string_t &s1, const string_t &s2) {
|
8
|
-
auto s1_begin = s1.
|
9
|
-
auto s2_begin = s2.
|
8
|
+
auto s1_begin = s1.GetData();
|
9
|
+
auto s2_begin = s2.GetData();
|
10
10
|
return duckdb_jaro_winkler::jaro_similarity(s1_begin, s1_begin + s1.GetSize(), s2_begin, s2_begin + s2.GetSize());
|
11
11
|
}
|
12
12
|
|
13
13
|
static inline double JaroWinklerScalarFunction(const string_t &s1, const string_t &s2) {
|
14
|
-
auto s1_begin = s1.
|
15
|
-
auto s2_begin = s2.
|
14
|
+
auto s1_begin = s1.GetData();
|
15
|
+
auto s2_begin = s2.GetData();
|
16
16
|
return duckdb_jaro_winkler::jaro_winkler_similarity(s1_begin, s1_begin + s1.GetSize(), s2_begin,
|
17
17
|
s2_begin + s2.GetSize());
|
18
18
|
}
|
@@ -29,7 +29,7 @@ static void CachedFunction(Vector &constant, Vector &other, Vector &result, idx_
|
|
29
29
|
auto str_val = StringValue::Get(val);
|
30
30
|
auto cached = CACHED_SIMILARITY(str_val);
|
31
31
|
UnaryExecutor::Execute<string_t, double>(other, result, count, [&](const string_t &other_str) {
|
32
|
-
auto other_str_begin = other_str.
|
32
|
+
auto other_str_begin = other_str.GetData();
|
33
33
|
return cached.similarity(other_str_begin, other_str_begin + other_str.GetSize());
|
34
34
|
});
|
35
35
|
}
|
@@ -141,7 +141,7 @@ void LengthFun::RegisterFunction(BuiltinFunctions &set) {
|
|
141
141
|
struct UnicodeOperator {
|
142
142
|
template <class TA, class TR>
|
143
143
|
static inline TR Operation(const TA &input) {
|
144
|
-
auto str = reinterpret_cast<const utf8proc_uint8_t *>(input.
|
144
|
+
auto str = reinterpret_cast<const utf8proc_uint8_t *>(input.GetData());
|
145
145
|
auto len = input.GetSize();
|
146
146
|
utf8proc_int32_t codepoint;
|
147
147
|
(void)utf8proc_iterate(str, len, &codepoint);
|
@@ -23,8 +23,8 @@ static idx_t LevenshteinDistance(const string_t &txt, const string_t &tgt) {
|
|
23
23
|
return txt_len;
|
24
24
|
}
|
25
25
|
|
26
|
-
auto txt_str = txt.
|
27
|
-
auto tgt_str = tgt.
|
26
|
+
auto txt_str = txt.GetData();
|
27
|
+
auto tgt_str = tgt.GetData();
|
28
28
|
|
29
29
|
// Create two working vectors
|
30
30
|
vector<idx_t> distances0(tgt_len + 1, 0);
|