activerecord-hive-adapter 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/README.md +3 -0
- data/Rakefile +2 -0
- data/activerecord-hive-adapter.gemspec +24 -0
- data/lib/active_record/connection_adapters/hive_adapter.rb +252 -0
- data/lib/activerecord-hive-adapter.rb +8 -0
- data/lib/activerecord_hive_adapter/hive_connector.rb +49 -0
- data/lib/activerecord_hive_adapter/version.rb +3 -0
- data/vendor/thrift_hive/gen-rb/facebook_service.rb +700 -0
- data/vendor/thrift_hive/gen-rb/fb303_constants.rb +8 -0
- data/vendor/thrift_hive/gen-rb/fb303_types.rb +18 -0
- data/vendor/thrift_hive/gen-rb/hive_metastore_constants.rb +40 -0
- data/vendor/thrift_hive/gen-rb/hive_metastore_types.rb +629 -0
- data/vendor/thrift_hive/gen-rb/hive_service_constants.rb +8 -0
- data/vendor/thrift_hive/gen-rb/hive_service_types.rb +67 -0
- data/vendor/thrift_hive/gen-rb/queryplan_constants.rb +8 -0
- data/vendor/thrift_hive/gen-rb/queryplan_types.rb +256 -0
- data/vendor/thrift_hive/gen-rb/serde_constants.rb +92 -0
- data/vendor/thrift_hive/gen-rb/serde_types.rb +7 -0
- data/vendor/thrift_hive/gen-rb/thrift_hive.rb +504 -0
- data/vendor/thrift_hive/gen-rb/thrift_hive_metastore.rb +3856 -0
- metadata +94 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'fb303_types'
|
8
|
+
require 'hive_metastore_types'
|
9
|
+
require 'queryplan_types'
|
10
|
+
|
11
|
+
|
12
|
+
module JobTrackerState
|
13
|
+
INITIALIZING = 1
|
14
|
+
RUNNING = 2
|
15
|
+
VALUE_MAP = {1 => "INITIALIZING", 2 => "RUNNING"}
|
16
|
+
VALID_VALUES = Set.new([INITIALIZING, RUNNING]).freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
class HiveClusterStatus
|
20
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
21
|
+
TASKTRACKERS = 1
|
22
|
+
MAPTASKS = 2
|
23
|
+
REDUCETASKS = 3
|
24
|
+
MAXMAPTASKS = 4
|
25
|
+
MAXREDUCETASKS = 5
|
26
|
+
STATE = 6
|
27
|
+
|
28
|
+
FIELDS = {
|
29
|
+
TASKTRACKERS => {:type => ::Thrift::Types::I32, :name => 'taskTrackers'},
|
30
|
+
MAPTASKS => {:type => ::Thrift::Types::I32, :name => 'mapTasks'},
|
31
|
+
REDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'reduceTasks'},
|
32
|
+
MAXMAPTASKS => {:type => ::Thrift::Types::I32, :name => 'maxMapTasks'},
|
33
|
+
MAXREDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'maxReduceTasks'},
|
34
|
+
STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => JobTrackerState}
|
35
|
+
}
|
36
|
+
|
37
|
+
def struct_fields; FIELDS; end
|
38
|
+
|
39
|
+
def validate
|
40
|
+
unless @state.nil? || JobTrackerState::VALID_VALUES.include?(@state)
|
41
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
::Thrift::Struct.generate_accessors self
|
46
|
+
end
|
47
|
+
|
48
|
+
class HiveServerException < ::Thrift::Exception
|
49
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
50
|
+
MESSAGE = 1
|
51
|
+
ERRORCODE = 2
|
52
|
+
SQLSTATE = 3
|
53
|
+
|
54
|
+
FIELDS = {
|
55
|
+
MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'},
|
56
|
+
ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode'},
|
57
|
+
SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'SQLState'}
|
58
|
+
}
|
59
|
+
|
60
|
+
def struct_fields; FIELDS; end
|
61
|
+
|
62
|
+
def validate
|
63
|
+
end
|
64
|
+
|
65
|
+
::Thrift::Struct.generate_accessors self
|
66
|
+
end
|
67
|
+
|
@@ -0,0 +1,256 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
|
8
|
+
module AdjacencyType
|
9
|
+
CONJUNCTIVE = 0
|
10
|
+
DISJUNCTIVE = 1
|
11
|
+
VALUE_MAP = {0 => "CONJUNCTIVE", 1 => "DISJUNCTIVE"}
|
12
|
+
VALID_VALUES = Set.new([CONJUNCTIVE, DISJUNCTIVE]).freeze
|
13
|
+
end
|
14
|
+
|
15
|
+
module NodeType
|
16
|
+
OPERATOR = 0
|
17
|
+
STAGE = 1
|
18
|
+
VALUE_MAP = {0 => "OPERATOR", 1 => "STAGE"}
|
19
|
+
VALID_VALUES = Set.new([OPERATOR, STAGE]).freeze
|
20
|
+
end
|
21
|
+
|
22
|
+
module OperatorType
|
23
|
+
JOIN = 0
|
24
|
+
MAPJOIN = 1
|
25
|
+
EXTRACT = 2
|
26
|
+
FILTER = 3
|
27
|
+
FORWARD = 4
|
28
|
+
GROUPBY = 5
|
29
|
+
LIMIT = 6
|
30
|
+
SCRIPT = 7
|
31
|
+
SELECT = 8
|
32
|
+
TABLESCAN = 9
|
33
|
+
FILESINK = 10
|
34
|
+
REDUCESINK = 11
|
35
|
+
UNION = 12
|
36
|
+
UDTF = 13
|
37
|
+
LATERALVIEWJOIN = 14
|
38
|
+
LATERALVIEWFORWARD = 15
|
39
|
+
HASHTABLESINK = 16
|
40
|
+
HASHTABLEDUMMY = 17
|
41
|
+
VALUE_MAP = {0 => "JOIN", 1 => "MAPJOIN", 2 => "EXTRACT", 3 => "FILTER", 4 => "FORWARD", 5 => "GROUPBY", 6 => "LIMIT", 7 => "SCRIPT", 8 => "SELECT", 9 => "TABLESCAN", 10 => "FILESINK", 11 => "REDUCESINK", 12 => "UNION", 13 => "UDTF", 14 => "LATERALVIEWJOIN", 15 => "LATERALVIEWFORWARD", 16 => "HASHTABLESINK", 17 => "HASHTABLEDUMMY"}
|
42
|
+
VALID_VALUES = Set.new([JOIN, MAPJOIN, EXTRACT, FILTER, FORWARD, GROUPBY, LIMIT, SCRIPT, SELECT, TABLESCAN, FILESINK, REDUCESINK, UNION, UDTF, LATERALVIEWJOIN, LATERALVIEWFORWARD, HASHTABLESINK, HASHTABLEDUMMY]).freeze
|
43
|
+
end
|
44
|
+
|
45
|
+
module TaskType
|
46
|
+
MAP = 0
|
47
|
+
REDUCE = 1
|
48
|
+
OTHER = 2
|
49
|
+
VALUE_MAP = {0 => "MAP", 1 => "REDUCE", 2 => "OTHER"}
|
50
|
+
VALID_VALUES = Set.new([MAP, REDUCE, OTHER]).freeze
|
51
|
+
end
|
52
|
+
|
53
|
+
module StageType
|
54
|
+
CONDITIONAL = 0
|
55
|
+
COPY = 1
|
56
|
+
DDL = 2
|
57
|
+
MAPRED = 3
|
58
|
+
EXPLAIN = 4
|
59
|
+
FETCH = 5
|
60
|
+
FUNC = 6
|
61
|
+
MAPREDLOCAL = 7
|
62
|
+
MOVE = 8
|
63
|
+
STATS = 9
|
64
|
+
VALUE_MAP = {0 => "CONDITIONAL", 1 => "COPY", 2 => "DDL", 3 => "MAPRED", 4 => "EXPLAIN", 5 => "FETCH", 6 => "FUNC", 7 => "MAPREDLOCAL", 8 => "MOVE", 9 => "STATS"}
|
65
|
+
VALID_VALUES = Set.new([CONDITIONAL, COPY, DDL, MAPRED, EXPLAIN, FETCH, FUNC, MAPREDLOCAL, MOVE, STATS]).freeze
|
66
|
+
end
|
67
|
+
|
68
|
+
class Adjacency
|
69
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
70
|
+
NODE = 1
|
71
|
+
CHILDREN = 2
|
72
|
+
ADJACENCYTYPE = 3
|
73
|
+
|
74
|
+
FIELDS = {
|
75
|
+
NODE => {:type => ::Thrift::Types::STRING, :name => 'node'},
|
76
|
+
CHILDREN => {:type => ::Thrift::Types::LIST, :name => 'children', :element => {:type => ::Thrift::Types::STRING}},
|
77
|
+
ADJACENCYTYPE => {:type => ::Thrift::Types::I32, :name => 'adjacencyType', :enum_class => AdjacencyType}
|
78
|
+
}
|
79
|
+
|
80
|
+
def struct_fields; FIELDS; end
|
81
|
+
|
82
|
+
def validate
|
83
|
+
unless @adjacencyType.nil? || AdjacencyType::VALID_VALUES.include?(@adjacencyType)
|
84
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field adjacencyType!')
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
::Thrift::Struct.generate_accessors self
|
89
|
+
end
|
90
|
+
|
91
|
+
class Graph
|
92
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
93
|
+
NODETYPE = 1
|
94
|
+
ROOTS = 2
|
95
|
+
ADJACENCYLIST = 3
|
96
|
+
|
97
|
+
FIELDS = {
|
98
|
+
NODETYPE => {:type => ::Thrift::Types::I32, :name => 'nodeType', :enum_class => NodeType},
|
99
|
+
ROOTS => {:type => ::Thrift::Types::LIST, :name => 'roots', :element => {:type => ::Thrift::Types::STRING}},
|
100
|
+
ADJACENCYLIST => {:type => ::Thrift::Types::LIST, :name => 'adjacencyList', :element => {:type => ::Thrift::Types::STRUCT, :class => Adjacency}}
|
101
|
+
}
|
102
|
+
|
103
|
+
def struct_fields; FIELDS; end
|
104
|
+
|
105
|
+
def validate
|
106
|
+
unless @nodeType.nil? || NodeType::VALID_VALUES.include?(@nodeType)
|
107
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field nodeType!')
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
::Thrift::Struct.generate_accessors self
|
112
|
+
end
|
113
|
+
|
114
|
+
class Operator
|
115
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
116
|
+
OPERATORID = 1
|
117
|
+
OPERATORTYPE = 2
|
118
|
+
OPERATORATTRIBUTES = 3
|
119
|
+
OPERATORCOUNTERS = 4
|
120
|
+
DONE = 5
|
121
|
+
STARTED = 6
|
122
|
+
|
123
|
+
FIELDS = {
|
124
|
+
OPERATORID => {:type => ::Thrift::Types::STRING, :name => 'operatorId'},
|
125
|
+
OPERATORTYPE => {:type => ::Thrift::Types::I32, :name => 'operatorType', :enum_class => OperatorType},
|
126
|
+
OPERATORATTRIBUTES => {:type => ::Thrift::Types::MAP, :name => 'operatorAttributes', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
|
127
|
+
OPERATORCOUNTERS => {:type => ::Thrift::Types::MAP, :name => 'operatorCounters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}},
|
128
|
+
DONE => {:type => ::Thrift::Types::BOOL, :name => 'done'},
|
129
|
+
STARTED => {:type => ::Thrift::Types::BOOL, :name => 'started'}
|
130
|
+
}
|
131
|
+
|
132
|
+
def struct_fields; FIELDS; end
|
133
|
+
|
134
|
+
def validate
|
135
|
+
unless @operatorType.nil? || OperatorType::VALID_VALUES.include?(@operatorType)
|
136
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field operatorType!')
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
::Thrift::Struct.generate_accessors self
|
141
|
+
end
|
142
|
+
|
143
|
+
class Task
|
144
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
145
|
+
TASKID = 1
|
146
|
+
TASKTYPE = 2
|
147
|
+
TASKATTRIBUTES = 3
|
148
|
+
TASKCOUNTERS = 4
|
149
|
+
OPERATORGRAPH = 5
|
150
|
+
OPERATORLIST = 6
|
151
|
+
DONE = 7
|
152
|
+
STARTED = 8
|
153
|
+
|
154
|
+
FIELDS = {
|
155
|
+
TASKID => {:type => ::Thrift::Types::STRING, :name => 'taskId'},
|
156
|
+
TASKTYPE => {:type => ::Thrift::Types::I32, :name => 'taskType', :enum_class => TaskType},
|
157
|
+
TASKATTRIBUTES => {:type => ::Thrift::Types::MAP, :name => 'taskAttributes', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
|
158
|
+
TASKCOUNTERS => {:type => ::Thrift::Types::MAP, :name => 'taskCounters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}},
|
159
|
+
OPERATORGRAPH => {:type => ::Thrift::Types::STRUCT, :name => 'operatorGraph', :class => Graph, :optional => true},
|
160
|
+
OPERATORLIST => {:type => ::Thrift::Types::LIST, :name => 'operatorList', :element => {:type => ::Thrift::Types::STRUCT, :class => Operator}, :optional => true},
|
161
|
+
DONE => {:type => ::Thrift::Types::BOOL, :name => 'done'},
|
162
|
+
STARTED => {:type => ::Thrift::Types::BOOL, :name => 'started'}
|
163
|
+
}
|
164
|
+
|
165
|
+
def struct_fields; FIELDS; end
|
166
|
+
|
167
|
+
def validate
|
168
|
+
unless @taskType.nil? || TaskType::VALID_VALUES.include?(@taskType)
|
169
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field taskType!')
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
::Thrift::Struct.generate_accessors self
|
174
|
+
end
|
175
|
+
|
176
|
+
class Stage
|
177
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
178
|
+
STAGEID = 1
|
179
|
+
STAGETYPE = 2
|
180
|
+
STAGEATTRIBUTES = 3
|
181
|
+
STAGECOUNTERS = 4
|
182
|
+
TASKLIST = 5
|
183
|
+
DONE = 6
|
184
|
+
STARTED = 7
|
185
|
+
|
186
|
+
FIELDS = {
|
187
|
+
STAGEID => {:type => ::Thrift::Types::STRING, :name => 'stageId'},
|
188
|
+
STAGETYPE => {:type => ::Thrift::Types::I32, :name => 'stageType', :enum_class => StageType},
|
189
|
+
STAGEATTRIBUTES => {:type => ::Thrift::Types::MAP, :name => 'stageAttributes', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
|
190
|
+
STAGECOUNTERS => {:type => ::Thrift::Types::MAP, :name => 'stageCounters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}},
|
191
|
+
TASKLIST => {:type => ::Thrift::Types::LIST, :name => 'taskList', :element => {:type => ::Thrift::Types::STRUCT, :class => Task}},
|
192
|
+
DONE => {:type => ::Thrift::Types::BOOL, :name => 'done'},
|
193
|
+
STARTED => {:type => ::Thrift::Types::BOOL, :name => 'started'}
|
194
|
+
}
|
195
|
+
|
196
|
+
def struct_fields; FIELDS; end
|
197
|
+
|
198
|
+
def validate
|
199
|
+
unless @stageType.nil? || StageType::VALID_VALUES.include?(@stageType)
|
200
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field stageType!')
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
::Thrift::Struct.generate_accessors self
|
205
|
+
end
|
206
|
+
|
207
|
+
class Query
|
208
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
209
|
+
QUERYID = 1
|
210
|
+
QUERYTYPE = 2
|
211
|
+
QUERYATTRIBUTES = 3
|
212
|
+
QUERYCOUNTERS = 4
|
213
|
+
STAGEGRAPH = 5
|
214
|
+
STAGELIST = 6
|
215
|
+
DONE = 7
|
216
|
+
STARTED = 8
|
217
|
+
|
218
|
+
FIELDS = {
|
219
|
+
QUERYID => {:type => ::Thrift::Types::STRING, :name => 'queryId'},
|
220
|
+
QUERYTYPE => {:type => ::Thrift::Types::STRING, :name => 'queryType'},
|
221
|
+
QUERYATTRIBUTES => {:type => ::Thrift::Types::MAP, :name => 'queryAttributes', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
|
222
|
+
QUERYCOUNTERS => {:type => ::Thrift::Types::MAP, :name => 'queryCounters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}},
|
223
|
+
STAGEGRAPH => {:type => ::Thrift::Types::STRUCT, :name => 'stageGraph', :class => Graph},
|
224
|
+
STAGELIST => {:type => ::Thrift::Types::LIST, :name => 'stageList', :element => {:type => ::Thrift::Types::STRUCT, :class => Stage}},
|
225
|
+
DONE => {:type => ::Thrift::Types::BOOL, :name => 'done'},
|
226
|
+
STARTED => {:type => ::Thrift::Types::BOOL, :name => 'started'}
|
227
|
+
}
|
228
|
+
|
229
|
+
def struct_fields; FIELDS; end
|
230
|
+
|
231
|
+
def validate
|
232
|
+
end
|
233
|
+
|
234
|
+
::Thrift::Struct.generate_accessors self
|
235
|
+
end
|
236
|
+
|
237
|
+
class QueryPlan
|
238
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
239
|
+
QUERIES = 1
|
240
|
+
DONE = 2
|
241
|
+
STARTED = 3
|
242
|
+
|
243
|
+
FIELDS = {
|
244
|
+
QUERIES => {:type => ::Thrift::Types::LIST, :name => 'queries', :element => {:type => ::Thrift::Types::STRUCT, :class => Query}},
|
245
|
+
DONE => {:type => ::Thrift::Types::BOOL, :name => 'done'},
|
246
|
+
STARTED => {:type => ::Thrift::Types::BOOL, :name => 'started'}
|
247
|
+
}
|
248
|
+
|
249
|
+
def struct_fields; FIELDS; end
|
250
|
+
|
251
|
+
def validate
|
252
|
+
end
|
253
|
+
|
254
|
+
::Thrift::Struct.generate_accessors self
|
255
|
+
end
|
256
|
+
|
@@ -0,0 +1,92 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'serde_types'
|
8
|
+
|
9
|
+
SERIALIZATION_LIB = %q"serialization.lib"
|
10
|
+
|
11
|
+
SERIALIZATION_CLASS = %q"serialization.class"
|
12
|
+
|
13
|
+
SERIALIZATION_FORMAT = %q"serialization.format"
|
14
|
+
|
15
|
+
SERIALIZATION_DDL = %q"serialization.ddl"
|
16
|
+
|
17
|
+
SERIALIZATION_NULL_FORMAT = %q"serialization.null.format"
|
18
|
+
|
19
|
+
SERIALIZATION_LAST_COLUMN_TAKES_REST = %q"serialization.last.column.takes.rest"
|
20
|
+
|
21
|
+
SERIALIZATION_SORT_ORDER = %q"serialization.sort.order"
|
22
|
+
|
23
|
+
SERIALIZATION_USE_JSON_OBJECTS = %q"serialization.use.json.object"
|
24
|
+
|
25
|
+
FIELD_DELIM = %q"field.delim"
|
26
|
+
|
27
|
+
COLLECTION_DELIM = %q"colelction.delim"
|
28
|
+
|
29
|
+
LINE_DELIM = %q"line.delim"
|
30
|
+
|
31
|
+
MAPKEY_DELIM = %q"mapkey.delim"
|
32
|
+
|
33
|
+
QUOTE_CHAR = %q"quote.delim"
|
34
|
+
|
35
|
+
ESCAPE_CHAR = %q"escape.delim"
|
36
|
+
|
37
|
+
VOID_TYPE_NAME = %q"void"
|
38
|
+
|
39
|
+
BOOLEAN_TYPE_NAME = %q"boolean"
|
40
|
+
|
41
|
+
TINYINT_TYPE_NAME = %q"tinyint"
|
42
|
+
|
43
|
+
SMALLINT_TYPE_NAME = %q"smallint"
|
44
|
+
|
45
|
+
INT_TYPE_NAME = %q"int"
|
46
|
+
|
47
|
+
BIGINT_TYPE_NAME = %q"bigint"
|
48
|
+
|
49
|
+
FLOAT_TYPE_NAME = %q"float"
|
50
|
+
|
51
|
+
DOUBLE_TYPE_NAME = %q"double"
|
52
|
+
|
53
|
+
STRING_TYPE_NAME = %q"string"
|
54
|
+
|
55
|
+
DATE_TYPE_NAME = %q"date"
|
56
|
+
|
57
|
+
DATETIME_TYPE_NAME = %q"datetime"
|
58
|
+
|
59
|
+
TIMESTAMP_TYPE_NAME = %q"timestamp"
|
60
|
+
|
61
|
+
LIST_TYPE_NAME = %q"array"
|
62
|
+
|
63
|
+
MAP_TYPE_NAME = %q"map"
|
64
|
+
|
65
|
+
STRUCT_TYPE_NAME = %q"struct"
|
66
|
+
|
67
|
+
UNION_TYPE_NAME = %q"uniontype"
|
68
|
+
|
69
|
+
LIST_COLUMNS = %q"columns"
|
70
|
+
|
71
|
+
LIST_COLUMN_TYPES = %q"columns.types"
|
72
|
+
|
73
|
+
PrimitiveTypes = Set.new([
|
74
|
+
%q"void",
|
75
|
+
%q"boolean",
|
76
|
+
%q"tinyint",
|
77
|
+
%q"smallint",
|
78
|
+
%q"int",
|
79
|
+
%q"bigint",
|
80
|
+
%q"float",
|
81
|
+
%q"double",
|
82
|
+
%q"string",
|
83
|
+
%q"date",
|
84
|
+
%q"datetime",
|
85
|
+
%q"timestamp",
|
86
|
+
])
|
87
|
+
|
88
|
+
CollectionTypes = Set.new([
|
89
|
+
%q"array",
|
90
|
+
%q"map",
|
91
|
+
])
|
92
|
+
|
@@ -0,0 +1,504 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
require 'thrift_hive_metastore'
|
9
|
+
require 'hive_service_types'
|
10
|
+
|
11
|
+
module ThriftHive
|
12
|
+
class Client < ThriftHiveMetastore::Client
|
13
|
+
include ::Thrift::Client
|
14
|
+
|
15
|
+
def execute(query)
|
16
|
+
send_execute(query)
|
17
|
+
recv_execute()
|
18
|
+
end
|
19
|
+
|
20
|
+
def send_execute(query)
|
21
|
+
send_message('execute', Execute_args, :query => query)
|
22
|
+
end
|
23
|
+
|
24
|
+
def recv_execute()
|
25
|
+
result = receive_message(Execute_result)
|
26
|
+
raise result.ex unless result.ex.nil?
|
27
|
+
return
|
28
|
+
end
|
29
|
+
|
30
|
+
def fetchOne()
|
31
|
+
send_fetchOne()
|
32
|
+
return recv_fetchOne()
|
33
|
+
end
|
34
|
+
|
35
|
+
def send_fetchOne()
|
36
|
+
send_message('fetchOne', FetchOne_args)
|
37
|
+
end
|
38
|
+
|
39
|
+
def recv_fetchOne()
|
40
|
+
result = receive_message(FetchOne_result)
|
41
|
+
return result.success unless result.success.nil?
|
42
|
+
raise result.ex unless result.ex.nil?
|
43
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetchOne failed: unknown result')
|
44
|
+
end
|
45
|
+
|
46
|
+
def fetchN(numRows)
|
47
|
+
send_fetchN(numRows)
|
48
|
+
return recv_fetchN()
|
49
|
+
end
|
50
|
+
|
51
|
+
def send_fetchN(numRows)
|
52
|
+
send_message('fetchN', FetchN_args, :numRows => numRows)
|
53
|
+
end
|
54
|
+
|
55
|
+
def recv_fetchN()
|
56
|
+
result = receive_message(FetchN_result)
|
57
|
+
return result.success unless result.success.nil?
|
58
|
+
raise result.ex unless result.ex.nil?
|
59
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetchN failed: unknown result')
|
60
|
+
end
|
61
|
+
|
62
|
+
def fetchAll()
|
63
|
+
send_fetchAll()
|
64
|
+
return recv_fetchAll()
|
65
|
+
end
|
66
|
+
|
67
|
+
def send_fetchAll()
|
68
|
+
send_message('fetchAll', FetchAll_args)
|
69
|
+
end
|
70
|
+
|
71
|
+
def recv_fetchAll()
|
72
|
+
result = receive_message(FetchAll_result)
|
73
|
+
return result.success unless result.success.nil?
|
74
|
+
raise result.ex unless result.ex.nil?
|
75
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetchAll failed: unknown result')
|
76
|
+
end
|
77
|
+
|
78
|
+
def getSchema()
|
79
|
+
send_getSchema()
|
80
|
+
return recv_getSchema()
|
81
|
+
end
|
82
|
+
|
83
|
+
def send_getSchema()
|
84
|
+
send_message('getSchema', GetSchema_args)
|
85
|
+
end
|
86
|
+
|
87
|
+
def recv_getSchema()
|
88
|
+
result = receive_message(GetSchema_result)
|
89
|
+
return result.success unless result.success.nil?
|
90
|
+
raise result.ex unless result.ex.nil?
|
91
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getSchema failed: unknown result')
|
92
|
+
end
|
93
|
+
|
94
|
+
def getThriftSchema()
|
95
|
+
send_getThriftSchema()
|
96
|
+
return recv_getThriftSchema()
|
97
|
+
end
|
98
|
+
|
99
|
+
def send_getThriftSchema()
|
100
|
+
send_message('getThriftSchema', GetThriftSchema_args)
|
101
|
+
end
|
102
|
+
|
103
|
+
def recv_getThriftSchema()
|
104
|
+
result = receive_message(GetThriftSchema_result)
|
105
|
+
return result.success unless result.success.nil?
|
106
|
+
raise result.ex unless result.ex.nil?
|
107
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getThriftSchema failed: unknown result')
|
108
|
+
end
|
109
|
+
|
110
|
+
def getClusterStatus()
|
111
|
+
send_getClusterStatus()
|
112
|
+
return recv_getClusterStatus()
|
113
|
+
end
|
114
|
+
|
115
|
+
def send_getClusterStatus()
|
116
|
+
send_message('getClusterStatus', GetClusterStatus_args)
|
117
|
+
end
|
118
|
+
|
119
|
+
def recv_getClusterStatus()
|
120
|
+
result = receive_message(GetClusterStatus_result)
|
121
|
+
return result.success unless result.success.nil?
|
122
|
+
raise result.ex unless result.ex.nil?
|
123
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getClusterStatus failed: unknown result')
|
124
|
+
end
|
125
|
+
|
126
|
+
def getQueryPlan()
|
127
|
+
send_getQueryPlan()
|
128
|
+
return recv_getQueryPlan()
|
129
|
+
end
|
130
|
+
|
131
|
+
def send_getQueryPlan()
|
132
|
+
send_message('getQueryPlan', GetQueryPlan_args)
|
133
|
+
end
|
134
|
+
|
135
|
+
def recv_getQueryPlan()
|
136
|
+
result = receive_message(GetQueryPlan_result)
|
137
|
+
return result.success unless result.success.nil?
|
138
|
+
raise result.ex unless result.ex.nil?
|
139
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getQueryPlan failed: unknown result')
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
class Processor < ThriftHiveMetastore::Processor
|
145
|
+
include ::Thrift::Processor
|
146
|
+
|
147
|
+
def process_execute(seqid, iprot, oprot)
|
148
|
+
args = read_args(iprot, Execute_args)
|
149
|
+
result = Execute_result.new()
|
150
|
+
begin
|
151
|
+
@handler.execute(args.query)
|
152
|
+
rescue HiveServerException => ex
|
153
|
+
result.ex = ex
|
154
|
+
end
|
155
|
+
write_result(result, oprot, 'execute', seqid)
|
156
|
+
end
|
157
|
+
|
158
|
+
def process_fetchOne(seqid, iprot, oprot)
|
159
|
+
args = read_args(iprot, FetchOne_args)
|
160
|
+
result = FetchOne_result.new()
|
161
|
+
begin
|
162
|
+
result.success = @handler.fetchOne()
|
163
|
+
rescue HiveServerException => ex
|
164
|
+
result.ex = ex
|
165
|
+
end
|
166
|
+
write_result(result, oprot, 'fetchOne', seqid)
|
167
|
+
end
|
168
|
+
|
169
|
+
def process_fetchN(seqid, iprot, oprot)
|
170
|
+
args = read_args(iprot, FetchN_args)
|
171
|
+
result = FetchN_result.new()
|
172
|
+
begin
|
173
|
+
result.success = @handler.fetchN(args.numRows)
|
174
|
+
rescue HiveServerException => ex
|
175
|
+
result.ex = ex
|
176
|
+
end
|
177
|
+
write_result(result, oprot, 'fetchN', seqid)
|
178
|
+
end
|
179
|
+
|
180
|
+
def process_fetchAll(seqid, iprot, oprot)
|
181
|
+
args = read_args(iprot, FetchAll_args)
|
182
|
+
result = FetchAll_result.new()
|
183
|
+
begin
|
184
|
+
result.success = @handler.fetchAll()
|
185
|
+
rescue HiveServerException => ex
|
186
|
+
result.ex = ex
|
187
|
+
end
|
188
|
+
write_result(result, oprot, 'fetchAll', seqid)
|
189
|
+
end
|
190
|
+
|
191
|
+
def process_getSchema(seqid, iprot, oprot)
|
192
|
+
args = read_args(iprot, GetSchema_args)
|
193
|
+
result = GetSchema_result.new()
|
194
|
+
begin
|
195
|
+
result.success = @handler.getSchema()
|
196
|
+
rescue HiveServerException => ex
|
197
|
+
result.ex = ex
|
198
|
+
end
|
199
|
+
write_result(result, oprot, 'getSchema', seqid)
|
200
|
+
end
|
201
|
+
|
202
|
+
def process_getThriftSchema(seqid, iprot, oprot)
|
203
|
+
args = read_args(iprot, GetThriftSchema_args)
|
204
|
+
result = GetThriftSchema_result.new()
|
205
|
+
begin
|
206
|
+
result.success = @handler.getThriftSchema()
|
207
|
+
rescue HiveServerException => ex
|
208
|
+
result.ex = ex
|
209
|
+
end
|
210
|
+
write_result(result, oprot, 'getThriftSchema', seqid)
|
211
|
+
end
|
212
|
+
|
213
|
+
def process_getClusterStatus(seqid, iprot, oprot)
|
214
|
+
args = read_args(iprot, GetClusterStatus_args)
|
215
|
+
result = GetClusterStatus_result.new()
|
216
|
+
begin
|
217
|
+
result.success = @handler.getClusterStatus()
|
218
|
+
rescue HiveServerException => ex
|
219
|
+
result.ex = ex
|
220
|
+
end
|
221
|
+
write_result(result, oprot, 'getClusterStatus', seqid)
|
222
|
+
end
|
223
|
+
|
224
|
+
def process_getQueryPlan(seqid, iprot, oprot)
|
225
|
+
args = read_args(iprot, GetQueryPlan_args)
|
226
|
+
result = GetQueryPlan_result.new()
|
227
|
+
begin
|
228
|
+
result.success = @handler.getQueryPlan()
|
229
|
+
rescue HiveServerException => ex
|
230
|
+
result.ex = ex
|
231
|
+
end
|
232
|
+
write_result(result, oprot, 'getQueryPlan', seqid)
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
236
|
+
|
237
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
238
|
+
|
239
|
+
class Execute_args
|
240
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
241
|
+
QUERY = 1
|
242
|
+
|
243
|
+
FIELDS = {
|
244
|
+
QUERY => {:type => ::Thrift::Types::STRING, :name => 'query'}
|
245
|
+
}
|
246
|
+
|
247
|
+
def struct_fields; FIELDS; end
|
248
|
+
|
249
|
+
def validate
|
250
|
+
end
|
251
|
+
|
252
|
+
::Thrift::Struct.generate_accessors self
|
253
|
+
end
|
254
|
+
|
255
|
+
class Execute_result
|
256
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
257
|
+
EX = 1
|
258
|
+
|
259
|
+
FIELDS = {
|
260
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
261
|
+
}
|
262
|
+
|
263
|
+
def struct_fields; FIELDS; end
|
264
|
+
|
265
|
+
def validate
|
266
|
+
end
|
267
|
+
|
268
|
+
::Thrift::Struct.generate_accessors self
|
269
|
+
end
|
270
|
+
|
271
|
+
class FetchOne_args
|
272
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
273
|
+
|
274
|
+
FIELDS = {
|
275
|
+
|
276
|
+
}
|
277
|
+
|
278
|
+
def struct_fields; FIELDS; end
|
279
|
+
|
280
|
+
def validate
|
281
|
+
end
|
282
|
+
|
283
|
+
::Thrift::Struct.generate_accessors self
|
284
|
+
end
|
285
|
+
|
286
|
+
class FetchOne_result
|
287
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
288
|
+
SUCCESS = 0
|
289
|
+
EX = 1
|
290
|
+
|
291
|
+
FIELDS = {
|
292
|
+
SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'},
|
293
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
294
|
+
}
|
295
|
+
|
296
|
+
def struct_fields; FIELDS; end
|
297
|
+
|
298
|
+
def validate
|
299
|
+
end
|
300
|
+
|
301
|
+
::Thrift::Struct.generate_accessors self
|
302
|
+
end
|
303
|
+
|
304
|
+
class FetchN_args
|
305
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
306
|
+
NUMROWS = 1
|
307
|
+
|
308
|
+
FIELDS = {
|
309
|
+
NUMROWS => {:type => ::Thrift::Types::I32, :name => 'numRows'}
|
310
|
+
}
|
311
|
+
|
312
|
+
def struct_fields; FIELDS; end
|
313
|
+
|
314
|
+
def validate
|
315
|
+
end
|
316
|
+
|
317
|
+
::Thrift::Struct.generate_accessors self
|
318
|
+
end
|
319
|
+
|
320
|
+
class FetchN_result
|
321
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
322
|
+
SUCCESS = 0
|
323
|
+
EX = 1
|
324
|
+
|
325
|
+
FIELDS = {
|
326
|
+
SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}},
|
327
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
328
|
+
}
|
329
|
+
|
330
|
+
def struct_fields; FIELDS; end
|
331
|
+
|
332
|
+
def validate
|
333
|
+
end
|
334
|
+
|
335
|
+
::Thrift::Struct.generate_accessors self
|
336
|
+
end
|
337
|
+
|
338
|
+
class FetchAll_args
|
339
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
340
|
+
|
341
|
+
FIELDS = {
|
342
|
+
|
343
|
+
}
|
344
|
+
|
345
|
+
def struct_fields; FIELDS; end
|
346
|
+
|
347
|
+
def validate
|
348
|
+
end
|
349
|
+
|
350
|
+
::Thrift::Struct.generate_accessors self
|
351
|
+
end
|
352
|
+
|
353
|
+
class FetchAll_result
|
354
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
355
|
+
SUCCESS = 0
|
356
|
+
EX = 1
|
357
|
+
|
358
|
+
FIELDS = {
|
359
|
+
SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}},
|
360
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
361
|
+
}
|
362
|
+
|
363
|
+
def struct_fields; FIELDS; end
|
364
|
+
|
365
|
+
def validate
|
366
|
+
end
|
367
|
+
|
368
|
+
::Thrift::Struct.generate_accessors self
|
369
|
+
end
|
370
|
+
|
371
|
+
class GetSchema_args
|
372
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
373
|
+
|
374
|
+
FIELDS = {
|
375
|
+
|
376
|
+
}
|
377
|
+
|
378
|
+
def struct_fields; FIELDS; end
|
379
|
+
|
380
|
+
def validate
|
381
|
+
end
|
382
|
+
|
383
|
+
::Thrift::Struct.generate_accessors self
|
384
|
+
end
|
385
|
+
|
386
|
+
class GetSchema_result
|
387
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
388
|
+
SUCCESS = 0
|
389
|
+
EX = 1
|
390
|
+
|
391
|
+
FIELDS = {
|
392
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Schema},
|
393
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
394
|
+
}
|
395
|
+
|
396
|
+
def struct_fields; FIELDS; end
|
397
|
+
|
398
|
+
def validate
|
399
|
+
end
|
400
|
+
|
401
|
+
::Thrift::Struct.generate_accessors self
|
402
|
+
end
|
403
|
+
|
404
|
+
class GetThriftSchema_args
|
405
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
406
|
+
|
407
|
+
FIELDS = {
|
408
|
+
|
409
|
+
}
|
410
|
+
|
411
|
+
def struct_fields; FIELDS; end
|
412
|
+
|
413
|
+
def validate
|
414
|
+
end
|
415
|
+
|
416
|
+
::Thrift::Struct.generate_accessors self
|
417
|
+
end
|
418
|
+
|
419
|
+
class GetThriftSchema_result
|
420
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
421
|
+
SUCCESS = 0
|
422
|
+
EX = 1
|
423
|
+
|
424
|
+
FIELDS = {
|
425
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Schema},
|
426
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
427
|
+
}
|
428
|
+
|
429
|
+
def struct_fields; FIELDS; end
|
430
|
+
|
431
|
+
def validate
|
432
|
+
end
|
433
|
+
|
434
|
+
::Thrift::Struct.generate_accessors self
|
435
|
+
end
|
436
|
+
|
437
|
+
class GetClusterStatus_args
|
438
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
439
|
+
|
440
|
+
FIELDS = {
|
441
|
+
|
442
|
+
}
|
443
|
+
|
444
|
+
def struct_fields; FIELDS; end
|
445
|
+
|
446
|
+
def validate
|
447
|
+
end
|
448
|
+
|
449
|
+
::Thrift::Struct.generate_accessors self
|
450
|
+
end
|
451
|
+
|
452
|
+
class GetClusterStatus_result
|
453
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
454
|
+
SUCCESS = 0
|
455
|
+
EX = 1
|
456
|
+
|
457
|
+
FIELDS = {
|
458
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => HiveClusterStatus},
|
459
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
460
|
+
}
|
461
|
+
|
462
|
+
def struct_fields; FIELDS; end
|
463
|
+
|
464
|
+
def validate
|
465
|
+
end
|
466
|
+
|
467
|
+
::Thrift::Struct.generate_accessors self
|
468
|
+
end
|
469
|
+
|
470
|
+
class GetQueryPlan_args
|
471
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
472
|
+
|
473
|
+
FIELDS = {
|
474
|
+
|
475
|
+
}
|
476
|
+
|
477
|
+
def struct_fields; FIELDS; end
|
478
|
+
|
479
|
+
def validate
|
480
|
+
end
|
481
|
+
|
482
|
+
::Thrift::Struct.generate_accessors self
|
483
|
+
end
|
484
|
+
|
485
|
+
class GetQueryPlan_result
|
486
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
487
|
+
SUCCESS = 0
|
488
|
+
EX = 1
|
489
|
+
|
490
|
+
FIELDS = {
|
491
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => QueryPlan},
|
492
|
+
EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => HiveServerException}
|
493
|
+
}
|
494
|
+
|
495
|
+
def struct_fields; FIELDS; end
|
496
|
+
|
497
|
+
def validate
|
498
|
+
end
|
499
|
+
|
500
|
+
::Thrift::Struct.generate_accessors self
|
501
|
+
end
|
502
|
+
|
503
|
+
end
|
504
|
+
|