Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 25 additions & 61 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,37 @@
#
# Build, test and (optionally) release the extension
# Build and test the extension using the DuckDB reusable CI workflow.
# Run both the latest stable branch and DuckDB main so API breaks for the next
# release line are caught before release day.
#
name: Main Extension Distribution Pipeline
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 8 * * 1-5"

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

jobs:
build:
name: Build (${{ matrix.duckdb_arch }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
duckdb_arch: linux_amd64
rust_target: x86_64-unknown-linux-gnu
- os: macos-14
duckdb_arch: osx_amd64
rust_target: x86_64-apple-darwin
osx_build_arch: x86_64
- os: macos-14
duckdb_arch: osx_arm64
rust_target: aarch64-apple-darwin
osx_build_arch: arm64
- os: windows-latest
duckdb_arch: windows_amd64
rust_target: x86_64-pc-windows-msvc
env:
OSX_BUILD_ARCH: ${{ matrix.osx_build_arch }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}

- name: Build extension (Unix)
if: runner.os != 'Windows'
run: make release

- name: Build extension (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
cd yardstick-rs && cargo build --release
cd ..
mkdir -p build/release
cd build/release
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release ../..
cmake --build . --config Release

- name: Test extension
if: matrix.osx_build_arch != 'x86_64' && runner.os != 'Windows'
run: make test

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: yardstick-${{ matrix.duckdb_arch }}
path: build/release/extension/yardstick/yardstick.duckdb_extension
duckdb-stable-build:
name: Build stable extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.5-variegata
with:
duckdb_version: v1.5-variegata
ci_tools_version: v1.5-variegata
extension_name: yardstick
extra_toolchains: rust
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;linux_amd64_gcc4;windows_amd64_rtools;windows_amd64_mingw"

duckdb-next-build:
name: Build next extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
with:
duckdb_version: main
ci_tools_version: main
extension_name: yardstick
extra_toolchains: rust
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;linux_amd64_gcc4;windows_amd64_rtools;windows_amd64_mingw"
4 changes: 3 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[submodule "duckdb"]
path = duckdb
url = https://github.com/duckdb/duckdb
branch = main
[submodule "extension-ci-tools"]
path = extension-ci-tools
url = https://github.com/duckdb/extension-ci-tools
url = https://github.com/duckdb/extension-ci-tools.git
branch = main
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 3458 files
4 changes: 4 additions & 0 deletions src/include/yardstick_extension.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

#include "duckdb.hpp"
#include "duckdb/parser/parser.hpp"
#include "duckdb/parser/parser_extension.hpp"
#include "duckdb/parser/statement/extension_statement.hpp"
#include "duckdb/planner/binder.hpp"
#include "duckdb/planner/operator/logical_extension_operator.hpp"
#include "duckdb/planner/operator_extension.hpp"

namespace duckdb {

Expand Down
9 changes: 9 additions & 0 deletions src/yardstick_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "yardstick_extension.hpp"
#include "duckdb/parser/parser.hpp"
#include "duckdb/parser/parser_extension.hpp"
#include "duckdb/parser/statement/extension_statement.hpp"
#include "duckdb/function/table_function.hpp"
#include "duckdb/main/connection.hpp"
Expand Down Expand Up @@ -532,10 +533,18 @@ static void LoadInternal(ExtensionLoader &loader) {

// Register parser extension
YardstickParserExtension parser;
#if __has_include("duckdb/main/extension_callback_manager.hpp")
ParserExtension::Register(config, parser);
#else
config.parser_extensions.push_back(parser);
#endif

// Register operator extension
#if __has_include("duckdb/main/extension_callback_manager.hpp")
OperatorExtension::Register(config, make_shared_ptr<YardstickOperatorExtension>());
#else
config.operator_extensions.push_back(make_uniq<YardstickOperatorExtension>());
#endif

// Register table function for AGGREGATE() expansion
TableFunction query_func("yardstick", {LogicalType::VARCHAR},
Expand Down
12 changes: 6 additions & 6 deletions test/sql/measures.test
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,10 @@ SEMANTIC SELECT month, region, AGGREGATE(revenue), AGGREGATE(revenue) AT (ALL re
FROM monthly_sales_v
;
----
2023-01-01 EU 50.0 150.0
2023-01-01 US 100.0 150.0
2023-02-01 EU 20.0 220.0
2023-02-01 US 200.0 220.0
2023-01-01 00:00:00 EU 50.0 150.0
2023-01-01 00:00:00 US 100.0 150.0
2023-02-01 00:00:00 EU 20.0 220.0
2023-02-01 00:00:00 US 200.0 220.0

# =============================================================================
# Test: Multi-fact JOINs (wide tables)
Expand Down Expand Up @@ -1054,8 +1054,8 @@ SEMANTIC SELECT DATE_TRUNC('year', sale_date) AS yr, AGGREGATE(revenue)
FROM dated_sales_v
;
----
2023-01-01 530.0
2024-01-01 430.0
2023-01-01 00:00:00 530.0
2024-01-01 00:00:00 430.0

# =============================================================================
# Test: DuckDB string functions in measures
Expand Down
Loading