@@ -41,7 +41,9 @@ limitations under the License.
4141//!
4242//! // Setup a benchmark run
4343//! let run_id = Uuid::new_v4();
44- //! let setup_response = client.setup(run_id, HashMap::new(), HashMap::new()).await?;
44+ //! let setup_response = client
45+ //! .setup(run_id, HashMap::new(), HashMap::new(), None)
46+ //! .await?;
4547//!
4648//! println!("Driver: {:?}", setup_response.driver);
4749//!
@@ -57,7 +59,7 @@ limitations under the License.
5759//! # #[cfg(feature = "server")]
5860//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
5961//! use system_adapter_protocol::{
60- //! AdbcDriver, DatasetConfig, Handler, Server, SetupResponse, TeardownResponse,
62+ //! AdbcDriver, DatasetConfig, EtlSinkType, Handler, Server, SetupResponse, TeardownResponse,
6163//! };
6264//! use async_trait::async_trait;
6365//! use std::collections::HashMap;
@@ -72,11 +74,13 @@ limitations under the License.
7274//! run_id: Uuid,
7375//! metadata: HashMap<String, serde_json::Value>,
7476//! datasets: HashMap<String, DatasetConfig>,
77+ //! etl_sink_type: Option<EtlSinkType>,
7578//! ) -> Result<SetupResponse, String> {
76- //! let _ = (metadata, datasets);
79+ //! let _ = (metadata, datasets, etl_sink_type );
7780//! Ok(SetupResponse {
7881//! driver: AdbcDriver::Flightsql,
7982//! db_kwargs: HashMap::new(),
83+ //! catalog_namespace: None,
8084//! })
8185//! }
8286//!
@@ -121,6 +125,17 @@ pub enum AdbcDriver {
121125 Postgresql ,
122126}
123127
128+ /// ETL sink type used by spicebench for this run.
129+ ///
130+ /// This is provided to adapters in [`SetupRequest`] so they can optionally
131+ /// adjust setup behavior based on how data is loaded.
132+ #[ derive( Debug , Clone , Copy , Serialize , Deserialize , PartialEq , Eq ) ]
133+ #[ serde( rename_all = "snake_case" ) ]
134+ pub enum EtlSinkType {
135+ Hive ,
136+ Adbc ,
137+ }
138+
124139impl std:: fmt:: Display for AdbcDriver {
125140 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
126141 match self {
@@ -160,6 +175,9 @@ pub struct SetupRequest {
160175 pub metadata : HashMap < String , serde_json:: Value > ,
161176 /// Map of dataset name to dataset definition
162177 pub datasets : HashMap < String , DatasetConfig > ,
178+ /// Optional ETL sink type selected by spicebench.
179+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
180+ pub etl_sink_type : Option < EtlSinkType > ,
163181}
164182
165183/// Response from setup request containing ADBC connection information
@@ -169,6 +187,10 @@ pub struct SetupResponse {
169187 pub driver : AdbcDriver ,
170188 /// Driver-specific connection parameters
171189 pub db_kwargs : HashMap < String , serde_json:: Value > ,
190+ /// Optional catalog/namespace path where benchmark tables were created
191+ /// (e.g. "catalog.schema").
192+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
193+ pub catalog_namespace : Option < String > ,
172194}
173195/// Request to teardown a benchmark run
174196///
0 commit comments