presto-client 0.5.4 → 0.5.5

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.
@@ -27,7 +27,8 @@ module Presto::Client
27
27
  require 'presto/client/model_versions/0.149.rb'
28
28
  require 'presto/client/model_versions/0.153.rb'
29
29
  require 'presto/client/model_versions/0.173.rb'
30
+ require 'presto/client/model_versions/0.178.rb'
30
31
 
31
- Models = ModelVersions::V0_173
32
+ Models = ModelVersions::V0_178
32
33
 
33
34
  end
@@ -15,6 +15,6 @@
15
15
  #
16
16
  module Presto
17
17
  module Client
18
- VERSION = "0.5.4"
18
+ VERSION = "0.5.5"
19
19
  end
20
20
  end
@@ -113,6 +113,7 @@ module Presto::Client::ModelVersions
113
113
  when "groupid" then GroupIdNode
114
114
  when "explainAnalyze" then ExplainAnalyzeNode
115
115
  when "apply" then ApplyNode
116
+ when "assignUniqueId" then AssignUniqueId
116
117
  end
117
118
  if model_class
118
119
  node = model_class.decode(hash)
@@ -238,6 +239,88 @@ module Presto::Client::ModelVersions
238
239
  end
239
240
  end
240
241
 
242
+ class << Aggregation =
243
+ Base.new(:call, :signature, :mask)
244
+ def decode(hash)
245
+ unless hash.is_a?(Hash)
246
+ raise TypeError, "Can't convert #{hash.class} to Hash"
247
+ end
248
+ obj = allocate
249
+ obj.send(:initialize_struct,
250
+ hash["call"],
251
+ hash["signature"] && Signature.decode(hash["signature"]),
252
+ hash["mask"]
253
+ )
254
+ obj
255
+ end
256
+ end
257
+
258
+ class << Function =
259
+ Base.new(:function_call, :signature, :frame)
260
+ def decode(hash)
261
+ unless hash.is_a?(Hash)
262
+ raise TypeError, "Can't convert #{hash.class} to Hash"
263
+ end
264
+ obj = allocate
265
+ obj.send(:initialize_struct,
266
+ hash["function_call"],
267
+ hash["signature"] && Signature.decode(hash["signature"]),
268
+ hash["frame"] && Frame.decode(hash["frame"])
269
+ )
270
+ obj
271
+ end
272
+ end
273
+
274
+ module OperatorInfo
275
+ def self.decode(hash)
276
+ unless hash.is_a?(Hash)
277
+ raise TypeError, "Can't convert #{hash.class} to Hash"
278
+ end
279
+ model_class = case hash["@type"]
280
+ when "exchangeClientStatus" then ExchangeClientStatus
281
+ when "localExchangeBuffer" then LocalExchangeBufferInfo
282
+ when "tableFinish" then TableFinishInfo
283
+ when "splitOperator" then SplitOperatorInfo
284
+ when "hashCollisionsInfo" then HashCollisionsInfo
285
+ when "partitionedOutput" then PartitionedOutputInfo
286
+ end
287
+ if model_class
288
+ model_class.decode(hash)
289
+ end
290
+ end
291
+ end
292
+
293
+ class << PartitionedOutputInfo =
294
+ Base.new(:rows_added, :pages_added)
295
+ def decode(hash)
296
+ unless hash.is_a?(Hash)
297
+ raise TypeError, "Can't convert #{hash.class} to Hash"
298
+ end
299
+ obj = allocate
300
+ obj.send(:initialize_struct,
301
+ hash["rows_added"],
302
+ hash["pages_added"],
303
+ )
304
+ obj
305
+ end
306
+ end
307
+
308
+ class << HashCollisionsInfo =
309
+ Base.new(:weighted_hash_collisions, :weighted_sum_squared_hash_collisions, :weighted_expectedHash_collisions)
310
+ def decode(hash)
311
+ unless hash.is_a?(Hash)
312
+ raise TypeError, "Can't convert #{hash.class} to Hash"
313
+ end
314
+ obj = allocate
315
+ obj.send(:initialize_struct,
316
+ hash["weighted_hash_collisions"],
317
+ hash["weighted_sum_squared_hash_collisions"],
318
+ hash["weighted_expectedHash_collisions"]
319
+ )
320
+ obj
321
+ end
322
+ end
323
+
241
324
  ##
242
325
  # Those model classes are automatically generated
243
326
  #
