forked from sql-machine-learning/sqlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlflow.proto
60 lines (53 loc) · 1.64 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
54
55
56
57
58
59
60
syntax = "proto3";
import "google/protobuf/any.proto";
package proto;
service SQLFlow {
// Run executes a sql statement
//
// SQL statements like `SELECT ...`, `DESCRIBE ...` returns a rowset.
// The rowset might be big. In such cases, Query returns a stream
// of RunResponse
//
// SQL statements like `USE database`, `DELETE` returns only a success
// message.
//
// SQL statement like `SELECT ... TRAIN/PREDICT ...` returns a stream of
// messages which indicates the training/predicting progress
rpc Run (Request) returns (stream Response);
}
// SQL statements to run
// e.g.
// 1. `SELECT ...`
// 2. `USE ...`, `DELETE ...`
// 3. `SELECT ... TRAIN/PREDICT ...`
message Request {
string sql = 1; // The SQL statement to be executed.
}
message Response {
oneof response {
Head head = 1;
Row row = 2;
Message message = 3;
}
}
// SQL statements like `SELECT ...`, `DESCRIBE ...` returns a Head
// and a sequence of Rows
message Head {
repeated string column_names = 1;
}
message Row {
// Null is a special marker used in Structured Query Language to indicate
// that a data value does not exist in the database.
// We encoded this marker as message Null, and it is one possible type of
// google.protobuf.Any in the field data
message Null {}
repeated google.protobuf.Any data = 1;
}
// SQL statements like `USE database`, `DELETE` returns only a success
// message.
//
// SQL statement like `SELECT ... TRAIN/PREDICT ...` returns a stream of
// messages which indicates the training/predicting progress
message Message {
string message = 1;
}