Skip to content

Commit 6917f70

Browse files
Lots of cleanup
1 parent 83aae52 commit 6917f70

6 files changed

Lines changed: 116 additions & 320 deletions

File tree

crates/datafusion-app/src/local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl ExecutionContext {
200200
}
201201
}
202202

203-
/// Executes the provided `LogicalPlan` returning a `SendableRecordBatchStream`. Uses the [`DedicatedExecutor`] if it is available.
203+
/// Executes the provided `LogicalPlan` returning a `SendableRecordBatchStream`. Uses the [`DedicatedExecutor`] if it is available. Useful on server implementations when planning and execution are done in separate steps and you may be storing the logical with something like a request_id.
204204
pub async fn execute_logical_plan(
205205
&self,
206206
logical_plan: LogicalPlan,

crates/datafusion-app/src/observability/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ impl ObservabilityContext {
8888
let values = Values {
8989
schema,
9090
values: vec![vec![
91+
lit(ScalarValue::Utf8(req.request_id)),
9192
lit(req.path),
92-
lit(req.sql),
93+
lit(ScalarValue::Utf8(req.sql)),
9394
cast(
9495
lit(req.start_ms),
9596
DataType::Timestamp(TimeUnit::Millisecond, Some("UTC".into())),
@@ -125,8 +126,9 @@ impl ObservabilityContext {
125126

126127
/// Details that will be recorded in the configured observability request table
127128
pub struct ObservabilityRequestDetails {
129+
pub request_id: Option<String>,
128130
pub path: String,
129-
pub sql: String,
131+
pub sql: Option<String>,
130132
pub start_ms: i64,
131133
pub duration_ms: i64,
132134
pub rows: Option<u64>,
@@ -135,8 +137,9 @@ pub struct ObservabilityRequestDetails {
135137

136138
fn req_fields() -> Vec<Field> {
137139
vec![
140+
Field::new("request_id", DataType::Utf8, true),
138141
Field::new("path", DataType::Utf8, false),
139-
Field::new("sql", DataType::Utf8, false),
142+
Field::new("sql", DataType::Utf8, true),
140143
Field::new(
141144
"timestamp",
142145
DataType::Timestamp(TimeUnit::Millisecond, Some("UTC".into())),
@@ -187,8 +190,9 @@ mod test {
187190

188191
let ctx = execution.session_ctx();
189192
let req = ObservabilityRequestDetails {
193+
request_id: None,
190194
path: "/sql".to_string(),
191-
sql: "SELECT 1".to_string(),
195+
sql: Some("SELECT 1".to_string()),
192196
start_ms: 100,
193197
duration_ms: 200,
194198
rows: 1,

src/flightsql_server/services/flightsql.rs

Lines changed: 0 additions & 224 deletions
This file was deleted.

src/flightsql_server/services/mod.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)