Skip to content

Commit

Permalink
merge with feature and implement PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Oct 7, 2024
2 parents db177d4 + 92cf6f1 commit fec7af8
Show file tree
Hide file tree
Showing 508 changed files with 20,445 additions and 16,509 deletions.
1 change: 1 addition & 0 deletions .github/config/in_tree_extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#

duckdb_extension_load(autocomplete)
duckdb_extension_load(core_functions)
duckdb_extension_load(fts)
duckdb_extension_load(httpfs)
duckdb_extension_load(icu)
Expand Down
5 changes: 5 additions & 0 deletions .github/config/out_of_tree_extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if (NOT MINGW AND NOT "${OS_NAME}" STREQUAL "linux")
LOAD_TESTS
GIT_URL https://github.com/duckdb/duckdb_delta
GIT_TAG 3933ebd800ad06a64656c9aef6ca7d62897fa4db
APPLY_PATCHES
)
endif()

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

Expand Down Expand Up @@ -104,6 +106,7 @@ duckdb_extension_load(spatial
GIT_TAG bb9c829693965f029eb5a312aefed4c538fad781
INCLUDE_DIR spatial/include
TEST_DIR test/sql
APPLY_PATCHES
)

################# SQLITE_SCANNER
Expand All @@ -118,12 +121,14 @@ 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 f24be8b5b0cd0eeed7541e10cff42d7050771afc
APPLY_PATCHES
)

################# SUBSTRAIT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/src/functions/delta_scan.cpp b/src/functions/delta_scan.cpp
index a3e4f11..23482f1 100644
--- a/src/functions/delta_scan.cpp
+++ b/src/functions/delta_scan.cpp
@@ -510,7 +510,7 @@ unique_ptr<NodeStatistics> DeltaSnapshot::GetCardinality(ClientContext &context)
return make_uniq<NodeStatistics>(total_tuple_count,total_tuple_count);
}

-unique_ptr<MultiFileReader> DeltaMultiFileReader::CreateInstance() {
+unique_ptr<MultiFileReader> DeltaMultiFileReader::CreateInstance(const TableFunction &table_function) {
return std::move(make_uniq<DeltaMultiFileReader>());
}

diff --git a/src/include/functions/delta_scan.hpp b/src/include/functions/delta_scan.hpp
index aac35cc..23c937d 100644
--- a/src/include/functions/delta_scan.hpp
+++ b/src/include/functions/delta_scan.hpp
@@ -103,7 +103,7 @@ struct DeltaMultiFileReaderGlobalState : public MultiFileReaderGlobalState {
};

struct DeltaMultiFileReader : public MultiFileReader {
- static unique_ptr<MultiFileReader> CreateInstance();
+ static unique_ptr<MultiFileReader> CreateInstance(const TableFunction &table_function);
//! Return a DeltaSnapshot
unique_ptr<MultiFileList> CreateFileList(ClientContext &context, const vector<string> &paths,
FileGlobOptions options) override;
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);
15 changes: 15 additions & 0 deletions .github/patches/extensions/spatial/random_test_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/spatial/src/spatial/core/functions/table/st_generatepoints.cpp b/spatial/src/spatial/core/functions/table/st_generatepoints.cpp
index 007d386..8754619 100644
--- a/spatial/src/spatial/core/functions/table/st_generatepoints.cpp
+++ b/spatial/src/spatial/core/functions/table/st_generatepoints.cpp
@@ -79,8 +79,8 @@ static void Execute(ClientContext &context, TableFunctionInput &data_p, DataChun
const auto chunk_size = MinValue<idx_t>(STANDARD_VECTOR_SIZE, bind_data.count - state.current_idx);
for (idx_t i = 0; i < chunk_size; i++) {

- x_data[i] = state.rng.NextRandom(bind_data.bbox.min.x, bind_data.bbox.max.x);
- y_data[i] = state.rng.NextRandom(bind_data.bbox.min.y, bind_data.bbox.max.y);
+ x_data[i] = state.rng.NextRandom32(bind_data.bbox.min.x, bind_data.bbox.max.x);
+ y_data[i] = state.rng.NextRandom32(bind_data.bbox.min.y, bind_data.bbox.max.y);

state.current_idx++;
}
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());
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/test/sql/sql_reduce.test b/test/sql/sql_reduce.test
index 428ae92..af0530f 100644
--- a/test/sql/sql_reduce.test
+++ b/test/sql/sql_reduce.test
@@ -48,7 +48,7 @@ INSERT INTO tbl (VALUES (1))
INSERT INTO tbl (VALUES (1, 2))
INSERT INTO tbl (VALUES (2))
INSERT INTO tbl SELECT *
-INSERT INTO tbl SELECT NULL FROM (VALUES (1, 2))
+INSERT INTO tbl SELECT NULL FROM (VALUES (1, 2)) AS valueslist
INSERT INTO tbl SELECT NULL FROM (VALUES (1, 2)) AS valueslist

query I
16 changes: 16 additions & 0 deletions .github/regression/realnest.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
benchmark/realnest/01_aggregate-first-level-struct-members.benchmark
benchmark/realnest/02_list_sort.benchmark
benchmark/realnest/03_create_table_from_unnested_structs.benchmark
benchmark/realnest/04_list_transform_and_list_aggregate.benchmark
benchmark/realnest/05_list_filter.benchmark
benchmark/realnest/06_list_filter_on_unnested_structure.benchmark
benchmark/realnest/07_list_unique_on_transformed_and_aggregated_list.benchmark
benchmark/realnest/08_count_map_keys.benchmark
benchmark/realnest/09_array_agg.benchmark
benchmark/realnest/11_list_sort_reduce_transform.benchmark
benchmark/realnest/12_map_list_values.benchmark
benchmark/realnest/13_multi_join_nested_data_with_filtering.benchmark
benchmark/realnest/14_list_slice.benchmark
benchmark/realnest/15_list_sort.benchmark
benchmark/realnest/16_most_common_list_aggregates.benchmark
benchmark/realnest/17_list_aggregates_histogram_stddev_mode.benchmark
2 changes: 1 addition & 1 deletion .github/workflows/LinuxRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ jobs:
- name: Build
shell: bash
env:
DISABLE_BUILTIN_EXTENSIONS: 1
GENERATE_EXTENSION_ENTRIES: 1
LOCAL_EXTENSION_REPO: build/release/repository_other
run: |
make
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
Loading

0 comments on commit fec7af8

Please sign in to comment.