Skip to content

Commit 5b58dc5

Browse files
Iterate
1 parent ea34ba4 commit 5b58dc5

8 files changed

Lines changed: 755 additions & 476 deletions

File tree

crates/datafusion-app/src/flightsql.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -530,29 +530,19 @@ impl FlightSQLContext {
530530
result_messages.push(result);
531531
}
532532

533-
// 4. Decode each Result message to FlightData and extract query from metadata
533+
// 4. Decode each Result message to FlightData
534534
let mut all_flight_data = Vec::new();
535-
let mut sql_query = None;
536535

537536
for result in result_messages {
538537
// Deserialize the FlightData from the Result.body bytes using prost
539538
let flight_data = <FlightData as prost::Message>::decode(result.body.as_ref())
540539
.map_err(|e| eyre::eyre!("Failed to decode FlightData: {}", e))?;
541540

542-
// Extract SQL from schema message (first message) metadata
543-
if sql_query.is_none() && !flight_data.app_metadata.is_empty() {
544-
sql_query = Some(
545-
String::from_utf8(flight_data.app_metadata.to_vec())
546-
.map_err(|e| eyre::eyre!("Invalid UTF-8 in metadata: {}", e))?,
547-
);
548-
}
549-
550541
all_flight_data.push(flight_data);
551542
}
552543

553-
// 5. Validate we got the SQL query in metadata
554-
let query_str =
555-
sql_query.ok_or_else(|| eyre::eyre!("SQL query not found in response metadata"))?;
544+
// 5. Use the original query (client retains it, server doesn't send it back)
545+
let query_str = query.to_string();
556546

557547
// 6. Decode metrics batch
558548
// batches_to_flight_data creates [schema, data] for the batch

0 commit comments

Comments
 (0)