Skip to content

Commit

Permalink
Merge pull request #90 from samansmink/bump-delta-to-0.3.1
Browse files Browse the repository at this point in the history
bump kernel to v0.3.1
  • Loading branch information
samansmink authored Sep 11, 2024
2 parents 8a2957c + fb5999e commit 24d9b78
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 261 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/LocalTesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ jobs:
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}

- name: Setup vcpkg
uses: lukka/[email protected]
Expand Down Expand Up @@ -281,13 +280,13 @@ jobs:
if: always()
shell: bash
run: |
python3 ./scripts/regression_test_runner.py --old=duckdb_delta/build/release/benchmark/benchmark_runner --new=build/release/benchmark/benchmark_runner --benchmarks=.github/regression/tpch_sf1_local.csv --verbose --threads=2 --root-dir=.
python3 ./duckdb/scripts/regression_test_runner.py --old=duckdb_delta/build/release/benchmark/benchmark_runner --new=build/release/benchmark/benchmark_runner --benchmarks=.github/regression/tpch_sf1_local.csv --verbose --threads=2 --root-dir=.
- name: Regression Test TPC-DS
if: always()
shell: bash
run: |
python ./scripts/regression_test_runner.py --old=duckdb_delta/build/release/benchmark/benchmark_runner --new=build/release/benchmark/benchmark_runner --benchmarks=.github/regression/tpcds_sf1_local.csv --verbose --threads=2 --root-dir=.
python ./duckdb/scripts/regression_test_runner.py --old=duckdb_delta/build/release/benchmark/benchmark_runner --new=build/release/benchmark/benchmark_runner --benchmarks=.github/regression/tpcds_sf1_local.csv --verbose --threads=2 --root-dir=.
- name: Test benchmark makefile
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ExternalProject_Add(
GIT_REPOSITORY "https://github.com/delta-incubator/delta-kernel-rs"
# WARNING: the FFI headers are currently pinned due to the C linkage issue of the c++ headers. Currently, when bumping
# the kernel version, the produced header in ./src/include/delta_kernel_ffi.hpp should be also bumped, applying the fix
GIT_TAG v0.2.0
GIT_TAG v0.3.1
# Prints the env variables passed to the cargo build to the terminal, useful in debugging because passing them
# through CMake is an error-prone mess
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${RUST_UNSET_ENV_VARS} ${RUST_ENV_VARS} env
Expand Down
254 changes: 0 additions & 254 deletions scripts/regression_test_runner.py

This file was deleted.

28 changes: 25 additions & 3 deletions src/include/delta_kernel_ffi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum class KernelError {
InvalidDecimalError,
InvalidStructDataError,
InternalError,
InvalidExpression,
};

struct CStringMap;
Expand Down Expand Up @@ -93,6 +94,13 @@ struct KernelBoolSlice {
uintptr_t len;
};

/// An owned slice of u64 row indexes allocated by the kernel. The engine is responsible for
/// freeing this slice by calling [super::free_row_indexes] once.
struct KernelRowIndexArray {
uint64_t *ptr;
uintptr_t len;
};

/// Represents an object that crosses the FFI boundary and which outlives the scope that created
/// it. It can be passed freely between rust code and external code. The
///
Expand Down Expand Up @@ -382,7 +390,7 @@ using CScanCallback = void(*)(NullableCvoid engine_context,
const DvInfo *dv_info,
const CStringMap *partition_map);

// This trickery is from https://github.com/mozilla/cbindgen/issues/402#issuecomment-578680163
// This trickery is from https://github.com/mozilla/cbindgen/issues/402#issuecomment-578680163
struct im_an_unused_struct_that_tricks_msvc_into_compilation {
ExternResult<KernelBoolSlice> field;
ExternResult<bool> field2;
Expand All @@ -394,6 +402,7 @@ struct im_an_unused_struct_that_tricks_msvc_into_compilation {
ExternResult<Handle<SharedScanDataIterator>> field8;
ExternResult<Handle<SharedScan>> field9;
ExternResult<Handle<ExclusiveFileReadResultIterator>> field10;
ExternResult<KernelRowIndexArray> field11;
};

extern "C" {
Expand All @@ -403,6 +412,11 @@ extern "C" {
/// Caller is responsible for passing a valid handle.
void free_bool_slice(KernelBoolSlice slice);

/// # Safety
///
/// Caller is responsible for passing a valid handle.
void free_row_indexes(KernelRowIndexArray slice);

/// Drop an `ExclusiveEngineData`.
///
/// # Safety
Expand Down Expand Up @@ -705,6 +719,14 @@ ExternResult<KernelBoolSlice> selection_vector_from_dv(const DvInfo *dv_info,
Handle<SharedExternEngine> engine,
Handle<SharedGlobalScanState> state);

/// Get a vector of row indexes out of a [`DvInfo`] struct
///
/// # Safety
/// Engine is responsible for providing valid pointers for each argument
ExternResult<KernelRowIndexArray> row_indexes_from_dv(const DvInfo *dv_info,
Handle<SharedExternEngine> engine,
Handle<SharedGlobalScanState> state);

/// Shim for ffi to call visit_scan_data. This will generally be called when iterating through scan
/// data which provides the data handle and selection vector as each element in the iterator.
///
Expand All @@ -715,6 +737,6 @@ void visit_scan_data(Handle<ExclusiveEngineData> data,
NullableCvoid engine_context,
CScanCallback callback);

} // extern "C"
} // extern "C"

} // namespace ffi
} // namespace ffi

0 comments on commit 24d9b78

Please sign in to comment.