Skip to content

Commit 8722d05

Browse files
authored
Add DuckDB 1.5.x compatibility (#24)
* Switch CI to DuckDB reusable extension workflow Track v1.4-andium branch instead of pinning to exact v1.4.4 tag so point releases (v1.4.5, v1.4.6, ...) automatically rebuild the extension with matching platform strings. Add weekday scheduled builds. - Use duckdb/extension-ci-tools reusable _extension_distribution.yml - Add branch = main to .gitmodules for submodule tracking - Exclude wasm and untested platforms (gcc4, rtools, mingw) for now - Enable rust_logs for debugging initial runs * Add adtech kitchen sink and Looker-style demo notebooks * Fix CI concurrency key * Add DuckDB 1.5.x compatibility * Target DuckDB 1.5 stable release line
1 parent 6591df9 commit 8722d05

7 files changed

Lines changed: 49 additions & 70 deletions

File tree

Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,37 @@
11
#
2-
# Build, test and (optionally) release the extension
2+
# Build and test the extension using the DuckDB reusable CI workflow.
3+
# Run both the latest stable branch and DuckDB main so API breaks for the next
4+
# release line are caught before release day.
35
#
46
name: Main Extension Distribution Pipeline
57
on:
68
push:
79
pull_request:
810
workflow_dispatch:
11+
schedule:
12+
- cron: "0 8 * * 1-5"
913

1014
concurrency:
1115
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' && github.sha || '' }}
12-
cancel-in-progress: true
16+
cancel-in-progress: false
1317

1418
jobs:
15-
build:
16-
name: Build (${{ matrix.duckdb_arch }})
17-
runs-on: ${{ matrix.os }}
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
include:
22-
- os: ubuntu-latest
23-
duckdb_arch: linux_amd64
24-
rust_target: x86_64-unknown-linux-gnu
25-
- os: macos-14
26-
duckdb_arch: osx_amd64
27-
rust_target: x86_64-apple-darwin
28-
osx_build_arch: x86_64
29-
- os: macos-14
30-
duckdb_arch: osx_arm64
31-
rust_target: aarch64-apple-darwin
32-
osx_build_arch: arm64
33-
- os: windows-latest
34-
duckdb_arch: windows_amd64
35-
rust_target: x86_64-pc-windows-msvc
36-
env:
37-
OSX_BUILD_ARCH: ${{ matrix.osx_build_arch }}
38-
39-
steps:
40-
- uses: actions/checkout@v4
41-
with:
42-
submodules: recursive
43-
fetch-depth: 0
44-
45-
- name: Install Rust
46-
uses: dtolnay/rust-toolchain@stable
47-
with:
48-
targets: ${{ matrix.rust_target }}
49-
50-
- name: Build extension (Unix)
51-
if: runner.os != 'Windows'
52-
run: make release
53-
54-
- name: Build extension (Windows)
55-
if: runner.os == 'Windows'
56-
shell: bash
57-
run: |
58-
cd yardstick-rs && cargo build --release
59-
cd ..
60-
mkdir -p build/release
61-
cd build/release
62-
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release ../..
63-
cmake --build . --config Release
64-
65-
- name: Test extension
66-
if: matrix.osx_build_arch != 'x86_64' && runner.os != 'Windows'
67-
run: make test
68-
69-
- name: Upload artifact
70-
uses: actions/upload-artifact@v4
71-
with:
72-
name: yardstick-${{ matrix.duckdb_arch }}
73-
path: build/release/extension/yardstick/yardstick.duckdb_extension
19+
duckdb-stable-build:
20+
name: Build stable extension binaries
21+
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.5-variegata
22+
with:
23+
duckdb_version: v1.5-variegata
24+
ci_tools_version: v1.5-variegata
25+
extension_name: yardstick
26+
extra_toolchains: rust
27+
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;linux_amd64_gcc4;windows_amd64_rtools;windows_amd64_mingw"
28+
29+
duckdb-next-build:
30+
name: Build next extension binaries
31+
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
32+
with:
33+
duckdb_version: main
34+
ci_tools_version: main
35+
extension_name: yardstick
36+
extra_toolchains: rust
37+
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;linux_amd64_gcc4;windows_amd64_rtools;windows_amd64_mingw"

.gitmodules

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[submodule "duckdb"]
22
path = duckdb
33
url = https://github.com/duckdb/duckdb
4+
branch = main
45
[submodule "extension-ci-tools"]
56
path = extension-ci-tools
6-
url = https://github.com/duckdb/extension-ci-tools
7+
url = https://github.com/duckdb/extension-ci-tools.git
8+
branch = main

duckdb

Submodule duckdb updated 3458 files

src/include/yardstick_extension.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
#include "duckdb.hpp"
44
#include "duckdb/parser/parser.hpp"
5+
#include "duckdb/parser/parser_extension.hpp"
56
#include "duckdb/parser/statement/extension_statement.hpp"
7+
#include "duckdb/planner/binder.hpp"
8+
#include "duckdb/planner/operator/logical_extension_operator.hpp"
9+
#include "duckdb/planner/operator_extension.hpp"
610

711
namespace duckdb {
812

src/yardstick_extension.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "yardstick_extension.hpp"
44
#include "duckdb/parser/parser.hpp"
5+
#include "duckdb/parser/parser_extension.hpp"
56
#include "duckdb/parser/statement/extension_statement.hpp"
67
#include "duckdb/function/table_function.hpp"
78
#include "duckdb/main/connection.hpp"
@@ -532,10 +533,18 @@ static void LoadInternal(ExtensionLoader &loader) {
532533

533534
// Register parser extension
534535
YardstickParserExtension parser;
536+
#if __has_include("duckdb/main/extension_callback_manager.hpp")
537+
ParserExtension::Register(config, parser);
538+
#else
535539
config.parser_extensions.push_back(parser);
540+
#endif
536541

537542
// Register operator extension
543+
#if __has_include("duckdb/main/extension_callback_manager.hpp")
544+
OperatorExtension::Register(config, make_shared_ptr<YardstickOperatorExtension>());
545+
#else
538546
config.operator_extensions.push_back(make_uniq<YardstickOperatorExtension>());
547+
#endif
539548

540549
// Register table function for AGGREGATE() expansion
541550
TableFunction query_func("yardstick", {LogicalType::VARCHAR},

test/sql/measures.test

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,10 +883,10 @@ SEMANTIC SELECT month, region, AGGREGATE(revenue), AGGREGATE(revenue) AT (ALL re
883883
FROM monthly_sales_v
884884
;
885885
----
886-
2023-01-01 EU 50.0 150.0
887-
2023-01-01 US 100.0 150.0
888-
2023-02-01 EU 20.0 220.0
889-
2023-02-01 US 200.0 220.0
886+
2023-01-01 00:00:00 EU 50.0 150.0
887+
2023-01-01 00:00:00 US 100.0 150.0
888+
2023-02-01 00:00:00 EU 20.0 220.0
889+
2023-02-01 00:00:00 US 200.0 220.0
890890

891891
# =============================================================================
892892
# Test: Multi-fact JOINs (wide tables)
@@ -1054,8 +1054,8 @@ SEMANTIC SELECT DATE_TRUNC('year', sale_date) AS yr, AGGREGATE(revenue)
10541054
FROM dated_sales_v
10551055
;
10561056
----
1057-
2023-01-01 530.0
1058-
2024-01-01 430.0
1057+
2023-01-01 00:00:00 530.0
1058+
2024-01-01 00:00:00 430.0
10591059

10601060
# =============================================================================
10611061
# Test: DuckDB string functions in measures

0 commit comments

Comments
 (0)