Skip to content

Commit

Permalink
Merge branch 'feature' into left_projection_map
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Sep 25, 2024
2 parents d5ed40f + 403f944 commit 862a0bb
Show file tree
Hide file tree
Showing 277 changed files with 18,739 additions and 15,187 deletions.
2 changes: 1 addition & 1 deletion .github/config/extensions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ substrait,https://github.com/duckdb/substrait,1116fb580edd3e26e675436dbdbdf4a0aa
arrow,https://github.com/duckdb/arrow,9e10240da11f61ea7fbfe3fc9988ffe672ccd40f,no-windows
aws,https://github.com/duckdb/duckdb_aws,f7b8729f1cce5ada5d4add70e1486de50763fb97,
azure,https://github.com/duckdb/duckdb_azure,09623777a366572bfb8fa53e47acdf72133a360e,
spatial,https://github.com/duckdb/duckdb_spatial,dbb9971c900c5888e3e3598af91de3b9b884aca6,
spatial,https://github.com/duckdb/duckdb_spatial,bb9c829693965f029eb5a312aefed4c538fad781,
iceberg,https://github.com/duckdb/duckdb_iceberg,d89423c2ff90a0b98a093a133c8dfe2a55b9e092,
vss,https://github.com/duckdb/duckdb_vss,9ff608f1edc6a1da2e41ee41b1ef42ba3169e71c,
15 changes: 9 additions & 6 deletions .github/config/out_of_tree_extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (NOT MINGW)
duckdb_extension_load(azure
LOAD_TESTS
GIT_URL https://github.com/duckdb/duckdb_azure
GIT_TAG eddc48422c76a2f02a57a45d31b650b2680168f5
GIT_TAG b0ffe7ada20cdbd0bee2bbe5461ecd22fb468062
)
endif()

Expand Down Expand Up @@ -74,6 +74,7 @@ if (NOT MINGW)
${LOAD_ICEBERG_TESTS}
GIT_URL https://github.com/duckdb/duckdb_iceberg
GIT_TAG 3f6d753787252e3da1d12157910b62edf729fc6e
APPLY_PATCHES
)
endif()

Expand All @@ -93,17 +94,18 @@ if (NOT MINGW)
duckdb_extension_load(postgres_scanner
DONT_LINK
GIT_URL https://github.com/duckdb/postgres_scanner
GIT_TAG 58dc3d0c7620f3978c27d4a490563fd65884d103
GIT_TAG 03eaed75f0ec5500609b7a97aa05468493b229d1
)
endif()

################# SPATIAL
duckdb_extension_load(spatial
DONT_LINK LOAD_TESTS
GIT_URL https://github.com/duckdb/duckdb_spatial.git
GIT_TAG 4107eb788f933c9e268b52f6f927a6b36b9ea440
GIT_TAG bb9c829693965f029eb5a312aefed4c538fad781
INCLUDE_DIR spatial/include
TEST_DIR test/sql
APPLY_PATCHES
)

################# SQLITE_SCANNER
Expand All @@ -118,20 +120,21 @@ duckdb_extension_load(sqlite_scanner
${STATIC_LINK_SQLITE} LOAD_TESTS
GIT_URL https://github.com/duckdb/sqlite_scanner
GIT_TAG 315861963c8106397af36cbda10faebc8dae485a
APPLY_PATCHES
)

duckdb_extension_load(sqlsmith
DONT_LINK LOAD_TESTS
GIT_URL https://github.com/duckdb/duckdb_sqlsmith
GIT_TAG 7b00307a0c00fbb85bef2010330946f11311ba4c
GIT_TAG f24be8b5b0cd0eeed7541e10cff42d7050771afc
)

################# SUBSTRAIT
if (NOT WIN32)
duckdb_extension_load(substrait
LOAD_TESTS DONT_LINK
GIT_URL https://github.com/duckdb/substrait
GIT_TAG 800be4945807b831754f6b0d1a064a3d30f9cada
GIT_TAG be71387cf0a484dc7b261a0cb21abec0d0e0ce5c
)
endif()

Expand All @@ -151,6 +154,6 @@ if (NOT MINGW)
DONT_LINK
LOAD_TESTS
GIT_URL https://github.com/duckdb/duckdb_mysql
GIT_TAG d0c56abf1169cca1c54f55448b68a85ae4279ea4
GIT_TAG f2a15013fb4559e1591e977c1c023aa0a369c6f3
)
endif()
13 changes: 13 additions & 0 deletions .github/patches/extensions/iceberg/exclude.patch
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 .github/patches/extensions/spatial/random_test_fix.patch
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));
59 changes: 59 additions & 0 deletions .github/patches/extensions/sqlite_scanner/show.patch
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());
2 changes: 1 addition & 1 deletion .github/workflows/LinuxRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
python3 scripts/amalgamation.py
zip -j duckdb_cli-linux-amd64.zip build/release/duckdb
zip -j libduckdb-linux-amd64.zip build/release/src/libduckdb*.* src/amalgamation/duckdb.hpp src/include/duckdb.h
zip -j libduckdb-src.zip src/amalgamation/duckdb.hpp src/amalgamation/duckdb.cpp src/include/duckdb.h
zip -j libduckdb-src.zip src/amalgamation/duckdb.hpp src/amalgamation/duckdb.cpp src/include/duckdb.h src/include/duckdb_extension.h
./scripts/upload-assets-to-staging.sh github_release libduckdb-src.zip libduckdb-linux-amd64.zip duckdb_cli-linux-amd64.zip
- uses: actions/upload-artifact@v3
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/NightlyTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,47 @@ jobs:
run: |
python3 scripts/run_tests_one_by_one.py build/relassert/test/unittest "*" --no-exit --timeout 1200
smaller-binary:
name: Smaller Binary
runs-on: ubuntu-20.04
needs: linux-memory-leaks
env:
CC: gcc-10
CXX: g++-10
GEN: ninja
BUILD_ICU: 1
BUILD_TPCH: 1
BUILD_TPCDS: 1
BUILD_JSON: 1
SMALLER_BINARY: 1
BUILD_JEMALLOC: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build

- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ env.CCACHE_SAVE }}

- name: Build
shell: bash
run: make

- name: Measure Size
shell: bash
run: ls -trlah build/release/src/libduckdb*

- name: Test
shell: bash
run: |
build/release/test/unittest "*"
linux-clang:
name: Clang 14
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/OnTag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
uses: ./.github/workflows/StagedUpload.yml
secrets: inherit
with:
override_git_describe: ${{ inputs.override_git_describe || github.ref_name }}
target_git_describe: ${{ inputs.override_git_describe || github.ref_name }}
Loading

0 comments on commit 862a0bb

Please sign in to comment.