forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature' into left_projection_map
- Loading branch information
Showing
277 changed files
with
18,739 additions
and
15,187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/iceberg_functions/iceberg_scan.cpp b/src/iceberg_functions/iceberg_scan.cpp | ||
index 4e0b5cc..b6aa8dd 100644 | ||
--- a/src/iceberg_functions/iceberg_scan.cpp | ||
+++ b/src/iceberg_functions/iceberg_scan.cpp | ||
@@ -194,7 +194,7 @@ static unique_ptr<TableRef> MakeScanExpression(vector<Value> &data_file_values, | ||
auto select_node = make_uniq<SelectNode>(); | ||
select_node->from_table = std::move(join_node); | ||
auto select_expr = make_uniq<StarExpression>(); | ||
- select_expr->exclude_list = {"filename", "file_row_number"}; | ||
+ select_expr->exclude_list = {QualifiedColumnName("filename"), QualifiedColumnName("file_row_number")}; | ||
vector<unique_ptr<ParsedExpression>> select_exprs; | ||
select_exprs.push_back(std::move(select_expr)); | ||
select_node->select_list = std::move(select_exprs); |
158 changes: 158 additions & 0 deletions
158
.github/patches/extensions/spatial/random_test_fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
diff --git a/test/sql/index/rtree_basic_points.test b/test/sql/index/rtree_basic_points.test | ||
index c4de65b..047ad35 100644 | ||
--- a/test/sql/index/rtree_basic_points.test | ||
+++ b/test/sql/index/rtree_basic_points.test | ||
@@ -7,7 +7,7 @@ FROM st_generatepoints({min_x: 0, min_y: 0, max_x: 10000, max_y: 10000}::BOX_2D, | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-352 | ||
+390 | ||
|
||
statement ok | ||
CREATE INDEX my_idx ON t1 USING RTREE (geom); | ||
@@ -20,4 +20,4 @@ physical_plan <REGEX>:.*RTREE_INDEX_SCAN.* | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-352 | ||
\ No newline at end of file | ||
+390 | ||
diff --git a/test/sql/index/rtree_block_reclaim.test_slow b/test/sql/index/rtree_block_reclaim.test_slow | ||
index f474266..903f634 100644 | ||
--- a/test/sql/index/rtree_block_reclaim.test_slow | ||
+++ b/test/sql/index/rtree_block_reclaim.test_slow | ||
@@ -21,7 +21,7 @@ CREATE INDEX idx ON tbl USING RTREE (geom); | ||
query II | ||
SELECT i, geom FROM tbl WHERE i = 50000;; | ||
---- | ||
-50000 POINT (4732.4060765095055 128.3674407750368) | ||
+50000 POINT (1345.636742415942 425.3127709233669) | ||
|
||
statement ok | ||
CHECKPOINT; | ||
@@ -51,7 +51,7 @@ CHECKPOINT; | ||
query II | ||
SELECT i, geom FROM tbl WHERE i = 50000; | ||
---- | ||
-50000 POINT (4732.4060765095055 128.3674407750368) | ||
+50000 POINT (1345.636742415942 425.3127709233669) | ||
|
||
# now loop and always DROP INDEX, then recreate (reusing the same blocks) | ||
|
||
@@ -87,6 +87,6 @@ FROM pragma_database_size() current, blocks_idx; | ||
query II | ||
SELECT i, geom FROM tbl WHERE i = 50000; | ||
---- | ||
-50000 POINT (4732.4060765095055 128.3674407750368) | ||
+50000 POINT (1345.636742415942 425.3127709233669) | ||
|
||
endloop | ||
\ No newline at end of file | ||
diff --git a/test/sql/index/rtree_persistence.test b/test/sql/index/rtree_persistence.test | ||
index a971dd5..926ab36 100644 | ||
--- a/test/sql/index/rtree_persistence.test | ||
+++ b/test/sql/index/rtree_persistence.test | ||
@@ -10,7 +10,7 @@ FROM st_generatepoints({min_x: 0, min_y: 0, max_x: 10000, max_y: 10000}::BOX_2D, | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-352 | ||
+390 | ||
|
||
statement ok | ||
CREATE INDEX my_idx ON t1 USING RTREE (geom); | ||
@@ -31,4 +31,4 @@ physical_plan <REGEX>:.*RTREE_INDEX_SCAN.* | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-352 | ||
\ No newline at end of file | ||
+390 | ||
diff --git a/test/sql/index/rtree_persistence_load.test b/test/sql/index/rtree_persistence_load.test | ||
index 15ca910..056d8ce 100644 | ||
--- a/test/sql/index/rtree_persistence_load.test | ||
+++ b/test/sql/index/rtree_persistence_load.test | ||
@@ -10,7 +10,7 @@ FROM st_generatepoints({min_x: 0, min_y: 0, max_x: 10000, max_y: 10000}::BOX_2D, | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-43 | ||
+36 | ||
|
||
statement ok | ||
CREATE INDEX my_idx ON t1 USING RTREE (geom); | ||
@@ -39,4 +39,4 @@ physical_plan <REGEX>:.*RTREE_INDEX_SCAN.* | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-43 | ||
\ No newline at end of file | ||
+36 | ||
diff --git a/test/sql/index/rtree_persistence_wal.test b/test/sql/index/rtree_persistence_wal.test | ||
index 14b3c53..6d310ed 100644 | ||
--- a/test/sql/index/rtree_persistence_wal.test | ||
+++ b/test/sql/index/rtree_persistence_wal.test | ||
@@ -13,7 +13,7 @@ FROM st_generatepoints({min_x: 0, min_y: 0, max_x: 10000, max_y: 10000}::BOX_2D, | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-43 | ||
+36 | ||
|
||
statement ok | ||
CREATE INDEX my_idx ON t1 USING RTREE (geom); | ||
@@ -34,4 +34,4 @@ physical_plan <REGEX>:.*RTREE_INDEX_SCAN.* | ||
query I | ||
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650)); | ||
---- | ||
-43 | ||
\ No newline at end of file | ||
+36 | ||
diff --git a/test/sql/index/rtree_projection.test b/test/sql/index/rtree_projection.test | ||
index b60c922..23488e4 100644 | ||
--- a/test/sql/index/rtree_projection.test | ||
+++ b/test/sql/index/rtree_projection.test | ||
@@ -15,30 +15,30 @@ CREATE INDEX my_idx ON points USING RTREE(geom); | ||
query II rowsort | ||
SELECT * FROM points WHERE ST_Intersects(geom, ST_MakeEnvelope(0, 0, 500, 500)); | ||
---- | ||
-351 POINT (359.812940005213 406.6655575297773) | ||
-472 POINT (169.11179292947054 129.24372218549252) | ||
-775 POINT (173.61568519845605 455.52933821454644) | ||
+249 POINT (42.208750495658 488.510431689545) | ||
+760 POINT (16.631746553017916 252.64710064171524) | ||
+907 POINT (88.77047830284079 251.89159351805182) | ||
|
||
query II rowsort | ||
SELECT geom, id FROM points WHERE ST_Intersects(geom, ST_MakeEnvelope(0, 0, 500, 500)); | ||
---- | ||
-POINT (169.11179292947054 129.24372218549252) 472 | ||
-POINT (173.61568519845605 455.52933821454644) 775 | ||
-POINT (359.812940005213 406.6655575297773) 351 | ||
+POINT (16.631746553017916 252.64710064171524) 760 | ||
+POINT (42.208750495658 488.510431689545) 249 | ||
+POINT (88.77047830284079 251.89159351805182) 907 | ||
|
||
query I rowsort | ||
SELECT id FROM points WHERE ST_Intersects(geom, ST_MakeEnvelope(0, 0, 500, 500)); | ||
---- | ||
-351 | ||
-472 | ||
-775 | ||
+249 | ||
+760 | ||
+907 | ||
|
||
query III rowsort | ||
SELECT id, geom, ST_Intersects(geom, ST_MakeEnvelope(0, 0, 500, 500)) as contained FROM points WHERE ST_Intersects(geom, ST_MakeEnvelope(0, 0, 500, 500)); | ||
---- | ||
-351 POINT (359.812940005213 406.6655575297773) true | ||
-472 POINT (169.11179292947054 129.24372218549252) true | ||
-775 POINT (173.61568519845605 455.52933821454644) true | ||
+249 POINT (42.208750495658 488.510431689545) 1 | ||
+760 POINT (16.631746553017916 252.64710064171524) 1 | ||
+907 POINT (88.77047830284079 251.89159351805182) 1 | ||
|
||
query I rowsort | ||
SELECT ST_Intersects(geom, ST_MakeEnvelope(0, 0, 500, 500)) as contained FROM points WHERE ST_Intersects(geom, ST_MakeEnvelope(0, 0, 500, 500)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
diff --git a/src/include/sqlite_scanner.hpp b/src/include/sqlite_scanner.hpp | ||
index c6230a5..f79006e 100644 | ||
--- a/src/include/sqlite_scanner.hpp | ||
+++ b/src/include/sqlite_scanner.hpp | ||
@@ -13,6 +13,7 @@ | ||
|
||
namespace duckdb { | ||
class SQLiteDB; | ||
+class TableCatalogEntry; | ||
|
||
struct SqliteBindData : public TableFunctionData { | ||
string file_name; | ||
@@ -26,6 +27,8 @@ struct SqliteBindData : public TableFunctionData { | ||
|
||
optional_idx rows_per_group = 122880; | ||
SQLiteDB *global_db; | ||
+ | ||
+ optional_ptr<TableCatalogEntry> table; | ||
}; | ||
|
||
class SqliteScanFunction : public TableFunction { | ||
diff --git a/src/sqlite_scanner.cpp b/src/sqlite_scanner.cpp | ||
index 391d821..b4ac571 100644 | ||
--- a/src/sqlite_scanner.cpp | ||
+++ b/src/sqlite_scanner.cpp | ||
@@ -283,6 +283,13 @@ static string SqliteToString(const FunctionData *bind_data_p) { | ||
return StringUtil::Format("%s:%s", bind_data.file_name, bind_data.table_name); | ||
} | ||
|
||
+BindInfo SqliteBindInfo(const optional_ptr<FunctionData> bind_data_p) { | ||
+ BindInfo info(ScanType::EXTERNAL); | ||
+ auto &bind_data = bind_data_p->Cast<SqliteBindData>(); | ||
+ info.table = bind_data.table; | ||
+ return info; | ||
+} | ||
+ | ||
/* | ||
static unique_ptr<BaseStatistics> | ||
SqliteStatistics(ClientContext &context, const FunctionData *bind_data_p, | ||
@@ -300,6 +307,7 @@ SqliteScanFunction::SqliteScanFunction() | ||
SqliteInitGlobalState, SqliteInitLocalState) { | ||
cardinality = SqliteCardinality; | ||
to_string = SqliteToString; | ||
+ get_bind_info = SqliteBindInfo; | ||
projection_pushdown = true; | ||
} | ||
|
||
diff --git a/src/storage/sqlite_table_entry.cpp b/src/storage/sqlite_table_entry.cpp | ||
index 0a9f850..fd17c2d 100644 | ||
--- a/src/storage/sqlite_table_entry.cpp | ||
+++ b/src/storage/sqlite_table_entry.cpp | ||
@@ -44,6 +44,7 @@ TableFunction SQLiteTableEntry::GetScanFunction(ClientContext &context, unique_p | ||
result->global_db = &db; | ||
result->rows_per_group = optional_idx(); | ||
} | ||
+ result->table = this; | ||
|
||
bind_data = std::move(result); | ||
return static_cast<TableFunction>(SqliteScanFunction()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.