duckdb 0.7.2-dev3515.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/configure.py +2 -0
- 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 +167 -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/catalog/catalog_entry/macro_catalog_entry.cpp +42 -0
- package/src/duckdb/src/catalog/catalog_search_path.cpp +5 -0
- package/src/duckdb/src/catalog/catalog_set.cpp +1 -1
- package/src/duckdb/src/common/constants.cpp +1 -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/common/types/vector.cpp +3 -3
- package/src/duckdb/src/common/types/vector_buffer.cpp +11 -3
- package/src/duckdb/src/common/types/vector_cache.cpp +5 -5
- 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/execution/operator/schema/physical_create_type.cpp +2 -2
- package/src/duckdb/src/function/macro_function.cpp +43 -0
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +5 -3
- package/src/duckdb/src/function/scalar/strftime_format.cpp +1 -0
- package/src/duckdb/src/function/scalar_macro_function.cpp +10 -0
- package/src/duckdb/src/function/table/copy_csv.cpp +68 -18
- package/src/duckdb/src/function/table/read_csv.cpp +30 -3
- package/src/duckdb/src/function/table/version/pragma_version.cpp +8 -2
- package/src/duckdb/src/function/table_macro_function.cpp +10 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/column_dependency_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +3 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +0 -6
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +0 -6
- 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/constants.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/exception.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/field_writer.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/vector_buffer.hpp +12 -2
- 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 +9 -5
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +10 -14
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +7 -1
- package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +3 -4
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +7 -2
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +5 -0
- 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/parsed_data/attach_info.hpp +4 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +8 -12
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +6 -20
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +6 -18
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +4 -8
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +4 -38
- package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +5 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -10
- 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/parser/parsed_data/attach_info.cpp +42 -0
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +0 -7
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +19 -8
- package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +46 -0
- package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +56 -0
- package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +47 -0
- package/src/duckdb/src/parser/parsed_data/detach_info.cpp +34 -0
- package/src/duckdb/src/parser/parsed_data/drop_info.cpp +46 -0
- package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +24 -0
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +37 -0
- package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +27 -9
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +9 -4
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +2 -1
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +1 -0
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +1 -1
- package/src/duckdb/src/planner/logical_operator.cpp +1 -2
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +16 -25
- package/src/duckdb/src/planner/operator/logical_insert.cpp +30 -0
- package/src/duckdb/src/planner/operator/logical_simple.cpp +33 -5
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +6 -16
- package/src/duckdb/src/planner/planner.cpp +4 -13
- package/src/duckdb/src/storage/checkpoint_manager.cpp +12 -6
- package/src/duckdb/src/storage/single_file_block_manager.cpp +0 -4
- package/src/duckdb/src/storage/storage_info.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +5735 -5773
- package/src/duckdb/ub_src_catalog_catalog_entry.cpp +1 -1
- package/src/duckdb/ub_src_parser_parsed_data.cpp +16 -0
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +0 -104
@@ -494,9 +494,9 @@ static void CreateValues(const StructNames &names, yyjson_mut_doc *doc, yyjson_m
|
|
494
494
|
|
495
495
|
static void ObjectFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
496
496
|
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
497
|
-
const auto &info =
|
497
|
+
const auto &info = func_expr.bind_info->Cast<JSONCreateFunctionData>();
|
498
498
|
auto &lstate = JSONFunctionLocalState::ResetAndGet(state);
|
499
|
-
auto alc = lstate.json_allocator.
|
499
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
500
500
|
|
501
501
|
// Initialize values
|
502
502
|
const idx_t count = args.size();
|
@@ -526,9 +526,9 @@ static void ObjectFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
526
526
|
|
527
527
|
static void ArrayFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
528
528
|
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
529
|
-
const auto &info =
|
529
|
+
const auto &info = func_expr.bind_info->Cast<JSONCreateFunctionData>();
|
530
530
|
auto &lstate = JSONFunctionLocalState::ResetAndGet(state);
|
531
|
-
auto alc = lstate.json_allocator.
|
531
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
532
532
|
|
533
533
|
// Initialize arrays
|
534
534
|
const idx_t count = args.size();
|
@@ -585,9 +585,9 @@ static void ToJSONFunctionInternal(const StructNames &names, Vector &input, cons
|
|
585
585
|
|
586
586
|
static void ToJSONFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
587
587
|
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
588
|
-
const auto &info =
|
588
|
+
const auto &info = func_expr.bind_info->Cast<JSONCreateFunctionData>();
|
589
589
|
auto &lstate = JSONFunctionLocalState::ResetAndGet(state);
|
590
|
-
auto alc = lstate.json_allocator.
|
590
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
591
591
|
|
592
592
|
ToJSONFunctionInternal(info.const_struct_names, args.data[0], args.size(), result, alc);
|
593
593
|
}
|
@@ -649,7 +649,7 @@ public:
|
|
649
649
|
static bool AnyToJSONCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
650
650
|
auto &lstate = parameters.local_state->Cast<JSONFunctionLocalState>();
|
651
651
|
lstate.json_allocator.Reset();
|
652
|
-
auto alc = lstate.json_allocator.
|
652
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
653
653
|
const auto &names = parameters.cast_data->Cast<NestedToJSONCastData>().const_struct_names;
|
654
654
|
|
655
655
|
ToJSONFunctionInternal(names, source, count, result, alc);
|
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
namespace duckdb {
|
5
5
|
|
6
|
-
static
|
7
|
-
|
6
|
+
static unique_ptr<FunctionData> JSONMergePatchBind(ClientContext &context, ScalarFunction &bound_function,
|
7
|
+
vector<unique_ptr<Expression>> &arguments) {
|
8
8
|
if (arguments.size() < 2) {
|
9
9
|
throw InvalidInputException("json_merge_patch requires at least two parameters");
|
10
10
|
}
|
@@ -53,9 +53,9 @@ static inline void ReadObjects(yyjson_mut_doc *doc, Vector &input, yyjson_mut_va
|
|
53
53
|
//! Follows MySQL behaviour
|
54
54
|
static void MergePatchFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
55
55
|
auto &lstate = JSONFunctionLocalState::ResetAndGet(state);
|
56
|
-
auto alc = lstate.json_allocator.
|
56
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
57
57
|
|
58
|
-
auto doc = JSONCommon::CreateDocument(lstate.json_allocator.
|
58
|
+
auto doc = JSONCommon::CreateDocument(lstate.json_allocator.GetYYAlc());
|
59
59
|
const auto count = args.size();
|
60
60
|
|
61
61
|
// Read the first json arg
|
@@ -76,7 +76,7 @@ static unique_ptr<FunctionData> JsonSerializeBind(ClientContext &context, Scalar
|
|
76
76
|
|
77
77
|
static void JsonSerializeFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
78
78
|
auto &local_state = JSONFunctionLocalState::ResetAndGet(state);
|
79
|
-
auto alc = local_state.json_allocator.
|
79
|
+
auto alc = local_state.json_allocator.GetYYAlc();
|
80
80
|
auto &inputs = args.data[0];
|
81
81
|
|
82
82
|
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
@@ -193,7 +193,7 @@ static unique_ptr<SelectStatement> DeserializeSelectStatement(string_t input, yy
|
|
193
193
|
static void JsonDeserializeFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
194
194
|
|
195
195
|
auto &local_state = JSONFunctionLocalState::ResetAndGet(state);
|
196
|
-
auto alc = local_state.json_allocator.
|
196
|
+
auto alc = local_state.json_allocator.GetYYAlc();
|
197
197
|
auto &inputs = args.data[0];
|
198
198
|
|
199
199
|
UnaryExecutor::Execute<string_t, string_t>(inputs, result, args.size(), [&](string_t input) {
|
@@ -214,7 +214,7 @@ ScalarFunctionSet JSONFunctions::GetDeserializeSqlFunction() {
|
|
214
214
|
//----------------------------------------------------------------------
|
215
215
|
static string ExecuteJsonSerializedSqlPragmaFunction(ClientContext &context, const FunctionParameters ¶meters) {
|
216
216
|
JSONFunctionLocalState local_state(context);
|
217
|
-
auto alc = local_state.json_allocator.
|
217
|
+
auto alc = local_state.json_allocator.GetYYAlc();
|
218
218
|
|
219
219
|
auto input = parameters.values[0].GetValueUnsafe<string_t>();
|
220
220
|
auto stmt = DeserializeSelectStatement(input, alc);
|
@@ -239,7 +239,7 @@ struct ExecuteSqlTableFunction {
|
|
239
239
|
static unique_ptr<FunctionData> Bind(ClientContext &context, TableFunctionBindInput &input,
|
240
240
|
vector<LogicalType> &return_types, vector<string> &names) {
|
241
241
|
JSONFunctionLocalState local_state(context);
|
242
|
-
auto alc = local_state.json_allocator.
|
242
|
+
auto alc = local_state.json_allocator.GetYYAlc();
|
243
243
|
|
244
244
|
auto result = make_uniq<BindData>();
|
245
245
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
#include "json_structure.hpp"
|
2
2
|
|
3
|
+
#include "duckdb/common/enum_util.hpp"
|
3
4
|
#include "json_executors.hpp"
|
4
5
|
#include "json_scan.hpp"
|
5
6
|
#include "json_transform.hpp"
|
6
|
-
#include "duckdb/common/enum_util.hpp"
|
7
7
|
|
8
8
|
namespace duckdb {
|
9
9
|
|
@@ -93,7 +93,7 @@ bool JSONStructureNode::ContainsVarchar() const {
|
|
93
93
|
}
|
94
94
|
|
95
95
|
void JSONStructureNode::InitializeCandidateTypes(const idx_t max_depth, idx_t depth) {
|
96
|
-
if (depth
|
96
|
+
if (depth >= max_depth) {
|
97
97
|
return;
|
98
98
|
}
|
99
99
|
if (descriptions.size() != 1) {
|
@@ -521,11 +521,11 @@ static LogicalType StructureToTypeString(const JSONStructureNode &node) {
|
|
521
521
|
|
522
522
|
LogicalType JSONStructure::StructureToType(ClientContext &context, const JSONStructureNode &node, const idx_t max_depth,
|
523
523
|
idx_t depth) {
|
524
|
-
if (depth
|
524
|
+
if (depth >= max_depth) {
|
525
525
|
return JSONCommon::JSONType();
|
526
526
|
}
|
527
527
|
if (node.descriptions.empty()) {
|
528
|
-
return
|
528
|
+
return JSONCommon::JSONType();
|
529
529
|
}
|
530
530
|
if (node.descriptions.size() != 1) { // Inconsistent types, so we resort to JSON
|
531
531
|
return JSONCommon::JSONType();
|
@@ -540,7 +540,9 @@ LogicalType JSONStructure::StructureToType(ClientContext &context, const JSONStr
|
|
540
540
|
case LogicalTypeId::VARCHAR:
|
541
541
|
return StructureToTypeString(node);
|
542
542
|
case LogicalTypeId::SQLNULL:
|
543
|
-
return
|
543
|
+
return JSONCommon::JSONType();
|
544
|
+
case LogicalTypeId::UBIGINT:
|
545
|
+
return LogicalTypeId::BIGINT; // We prefer not to return UBIGINT in our type auto-detection
|
544
546
|
default:
|
545
547
|
return desc.type;
|
546
548
|
}
|
@@ -20,7 +20,7 @@ JSONTransformOptions::JSONTransformOptions(bool strict_cast_p, bool error_duplic
|
|
20
20
|
error_unknown_key(error_unkown_key_p) {
|
21
21
|
}
|
22
22
|
|
23
|
-
void JSONTransformOptions::Serialize(FieldWriter &writer) {
|
23
|
+
void JSONTransformOptions::Serialize(FieldWriter &writer) const {
|
24
24
|
writer.WriteField(strict_cast);
|
25
25
|
writer.WriteField(error_duplicate_key);
|
26
26
|
writer.WriteField(error_missing_key);
|
@@ -98,8 +98,8 @@ static unique_ptr<FunctionData> JSONTransformBind(ClientContext &context, Scalar
|
|
98
98
|
auto structure_string = structure_val.GetValueUnsafe<string_t>();
|
99
99
|
JSONAllocator json_allocator(Allocator::DefaultAllocator());
|
100
100
|
yyjson_read_err err;
|
101
|
-
auto doc =
|
102
|
-
|
101
|
+
auto doc =
|
102
|
+
JSONCommon::ReadDocumentUnsafe(structure_string, JSONCommon::READ_FLAG, json_allocator.GetYYAlc(), &err);
|
103
103
|
if (err.code != YYJSON_READ_SUCCESS) {
|
104
104
|
JSONCommon::ThrowParseError(structure_string.GetData(), structure_string.GetSize(), err);
|
105
105
|
}
|
@@ -615,7 +615,7 @@ static bool TransformObjectToMap(yyjson_val *objects[], yyjson_alc *alc, Vector
|
|
615
615
|
ListVector::SetListSize(result, list_size);
|
616
616
|
|
617
617
|
auto list_entries = FlatVector::GetData<list_entry_t>(result);
|
618
|
-
auto list_validity = FlatVector::Validity(result);
|
618
|
+
auto &list_validity = FlatVector::Validity(result);
|
619
619
|
|
620
620
|
auto keys = (yyjson_val **)alc->malloc(alc->ctx, sizeof(yyjson_val *) * list_size);
|
621
621
|
auto vals = (yyjson_val **)alc->malloc(alc->ctx, sizeof(yyjson_val *) * list_size);
|
@@ -654,6 +654,7 @@ static bool TransformObjectToMap(yyjson_val *objects[], yyjson_alc *alc, Vector
|
|
654
654
|
list_offset++;
|
655
655
|
}
|
656
656
|
}
|
657
|
+
D_ASSERT(list_offset == list_size);
|
657
658
|
|
658
659
|
// Transform keys
|
659
660
|
if (!JSONTransform::Transform(keys, alc, MapVector::GetKeys(result), list_size, options)) {
|
@@ -678,7 +679,7 @@ bool TransformToJSON(yyjson_val *vals[], yyjson_alc *alc, Vector &result, const
|
|
678
679
|
auto &validity = FlatVector::Validity(result);
|
679
680
|
for (idx_t i = 0; i < count; i++) {
|
680
681
|
const auto &val = vals[i];
|
681
|
-
if (!val) {
|
682
|
+
if (!val || unsafe_yyjson_is_null(val)) {
|
682
683
|
validity.SetInvalid(i);
|
683
684
|
} else {
|
684
685
|
data[i] = JSONCommon::WriteVal(val, alc);
|
@@ -691,7 +692,8 @@ bool TransformToJSON(yyjson_val *vals[], yyjson_alc *alc, Vector &result, const
|
|
691
692
|
bool JSONTransform::Transform(yyjson_val *vals[], yyjson_alc *alc, Vector &result, const idx_t count,
|
692
693
|
JSONTransformOptions &options) {
|
693
694
|
auto result_type = result.GetType();
|
694
|
-
if ((result_type == LogicalTypeId::TIMESTAMP || result_type == LogicalTypeId::DATE) && options.date_format_map
|
695
|
+
if ((result_type == LogicalTypeId::TIMESTAMP || result_type == LogicalTypeId::DATE) && options.date_format_map &&
|
696
|
+
options.date_format_map->HasFormats(result_type.id())) {
|
695
697
|
// Auto-detected date/timestamp format during sampling
|
696
698
|
return TransformFromStringWithFormat(vals, result, count, options);
|
697
699
|
}
|
@@ -803,7 +805,7 @@ static bool TransformFunctionInternal(Vector &input, const idx_t count, Vector &
|
|
803
805
|
template <bool strict>
|
804
806
|
static void TransformFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
805
807
|
auto &lstate = JSONFunctionLocalState::ResetAndGet(state);
|
806
|
-
auto alc = lstate.json_allocator.
|
808
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
807
809
|
|
808
810
|
JSONTransformOptions options(strict, strict, strict, false);
|
809
811
|
if (!TransformFunctionInternal(args.data[0], args.size(), result, alc, options)) {
|
@@ -838,7 +840,7 @@ ScalarFunctionSet JSONFunctions::GetTransformStrictFunction() {
|
|
838
840
|
static bool JSONToAnyCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
839
841
|
auto &lstate = parameters.local_state->Cast<JSONFunctionLocalState>();
|
840
842
|
lstate.json_allocator.Reset();
|
841
|
-
auto alc = lstate.json_allocator.
|
843
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
842
844
|
|
843
845
|
JSONTransformOptions options(true, true, true, true);
|
844
846
|
options.delay_error = true;
|
@@ -4,7 +4,7 @@ namespace duckdb {
|
|
4
4
|
|
5
5
|
static void ValidFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
6
6
|
auto &lstate = JSONFunctionLocalState::ResetAndGet(state);
|
7
|
-
auto alc = lstate.json_allocator.
|
7
|
+
auto alc = lstate.json_allocator.GetYYAlc();
|
8
8
|
auto &inputs = args.data[0];
|
9
9
|
UnaryExecutor::Execute<string_t, bool>(inputs, result, args.size(), [&](string_t input) {
|
10
10
|
return JSONCommon::ReadDocumentUnsafe(input, JSONCommon::READ_FLAG, alc);
|