Skip to content
Merged
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
48 changes: 0 additions & 48 deletions vortex-duckdb/src/e2e_test/vortex_scan_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//! This module contains tests for the `vortex_scan` table function.

use std::ffi::CStr;
use std::io::Write;
use std::net::TcpListener;
use std::path::Path;
use std::slice;
use std::str::FromStr;
Expand Down Expand Up @@ -348,52 +346,6 @@ fn test_vortex_scan_multiple_files() {
assert_eq!(total_sum, 21);
}

#[test]
fn test_vortex_scan_over_http() {
let file = RUNTIME.block_on(async {
let strings = VarBinArray::from(vec!["a", "b", "c"]);
write_single_column_vortex_file("strings", strings).await
});

let file_bytes = std::fs::read(file.path()).unwrap();
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = listener.local_addr().unwrap();

std::thread::spawn(move || {
for _ in 0..2 {
if let Ok((mut stream, _)) = listener.accept() {
let response = format!(
"HTTP/1.1 200 OK\r\nContent-Length: {}\r\n\r\n",
file_bytes.len()
);
stream.write_all(response.as_bytes()).unwrap();
stream.write_all(&file_bytes).unwrap();
}
}
});

let conn = database_connection();
conn.query("SET vortex_filesystem = 'duckdb';").unwrap();
conn.query("INSTALL httpfs;").unwrap();
conn.query("LOAD httpfs;").unwrap();

let url = format!(
"http://{}/{}",
addr,
file.path().file_name().unwrap().to_string_lossy()
);

let result = conn
.query(&format!("SELECT COUNT(*) FROM read_vortex('{url}')"))
.unwrap();
let chunk = result.into_iter().next().unwrap();
let count = chunk
.get_vector(0)
.as_slice_with_len::<i64>(chunk.len().as_())[0];

assert_eq!(count, 3);
}

#[test]
fn test_write_file() {
let conn = database_connection();
Expand Down
Loading