@@ -98,6 +98,7 @@ pub struct HandlerContext<'a, Q> {
98
98
forwarder : Option < ForwarderRef > ,
99
99
timeout : Option < Duration > ,
100
100
resp_compress_min_length : usize ,
101
+ auto_create_table : bool ,
101
102
}
102
103
103
104
impl < ' a , Q > HandlerContext < ' a , Q > {
@@ -110,6 +111,7 @@ impl<'a, Q> HandlerContext<'a, Q> {
110
111
forwarder : Option < ForwarderRef > ,
111
112
timeout : Option < Duration > ,
112
113
resp_compress_min_length : usize ,
114
+ auto_create_table : bool ,
113
115
) -> Self {
114
116
// catalog is not exposed to protocol layer
115
117
let catalog = instance. catalog_manager . default_catalog_name ( ) . to_string ( ) ;
@@ -123,6 +125,7 @@ impl<'a, Q> HandlerContext<'a, Q> {
123
125
forwarder,
124
126
timeout,
125
127
resp_compress_min_length,
128
+ auto_create_table,
126
129
}
127
130
}
128
131
@@ -141,6 +144,7 @@ pub struct StorageServiceImpl<Q: QueryExecutor + 'static> {
141
144
pub forwarder : Option < ForwarderRef > ,
142
145
pub timeout : Option < Duration > ,
143
146
pub resp_compress_min_length : usize ,
147
+ pub auto_create_table : bool ,
144
148
}
145
149
146
150
macro_rules! handle_request {
@@ -158,6 +162,7 @@ macro_rules! handle_request {
158
162
let forwarder = self . forwarder. clone( ) ;
159
163
let timeout = self . timeout;
160
164
let resp_compress_min_length = self . resp_compress_min_length;
165
+ let auto_create_table = self . auto_create_table;
161
166
162
167
// The future spawned by tokio cannot be executed by other executor/runtime, so
163
168
@@ -179,7 +184,7 @@ macro_rules! handle_request {
179
184
. fail( ) ?
180
185
}
181
186
let handler_ctx =
182
- HandlerContext :: new( header, router, instance, & schema_config_provider, forwarder, timeout, resp_compress_min_length) ;
187
+ HandlerContext :: new( header, router, instance, & schema_config_provider, forwarder, timeout, resp_compress_min_length, auto_create_table ) ;
183
188
$mod_name:: $handle_fn( & handler_ctx, req)
184
189
. await
185
190
. map_err( |e| {
@@ -254,6 +259,7 @@ impl<Q: QueryExecutor + 'static> StorageServiceImpl<Q> {
254
259
self . forwarder . clone ( ) ,
255
260
self . timeout ,
256
261
self . resp_compress_min_length ,
262
+ self . auto_create_table ,
257
263
) ;
258
264
259
265
let mut total_success = 0 ;
@@ -310,6 +316,7 @@ impl<Q: QueryExecutor + 'static> StorageServiceImpl<Q> {
310
316
let forwarder = self . forwarder . clone ( ) ;
311
317
let timeout = self . timeout ;
312
318
let resp_compress_min_length = self . resp_compress_min_length ;
319
+ let auto_create_table = self . auto_create_table ;
313
320
314
321
let ( tx, rx) = mpsc:: channel ( STREAM_QUERY_CHANNEL_LEN ) ;
315
322
self . runtimes . read_runtime . spawn ( async move {
@@ -321,6 +328,7 @@ impl<Q: QueryExecutor + 'static> StorageServiceImpl<Q> {
321
328
forwarder,
322
329
timeout,
323
330
resp_compress_min_length,
331
+ auto_create_table
324
332
) ;
325
333
let query_req = request. into_inner ( ) ;
326
334
let output = sql_query:: fetch_query_output ( & handler_ctx, & query_req)
0 commit comments