|
1 | 1 | use cubesql::compile::parser::parse_sql_to_statement; |
2 | 2 | use cubesql::compile::{convert_statement_to_cube_query, get_df_batches}; |
3 | 3 | use cubesql::config::processing_loop::ShutdownMode; |
4 | | -use cubesql::transport::{SpanId, TransportService}; |
5 | | -use cubesql::sql::dataframe::{Column, arrow_to_column_type}; |
| 4 | +use cubesql::sql::dataframe::{arrow_to_column_type, Column}; |
6 | 5 | use cubesql::sql::ColumnFlags; |
| 6 | +use cubesql::transport::{SpanId, TransportService}; |
7 | 7 | use futures::StreamExt; |
8 | 8 |
|
9 | 9 | use serde_json::Map; |
@@ -201,7 +201,7 @@ async fn write_jsonl_message( |
201 | 201 | value: serde_json::Value, |
202 | 202 | ) -> Result<bool, CubeError> { |
203 | 203 | let message = format!("{}{}", serde_json::to_string(&value)?, CHUNK_DELIM); |
204 | | - |
| 204 | + |
205 | 205 | call_js_fn( |
206 | 206 | channel, |
207 | 207 | write_fn, |
@@ -300,12 +300,12 @@ async fn handle_sql_query( |
300 | 300 | ColumnFlags::empty(), |
301 | 301 | )); |
302 | 302 | } |
303 | | - |
| 303 | + |
304 | 304 | // Send schema first |
305 | 305 | let columns_json = serde_json::to_value(&columns)?; |
306 | 306 | let mut schema_response = Map::new(); |
307 | 307 | schema_response.insert("schema".into(), columns_json); |
308 | | - |
| 308 | + |
309 | 309 | write_jsonl_message( |
310 | 310 | channel.clone(), |
311 | 311 | stream_methods.write.clone(), |
@@ -341,7 +341,7 @@ async fn handle_sql_query( |
341 | 341 | if !has_data { |
342 | 342 | let mut rows = Map::new(); |
343 | 343 | rows.insert("data".into(), serde_json::Value::Array(vec![])); |
344 | | - |
| 344 | + |
345 | 345 | write_jsonl_message( |
346 | 346 | channel.clone(), |
347 | 347 | stream_methods.write.clone(), |
|
0 commit comments