From 535865a3dc6da7cec83eed308ce4c4af1b835b7a Mon Sep 17 00:00:00 2001 From: Austin Barrington Date: Sat, 17 Oct 2026 13:53:27 +0100 Subject: [PATCH] Gate the fallback stream counter on not(direct_arrow_insert) With an engine that inserts Arrow arrays directly (libchdb 26.9.0), FALLBACK_STREAM_SEQ and its Ordering import were unused, and a build with RUSTFLAGS=-D warnings failed on them. hyperbytedb's CI builds this crate that way against the latest engine, so its Clippy job failed. --- src/arrow_insert.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/arrow_insert.rs b/src/arrow_insert.rs index bf277c9..8d4fdd4 100644 --- a/src/arrow_insert.rs +++ b/src/arrow_insert.rs @@ -4,6 +4,7 @@ //! [`Connection::register_arrow_array`](crate::connection::Connection::register_arrow_array), //! and `INSERT INTO … SELECT * FROM ArrowStream('name')`. +#[cfg(not(direct_arrow_insert))] use std::sync::atomic::{AtomicU64, Ordering}; use arrow::array::RecordBatchReader; @@ -18,6 +19,10 @@ use crate::connection::Connection; use crate::error::Result; use crate::format::OutputFormat; +/// Names the registered stream when the engine cannot insert an Arrow array +/// directly. Built only then: with `direct_arrow_insert` it was unused, and a +/// `-D warnings` build against such an engine failed. +#[cfg(not(direct_arrow_insert))] static FALLBACK_STREAM_SEQ: AtomicU64 = AtomicU64::new(0); /// Owns Arrow C Data Interface structs for the lifetime of a registration or insert.