You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Important**: The SQL query must contain exactly one SQL statement. Multiple statements (e.g., separated by semicolons) are not supported and will result in an error.
42
+
The request body should be a JSON object with the following structure:
43
+
44
+
```json
45
+
{
46
+
"sql": "SELECT * FROM table WHERE id > 100"
47
+
}
48
+
```
49
+
50
+
**Current Fields**:
51
+
-`sql` (string, required): The SQL query to analyze. Must contain exactly one SQL statement. Multiple statements (e.g., separated by semicolons) are not supported and will result in an error.
52
+
53
+
**Future Extensibility**:
54
+
The protocol is designed to be extensible. Future versions may support additional query representation fields:
55
+
-`substrait` (bytes): Substrait query plan (binary or JSON)
56
+
-`logical_plan` (string): Serialized logical plan
57
+
-`physical_plan` (string): Serialized physical plan
58
+
59
+
Servers should ignore unknown fields and clients should only send one query representation field at a time.
43
60
44
61
**Example**:
45
62
```rust
63
+
useserde_json::json;
64
+
65
+
letrequest_body=json!({
66
+
"sql":"SELECT * FROM table WHERE id > 100"
67
+
});
68
+
46
69
Action {
47
70
r#type:"analyze_query".to_string(),
48
-
body:"SELECT * FROM table WHERE id > 100".as_bytes().to_vec().into()
71
+
body:serde_json::to_vec(&request_body)?.into()
49
72
}
50
73
```
51
74
52
-
**Request Encoding**: The SQL query string should be encoded as UTF-8 bytes in the `Action.body` field.
75
+
**Request Encoding**: The JSON object should be serialized to UTF-8 bytes in the `Action.body` field.
53
76
54
77
### Response Format
55
78
@@ -306,29 +329,46 @@ To implement this protocol in an Arrow Flight service:
0 commit comments