-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstatement_schema.go
60 lines (48 loc) · 1.67 KB
/
statement_schema.go
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
package livy
const (
CodeSpark CodeKind = "spark"
CodePySpark CodeKind = "pyspark"
CodeSparkR CodeKind = "sparkr"
CodeSQL CodeKind = "sql"
StatementWaiting StatementState = "waiting"
StatementRunning StatementState = "running"
StatementAvailable StatementState = "available"
StatementError StatementState = "error"
StatementCancelling StatementState = "cancelling"
StatementCancelled StatementState = "cancelled"
StatementOutputOK StatementOutputStatus = "ok"
StatementOutputError StatementOutputStatus = "error"
)
type CodeKind string
type StatementState string
type StatementOutputStatus string
// A statement represents the result of an execution statement.
type Statement struct {
ID int `json:"id"`
Code string `json:"code"`
State StatementState `json:"state"`
Output StatementOutput `json:"output"`
}
type StatementOutput struct {
Status StatementOutputStatus `json:"status"`
ExecutionCount int `json:"execution_count"`
Data map[string]string `json:"data"`
Ename string `json:"ename"`
Evalue string `json:"evalue"`
Traceback []string `json:"traceback"`
}
type GetSessionStatements struct {
Statements []Statement `json:"statements"`
}
type PostStatementRequest struct {
Code string `json:"code,omitempty"`
Kind CodeKind `json:"kind,omitempty"`
}
type PostStatementCompletionRequest struct {
Code string `json:"code,omitempty"`
Kind CodeKind `json:"kind,omitempty"`
Cursor string `json:"cursor,omitempty"`
}
type PostStatementCompletionResponse struct {
Candidates []string `json:"candidates"`
}