Skip to content
Draft
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
1 change: 0 additions & 1 deletion vortex-duckdb/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ fn main() {
.file("cpp/expr.cpp")
.file("cpp/file_system.cpp")
.file("cpp/logical_type.cpp")
.file("cpp/object_cache.cpp")
.file("cpp/replacement_scan.cpp")
.file("cpp/scalar_function.cpp")
.file("cpp/table_filter.cpp")
Expand Down
11 changes: 0 additions & 11 deletions vortex-duckdb/cpp/client_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <duckdb/main/client_context.hpp>
#include <duckdb/main/connection.hpp>
#include <duckdb/storage/object_cache.hpp>

extern "C" duckdb_client_context duckdb_vx_connection_get_client_context(duckdb_connection conn) {
try {
Expand All @@ -16,16 +15,6 @@ extern "C" duckdb_client_context duckdb_vx_connection_get_client_context(duckdb_
}
}

extern "C" duckdb_vx_object_cache duckdb_client_context_get_object_cache(duckdb_client_context ffi_context) {
try {
auto *context = reinterpret_cast<duckdb::ClientContext *>(ffi_context);
// This is okay because this is a ref to the object cache, this lives as long as the database.
return reinterpret_cast<duckdb_vx_object_cache>(&duckdb::ObjectCache::GetObjectCache(*context));
} catch (...) {
return nullptr;
}
}

extern "C" duckdb_value duckdb_client_context_try_get_current_setting(duckdb_client_context context,
const char *key) {
if (!context || !key) {
Expand Down
48 changes: 0 additions & 48 deletions vortex-duckdb/cpp/object_cache.cpp

This file was deleted.

15 changes: 0 additions & 15 deletions vortex-duckdb/src/duckdb/client_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

use std::ffi::CStr;

use vortex::error::vortex_panic;

use crate::cpp;
use crate::duckdb::ObjectCache;
use crate::duckdb::ObjectCacheRef;
use crate::duckdb::Value;
use crate::lifetime_wrapper;

Expand Down Expand Up @@ -36,17 +32,6 @@ impl ClientContextRef {
unsafe { &*(self as *const Self) }
}

/// Get the object cache for this client context.
pub fn object_cache(&self) -> &ObjectCacheRef {
unsafe {
let cache = cpp::duckdb_client_context_get_object_cache(self.as_ptr());
if cache.is_null() {
vortex_panic!("Failed to get object cache from client context");
}
ObjectCache::borrow(cache)
}
}

/// Try to get the current value of a configuration setting.
/// Returns None if the setting doesn't exist.
pub fn try_get_current_setting(&self, key: &CStr) -> Option<Value> {
Expand Down
35 changes: 0 additions & 35 deletions vortex-duckdb/src/duckdb/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,39 +279,4 @@ mod tests {
data: String,
value: i32,
}

#[test]
fn test_object_cache_put_get() {
let conn = test_connection().unwrap();
let client_context = conn.client_context().unwrap();
let cache = client_context.object_cache();

// Test with a simple struct
let test_entry = TestCacheEntry {
data: "hello world".to_string(),
value: 42,
};

// Store the entry in the cache
cache.put("test_key", test_entry);

// Retrieve it back
let retrieved = cache.get::<TestCacheEntry>("test_key");
assert!(retrieved.is_some());

let retrieved_entry = retrieved.unwrap();
assert_eq!(retrieved_entry.data, "hello world");
assert_eq!(retrieved_entry.value, 42);
}

#[test]
fn test_object_cache_get_nonexistent() {
let conn = test_connection().unwrap();
let client_context = conn.client_context().unwrap();
let cache = client_context.object_cache();

// Try to get a non-existent key
let result = cache.get::<TestCacheEntry>("nonexistent_key");
assert!(result.is_none());
}
}
2 changes: 0 additions & 2 deletions vortex-duckdb/src/duckdb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod expr;
mod file_system;
mod logical_type;
mod macro_;
mod object_cache;
mod query_result;
mod scalar_function;
mod selection_vector;
Expand All @@ -37,7 +36,6 @@ pub use ddb_string::*;
pub use expr::*;
pub use file_system::*;
pub use logical_type::*;
pub use object_cache::*;
pub use query_result::*;
pub use scalar_function::*;
pub use selection_vector::*;
Expand Down
77 changes: 0 additions & 77 deletions vortex-duckdb/src/duckdb/object_cache.rs

This file was deleted.

Loading
Loading