-
Notifications
You must be signed in to change notification settings - Fork 2
/
sqlflow.proto
53 lines (45 loc) · 1.33 KB
/
sqlflow.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
syntax = "proto3";
import "google/protobuf/any.proto";
package sqlflowserver;
service SQLFlow {
// Run runs a SQL statement and returns a stream of RunResponse.
rpc Run (RunRequest) returns (stream RunResponse);
}
// SQL statements to be executed
// e.g.
// 1. `USE database`
// 2. `SELECT ...`
// 3. `SELECT ... TRAIN/PREDICT ...`
message RunRequest {
string sql = 1; // The SQL statement to be executed.
}
// SQL statements like `USE database` returns only a success message.
// In such cases, the return stream contains only one RunResponse with
// RunResponse.messages set.
//
// SQL statements like `SELECT ...` returns a table in addition
// to the status, and the table might be big. In such cases, Run returns a
// stream of RunResponse
//
// SQL statement like `SELECT ... TRAIN/PREDICT ...` returns a stream of messages
// which indicates the training/predicting progress
//
// Each RunResponse doesn't exceed the maximum message size
// (https://stackoverflow.com/a/34186672/724872).
message RunResponse {
oneof response {
Messages messages = 1;
Table table = 2;
}
}
message Messages {
repeated string messages = 1;
}
message Table {
repeated string column_names = 1;
repeated Row rows = 2;
// A row of data. Data can be any type
message Row {
repeated google.protobuf.Any data = 1;
}
}