duckdb 0.6.2-dev1223.0 → 0.6.2-dev1226.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/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +2 -3
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +0 -1
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +5 -1
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +0 -3
package/package.json
CHANGED
|
@@ -9,15 +9,14 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalCopyToFile
|
|
|
9
9
|
auto &fs = FileSystem::GetFileSystem(context);
|
|
10
10
|
op.file_path = fs.ExpandPath(op.file_path, FileSystem::GetFileOpener(context));
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
if (use_tmp_file) {
|
|
12
|
+
if (op.use_tmp_file) {
|
|
14
13
|
op.file_path += ".tmp";
|
|
15
14
|
}
|
|
16
15
|
// COPY from select statement to file
|
|
17
16
|
auto copy =
|
|
18
17
|
make_unique<PhysicalCopyToFile>(op.types, op.function, std::move(op.bind_data), op.estimated_cardinality);
|
|
19
18
|
copy->file_path = op.file_path;
|
|
20
|
-
copy->use_tmp_file = use_tmp_file;
|
|
19
|
+
copy->use_tmp_file = op.use_tmp_file;
|
|
21
20
|
copy->per_thread_output = op.per_thread_output;
|
|
22
21
|
if (op.function.parallel) {
|
|
23
22
|
copy->parallel = op.function.parallel(context, *copy->bind_data);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#ifndef DUCKDB_VERSION
|
|
2
|
-
#define DUCKDB_VERSION "0.6.2-
|
|
2
|
+
#define DUCKDB_VERSION "0.6.2-dev1226"
|
|
3
3
|
#endif
|
|
4
4
|
#ifndef DUCKDB_SOURCE_ID
|
|
5
|
-
#define DUCKDB_SOURCE_ID "
|
|
5
|
+
#define DUCKDB_SOURCE_ID "5b5c625783"
|
|
6
6
|
#endif
|
|
7
7
|
#include "duckdb/function/table/system_functions.hpp"
|
|
8
8
|
#include "duckdb/main/database.hpp"
|
|
@@ -62,6 +62,11 @@ BoundStatement Binder::BindCopyTo(CopyStatement &stmt) {
|
|
|
62
62
|
if (user_set_use_tmp_file && per_thread_output) {
|
|
63
63
|
throw NotImplementedException("Can't combine USE_TMP_FILE and PER_THREAD_OUTPUT for COPY");
|
|
64
64
|
}
|
|
65
|
+
bool is_file_and_exists = config.file_system->FileExists(stmt.info->file_path);
|
|
66
|
+
bool is_stdout = stmt.info->file_path == "/dev/stdout";
|
|
67
|
+
if (!user_set_use_tmp_file) {
|
|
68
|
+
use_tmp_file = is_file_and_exists && !per_thread_output && !is_stdout;
|
|
69
|
+
}
|
|
65
70
|
|
|
66
71
|
auto function_data =
|
|
67
72
|
copy_function->function.copy_to_bind(context, *stmt.info, select_node.names, select_node.types);
|
|
@@ -70,7 +75,6 @@ BoundStatement Binder::BindCopyTo(CopyStatement &stmt) {
|
|
|
70
75
|
copy->file_path = stmt.info->file_path;
|
|
71
76
|
copy->use_tmp_file = use_tmp_file;
|
|
72
77
|
copy->per_thread_output = per_thread_output;
|
|
73
|
-
copy->is_file_and_exists = config.file_system->FileExists(copy->file_path);
|
|
74
78
|
|
|
75
79
|
copy->AddChild(std::move(select_node.plan));
|
|
76
80
|
|
|
@@ -9,7 +9,6 @@ namespace duckdb {
|
|
|
9
9
|
void LogicalCopyToFile::Serialize(FieldWriter &writer) const {
|
|
10
10
|
writer.WriteString(file_path);
|
|
11
11
|
writer.WriteField(use_tmp_file);
|
|
12
|
-
writer.WriteField(is_file_and_exists);
|
|
13
12
|
writer.WriteField(per_thread_output);
|
|
14
13
|
|
|
15
14
|
D_ASSERT(!function.name.empty());
|
|
@@ -26,7 +25,6 @@ void LogicalCopyToFile::Serialize(FieldWriter &writer) const {
|
|
|
26
25
|
unique_ptr<LogicalOperator> LogicalCopyToFile::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
|
|
27
26
|
auto file_path = reader.ReadRequired<string>();
|
|
28
27
|
auto use_tmp_file = reader.ReadRequired<bool>();
|
|
29
|
-
auto is_file_and_exists = reader.ReadRequired<bool>();
|
|
30
28
|
auto per_thread_output = reader.ReadRequired<bool>();
|
|
31
29
|
|
|
32
30
|
auto copy_func_name = reader.ReadRequired<string>();
|
|
@@ -52,7 +50,6 @@ unique_ptr<LogicalOperator> LogicalCopyToFile::Deserialize(LogicalDeserializatio
|
|
|
52
50
|
auto result = make_unique<LogicalCopyToFile>(copy_func, std::move(bind_data));
|
|
53
51
|
result->file_path = file_path;
|
|
54
52
|
result->use_tmp_file = use_tmp_file;
|
|
55
|
-
result->is_file_and_exists = is_file_and_exists;
|
|
56
53
|
result->per_thread_output = per_thread_output;
|
|
57
54
|
return std::move(result);
|
|
58
55
|
}
|