data/modelgen/modelgen.rb CHANGED
@@ -14,10 +14,10 @@ erb = ERB.new(File.read(template_path))
14
14
  source_path = source_dir
15
15
 
16
16
  predefined_simple_classes = %w[StageId TaskId ConnectorSession]
17
- predefined_models = %w[DistributionSnapshot PlanNode EquiJoinClause WriterTarget DeleteHandle Specification ArgumentBinding]
17
+ predefined_models = %w[DistributionSnapshot PlanNode EquiJoinClause WriterTarget DeleteHandle Specification ArgumentBinding Aggregation Function OperatorInfo PartitionedOutputInfo HashCollisionsInfo]
18
18
 
19
- assume_primitive = %w[Object Type Long Symbol QueryId PlanNodeId PlanFragmentId MemoryPoolId TransactionId URI Duration DataSize DateTime ColumnHandle ConnectorTableHandle ConnectorOutputTableHandle ConnectorIndexHandle ConnectorColumnHandle ConnectorInsertTableHandle ConnectorTableLayoutHandle Expression FunctionCall TimeZoneKey Locale TypeSignature Frame TupleDomain<ColumnHandle> SerializableNativeValue ConnectorTransactionHandle OutputBufferId ConnectorPartitioningHandle NullableValue ConnectorId]
20
- enum_types = %w[QueryState StageState TaskState QueueState PlanDistribution OutputPartitioning Step SortOrder BufferState NullPartitioning BlockedReason ParameterKind FunctionKind PartitionFunctionHandle Scope ErrorType]
19
+ assume_primitive = %w[Object Type Long Symbol QueryId PlanNodeId PlanFragmentId MemoryPoolId TransactionId URI Duration DataSize DateTime ColumnHandle ConnectorTableHandle ConnectorOutputTableHandle ConnectorIndexHandle ConnectorColumnHandle ConnectorInsertTableHandle ConnectorTableLayoutHandle Expression FunctionCall TimeZoneKey Locale TypeSignature Frame TupleDomain<ColumnHandle> SerializableNativeValue ConnectorTransactionHandle OutputBufferId ConnectorPartitioningHandle NullableValue ConnectorId HostAddress JsonNode]
20
+ enum_types = %w[QueryState StageState TaskState QueueState PlanDistribution OutputPartitioning Step SortOrder BufferState NullPartitioning BlockedReason ParameterKind FunctionKind PartitionFunctionHandle Scope ErrorType DistributionType]
21
21
 
22
22
  root_models = %w[QueryResults QueryInfo] + %w[
23
23
  OutputNode
@@ -52,7 +52,9 @@ EnforceSingleRowNode
52
52
  GroupIdNode
53
53
  ExplainAnalyzeNode
54
54
  ApplyNode
55
- ] + %w[InsertTableHandle OutputTableHandle TableHandle]
55
+ AssignUniqueId
56
+ ] + %w[InsertTableHandle OutputTableHandle TableHandle
57
+ ] + %w[ExchangeClientStatus LocalExchangeBufferInfo TableFinishInfo SplitOperatorInfo]
56
58
 
57
59
  name_mapping = Hash[*%w[
58
60
  StatementStats StageStats ClientStageStats
@@ -77,6 +77,9 @@ module PrestoModels
77
77
  elsif m = /OptionalInt/.match(type)
78
78
  base_type = 'Integer'
79
79
  nullable = true
80
+ elsif m = /OptionalLong/.match(type)
81
+ base_type = 'Long'
82
+ nullable = true
80
83
  elsif type =~ /\w+/
81
84
  base_type = type
82
85
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: presto-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-15 00:00:00.000000000 Z
11
+ date: 2017-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -148,6 +148,7 @@ files:
148
148
  - lib/presto/client/model_versions/0.149.rb
149
149
  - lib/presto/client/model_versions/0.153.rb
150
150
  - lib/presto/client/model_versions/0.173.rb
151
+ - lib/presto/client/model_versions/0.178.rb
151
152
  - lib/presto/client/models.rb
152
153
  - lib/presto/client/query.rb
153
154
  - lib/presto/client/statement_client.rb
@@ -181,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  version: '0'
182
183
  requirements: []
183
184
  rubyforge_project:
184
- rubygems_version: 2.6.8
185
+ rubygems_version: 2.6.11
185
186
  signing_key:
186
187
  specification_version: 4
187
188
  summary: Presto client library