diff --git a/Cargo.lock b/Cargo.lock index fdf7da5..bf5e5d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "arrow" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cfdd0833e32a9874d2b55089333ad310c0be208aafa277385ce2461dec90be3" +checksum = "234ce58e76c04e8162c2e4bc3fe53fa7c2418ef5fba7bb2838b8531b7d4fbf14" dependencies = [ "arrow-arith", "arrow-array", @@ -139,9 +139,9 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a41203398f0eaa6f7ec8e62c0da742a21abf282c148fc157f6c35c90e29981a" +checksum = "2303ebedb1071f4f72d71171e383859a9a285c94d99e4892685a96fca9890720" dependencies = [ "arrow-array", "arrow-buffer", @@ -153,9 +153,9 @@ dependencies = [ [[package]] name = "arrow-array" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae33dad492b7df00a217563a7b0ef2874df68a0deea1b1a3acf628152f7f7a69" +checksum = "51dff6e4b9f158864a0aeb6a131ad53858ecbae7a2fc8989307b9b3c6b2f122e" dependencies = [ "ahash", "arrow-buffer", @@ -165,6 +165,7 @@ dependencies = [ "chrono-tz", "half", "hashbrown 0.17.1", + "libc", "num-complex", "num-integer", "num-traits", @@ -172,21 +173,21 @@ dependencies = [ [[package]] name = "arrow-buffer" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9552f96391c005e6ab449fa941420935e7e062489b12b8b1b08879b2163f5b5" +checksum = "c7235b863533e9db3ab86905b4521251de11226275b436ff3cb2d0010558d1c5" dependencies = [ "bytes", "half", - "num-bigint", + "num-bigint 0.5.1", "num-traits", ] [[package]] name = "arrow-cast" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8a327c9649f30d8406995f27642b68df354713cca3baaaf100f076f18d5f34" +checksum = "d52cf840f0c34aeeb7e8b05aba72d66878e6c001827f423331f0b260209e7b7e" dependencies = [ "arrow-array", "arrow-buffer", @@ -195,7 +196,7 @@ dependencies = [ "arrow-schema", "arrow-select", "atoi", - "base64 0.22.1", + "base64", "chrono", "comfy-table", "half", @@ -204,11 +205,22 @@ dependencies = [ "ryu", ] +[[package]] +name = "arrow-cmp" +version = "60.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73a0e9adb28d95739fabcdae637261a2c14e618caf58ba1b88857120f9ee2687" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-schema", +] + [[package]] name = "arrow-data" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b24852db04738907e06c04ea61e42fe7fda962a34513022dc0d0e754fb7976b" +checksum = "5aa06d5e22786c4966ffc4d2f171d0cb65d95f6bdea108a14e8c335e9faa437f" dependencies = [ "arrow-buffer", "arrow-schema", @@ -219,9 +231,9 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a908a11fcfb3fb2f6730f4ac15e367bc644e419155e96238f68cf3adde572b" +checksum = "86c523472d22e31f984df7a44fc36e6323d3c9b05ffe53d267ee4c3aa7c128d2" dependencies = [ "arrow-array", "arrow-buffer", @@ -234,9 +246,9 @@ dependencies = [ [[package]] name = "arrow-json" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a96aed3931c076adee39ec2a40d8219fc7f09e79bcdaca1df16272993e1e14" +checksum = "342fc6600a93a48038d853431803c941436b7b51f756763e76cad9784b7e3718" dependencies = [ "arrow-array", "arrow-buffer", @@ -259,12 +271,13 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a083ec750f5c043f02946b4baf05fcdbb55f4560a3277055caca5cc99f3eb0" +checksum = "5a7ac2c6a9cdc782fa9548d3763461eaec8c93347e297fddbaa44807e70a3698" dependencies = [ "arrow-array", "arrow-buffer", + "arrow-cmp", "arrow-data", "arrow-schema", "arrow-select", @@ -272,9 +285,9 @@ dependencies = [ [[package]] name = "arrow-row" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514ba0ef0d4c5896202dae736251ce415abb43a950bed570fb7981b8716c0e4c" +checksum = "758b87e9648d80001e0916c083334ed93074c677a81a96144d5c84bd2d8eab2a" dependencies = [ "arrow-array", "arrow-buffer", @@ -285,22 +298,23 @@ dependencies = [ [[package]] name = "arrow-schema" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ca356ad6425cecb6eb7b28e4f659f1ee7880fbb1a16127de7dd62901efee9e" +checksum = "f85a9a58cd03560526b0066487574aacb9008e413504fa0ee23d61141e96c338" dependencies = [ "bitflags", ] [[package]] name = "arrow-select" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58da39eb3d8350ad4a549e5c2bc49284dac554016c69829310350f1731b0aad" +checksum = "ba3482b7d03bf4a3bf0b195f08a7f2b071595ccd54897e35b975ac63d3104977" dependencies = [ "ahash", "arrow-array", "arrow-buffer", + "arrow-cmp", "arrow-data", "arrow-schema", "num-traits", @@ -308,9 +322,9 @@ dependencies = [ [[package]] name = "arrow-string" -version = "58.4.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6789b388467525e3271326b6b4915666ecfdf5142aef09779445c954b67543c" +checksum = "f300b4400b1e7cd58f7cbbd5dd2a0072cc59e73bfaee2a152b3ac660e46d9dd1" dependencies = [ "arrow-array", "arrow-buffer", @@ -335,9 +349,9 @@ dependencies = [ [[package]] name = "atoi" -version = "2.0.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +checksum = "d12c37257553c19e9aee6cba77814fdc9e07844abfc8b3a2c377cd920ee5a993" dependencies = [ "num-traits", ] @@ -354,12 +368,6 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "base64" version = "0.23.1" @@ -408,12 +416,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" -[[package]] -name = "cfg_aliases" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" - [[package]] name = "chrono" version = "0.4.45" @@ -501,11 +503,10 @@ dependencies = [ [[package]] name = "comfy-table" -version = "7.1.4" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a65ebfec4fb190b6f90e944a817d60499ee0744e582530e2c9900a22e591d9a" +checksum = "b96a46ad395a5e00676eddaca4a45ed78b29c08be5a878d35e4b071c625637dd" dependencies = [ - "crossterm", "unicode-segmentation", "unicode-width", ] @@ -574,28 +575,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossterm" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" -dependencies = [ - "bitflags", - "crossterm_winapi", - "parking_lot", - "rustix 0.38.44", - "winapi", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi", -] - [[package]] name = "crunchy" version = "0.2.4" @@ -651,12 +630,11 @@ dependencies = [ [[package]] name = "duckdb" -version = "1.10506.1" -source = "git+https://github.com/duckdb/duckdb-rs?tag=v1.10506.1#2d25cb2a4e6c477e9d48db9b22fa67d80c859b1e" +version = "1.20000.0" +source = "git+https://github.com/duckdb/duckdb-rs?tag=v1.20000.0#1b8f7cca6e28c5ea8c4185aaa266424f25c3dfdc" dependencies = [ "arrow", "cast", - "comfy-table", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -1227,8 +1205,8 @@ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libduckdb-sys" -version = "1.10506.1" -source = "git+https://github.com/duckdb/duckdb-rs?tag=v1.10506.1#2d25cb2a4e6c477e9d48db9b22fa67d80c859b1e" +version = "1.20000.0" +source = "git+https://github.com/duckdb/duckdb-rs?tag=v1.20000.0#1b8f7cca6e28c5ea8c4185aaa266424f25c3dfdc" dependencies = [ "cc", "cmake", @@ -1240,7 +1218,6 @@ dependencies = [ "ureq", "vcpkg", "which", - "zip", ] [[package]] @@ -1258,12 +1235,6 @@ dependencies = [ "libc", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -1299,9 +1270,9 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] name = "lz4_flex" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef0d4ed8669f8f8826eb00dc878084aa8f253506c4fd5e8f58f5bce72ddb97e" +checksum = "ecbdfe44b1bd960b68170b417450a628c43f7cf56bb3c5317e61cb230ee7f226" dependencies = [ "twox-hash", ] @@ -1358,25 +1329,13 @@ dependencies = [ "tokio", ] -[[package]] -name = "nix" -version = "0.31.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" -dependencies = [ - "bitflags", - "cfg-if", - "cfg_aliases", - "libc", -] - [[package]] name = "num" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-bigint", + "num-bigint 0.4.8", "num-complex", "num-integer", "num-iter", @@ -1394,6 +1353,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e7820bc0a80a0238e650327316f929ba18d5be054b647490a3a6a339f3e7c0" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.6" @@ -1434,7 +1403,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "num-bigint", + "num-bigint 0.4.8", "num-integer", "num-traits", ] @@ -1690,19 +1659,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.5" @@ -1712,7 +1668,7 @@ dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.12.1", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -1974,7 +1930,7 @@ dependencies = [ "fastrand", "getrandom 0.4.3", "once_cell", - "rustix 1.1.5", + "rustix", "windows-sys 0.61.2", ] @@ -2101,12 +2057,6 @@ version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86a801b3cea342a06d468c8710662aa29e5e05e4f5c0d62f00bbb7f2ad7941c2" -[[package]] -name = "typed-path" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ec2755506471f54baf5e4bb5499d8e510cc1caf271270e778a736bd2d7336c" - [[package]] name = "unicode-ident" version = "1.0.27" @@ -2137,7 +2087,7 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde93ff05758a36a851a398a772b0b79a82fbe3c186a46f2696baaeaf84c966b" dependencies = [ - "base64 0.23.1", + "base64", "cookie_store", "flate2", "log", @@ -2157,7 +2107,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841583fc36089d7d59419568ae157f43a5a03a2e5a81ba87c77d1596ef46e922" dependencies = [ - "base64 0.23.1", + "base64", "http", "httparse", "log", @@ -2283,28 +2233,6 @@ dependencies = [ "libc", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.62.2" @@ -2373,15 +2301,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.61.2" @@ -2474,7 +2393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", - "rustix 1.1.5", + "rustix", ] [[package]] @@ -2580,21 +2499,6 @@ dependencies = [ "syn 3.0.9", ] -[[package]] -name = "zip" -version = "9.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e04976da629d3b04204ba8105b396a193af8ad2583b2c79bfb3ab8af580a11e" -dependencies = [ - "crc32fast", - "flate2", - "indexmap", - "memchr", - "nix", - "typed-path", - "zopfli", -] - [[package]] name = "zlib-rs" version = "0.6.8" @@ -2606,15 +2510,3 @@ name = "zmij" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" - -[[package]] -name = "zopfli" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11" -dependencies = [ - "bumpalo", - "crc32fast", - "log", - "simd-adler32", -] diff --git a/Cargo.toml b/Cargo.toml index 613c510..e368fd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,16 +7,16 @@ license = "MIT" [dependencies] anyhow = "1" -arrow = { version = "=58.4.0", default-features = false, features = [ +arrow = { version = "=60.0.0", default-features = false, features = [ "ipc", "json", "chrono-tz", ] } -arrow-ipc = { version = "=58.4.0", features = ["lz4"] } +arrow-ipc = { version = "=60.0.0", features = ["lz4"] } chrono = { version = "0.4", default-features = false, features = ["clock"] } clap = { version = "4", features = ["derive", "env"] } dirs = "7" -duckdb = { git = "https://github.com/duckdb/duckdb-rs", tag = "v1.10506.1", features = [ +duckdb = { git = "https://github.com/duckdb/duckdb-rs", tag = "v1.20000.0", features = [ "bundled-cmake", "icu", "json", diff --git a/src/metrics.rs b/src/metrics.rs index b0ed53c..465f9a8 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -3,7 +3,7 @@ use std::path::Path; use anyhow::Result; use duckdb::arrow::ipc::reader::StreamReader; -use duckdb::vtab::arrow::{ArrowVTab, arrow_recordbatch_to_query_params}; +use duckdb::vtab::arrow::{ArrowBatchRegistration, ArrowVTab}; use crate::auth::{resolve_api_base_url, resolve_api_key}; use crate::utils::{api_post, input_err, open_db, parse_string_list, resolve_relative_datetime}; @@ -106,7 +106,7 @@ pub fn run( .join(", "); let insert_sql = format!( "INSERT INTO metrics_staging (app_id, {col_list}) \ - SELECT {app_id}, {col_list} FROM arrow(?, ?)" + SELECT {app_id}, {col_list} FROM arrow(?)" ); let mut total = 0usize; @@ -119,8 +119,8 @@ pub fn run( for batch in reader { let batch = batch?; total += batch.num_rows(); - let params = arrow_recordbatch_to_query_params(batch); - conn.execute(&insert_sql, params)?; + let registration = ArrowBatchRegistration::new(batch); + conn.execute(&insert_sql, [®istration])?; eprint!( "\r{total} metrics rows written to table 'metrics' in {}...", db_path.display() diff --git a/src/request_logs.rs b/src/request_logs.rs index 125254c..fac2856 100644 --- a/src/request_logs.rs +++ b/src/request_logs.rs @@ -3,7 +3,7 @@ use std::path::Path; use anyhow::Result; use duckdb::arrow::ipc::reader::StreamReader; -use duckdb::vtab::arrow::{ArrowVTab, arrow_recordbatch_to_query_params}; +use duckdb::vtab::arrow::{ArrowBatchRegistration, ArrowVTab}; use crate::auth::{resolve_api_base_url, resolve_api_key}; use crate::utils::{api_post, input_err, open_db, parse_string_list, resolve_relative_datetime}; @@ -126,7 +126,7 @@ pub fn run( .join(", "); let insert_sql = format!( "INSERT INTO request_logs_staging (app_id, {col_list}) \ - SELECT {app_id}, {col_list} FROM arrow(?, ?)" + SELECT {app_id}, {col_list} FROM arrow(?)" ); let mut total = 0usize; @@ -139,8 +139,8 @@ pub fn run( for batch in reader { let batch = batch?; total += batch.num_rows(); - let params = arrow_recordbatch_to_query_params(batch); - conn.execute(&insert_sql, params)?; + let registration = ArrowBatchRegistration::new(batch); + conn.execute(&insert_sql, [®istration])?; eprint!( "\r{total} request logs written to table 'request_logs' in {}...", db_path.display() diff --git a/src/traces.rs b/src/traces.rs index 9358925..415e3f9 100644 --- a/src/traces.rs +++ b/src/traces.rs @@ -3,7 +3,7 @@ use std::path::Path; use anyhow::Result; use duckdb::arrow::ipc::reader::StreamReader; -use duckdb::vtab::arrow::{ArrowVTab, arrow_recordbatch_to_query_params}; +use duckdb::vtab::arrow::{ArrowBatchRegistration, ArrowVTab}; use crate::auth::{resolve_api_base_url, resolve_api_key}; use crate::utils::{api_post, input_err, open_db, parse_string_list, resolve_relative_datetime}; @@ -81,7 +81,7 @@ pub fn run( .join(", "); let insert_sql = format!( "INSERT INTO spans_staging (app_id, {col_list}) \ - SELECT {app_id}, {col_list} FROM arrow(?, ?)" + SELECT {app_id}, {col_list} FROM arrow(?)" ); let mut total = 0usize; @@ -93,8 +93,8 @@ pub fn run( for batch in reader { let batch = batch?; total += batch.num_rows(); - let params = arrow_recordbatch_to_query_params(batch); - conn.execute(&insert_sql, params)?; + let registration = ArrowBatchRegistration::new(batch); + conn.execute(&insert_sql, [®istration])?; eprint!( "\r{total} spans written to table 'spans' in {}...", db_path.display()