presto-client 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc11fc0cab121eb735018084081c77fa034847f6
4
- data.tar.gz: 19812b673f76893200f7b691444176a06b995bf7
3
+ metadata.gz: 480d2fbe7a4abcd63537fa115b61973ee47d0660
4
+ data.tar.gz: '04966bb7d6db3cc0b37522db481caf724b4c6ba7'
5
5
  SHA512:
6
- metadata.gz: 4494d03f05cf329625eeeaca2762e8ce2bd75a3d1689ad0e7a7714f63d9efb9525f41cf42a18d66e15cdde4a798fb8b97ac55fe028c86b2f307959da8f794855
7
- data.tar.gz: 9f069548587f6bb5a8beae83a654afae3ad97f91616be7fda724e5379d42ebde8e38a4574c743e2ef1f224e32cbffc9414a916ec9b1c1affa9757f65532f2b2f
6
+ metadata.gz: da3d2da1dd78e71fb9e0faf05802866739ba176a0461e1743a8751dd9e3022a16b94640c22b2e4929e4836ffb1f2f3f155cf51d7ce856ce8f48895202eb97405
7
+ data.tar.gz: aa9576c409fabe996231a8bfebf7d323647b0bdc25d224c74c82eb771057eb6607065642331abafbe9d9ea8dd9863590a891f681f8ba64d10ff4b877dc06f140
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ 2017-06-28 version 0.5.5:
2
+ * Added support for model version 0.178
3
+
1
4
  2017-05-15 version 0.5.4:
2
5
 
3
6
  * Support "Content-Type: application/x-msgpack" for more efficient parsing of
data/Rakefile CHANGED
@@ -16,6 +16,7 @@ GEN_MODEL_VERSIONS = %w[
16
16
  0.149
17
17
  0.153
18
18
  0.173
19
+ 0.178
19
20
  ]
20
21
 
21
22
  namespace "modelgen" do
@@ -0,0 +1,1883 @@
1
+ #
2
+ # Presto client for Ruby
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ module Presto::Client::ModelVersions
17
+
18
+ ####
19
+ ## lib/presto/client/model_versions/*.rb is automatically generated using "rake modelgen:all" command.
20
+ ## You should not edit this file directly. To modify the class definitions, edit
21
+ ## modelgen/model_versions.rb file and run "rake modelgen:all".
22
+ ##
23
+
24
+ module V0_178
25
+ class Base < Struct
26
+ class << self
27
+ alias_method :new_struct, :new
28
+
29
+ def new(*args)
30
+ new_struct(*args) do
31
+ # make it immutable
32
+ undef_method :"[]="
33
+ members.each do |m|
34
+ undef_method :"#{m}="
35
+ end
36
+
37
+ # replace constructor to receive hash instead of array
38
+ alias_method :initialize_struct, :initialize
39
+
40
+ def initialize(params={})
41
+ initialize_struct(*members.map {|m| params[m] })
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ class StageId < String
49
+ def initialize(str)
50
+ super
51
+ splitted = split('.', 2)
52
+ @query_id = splitted[0]
53
+ @id = splitted[1]
54
+ end
55
+
56
+ attr_reader :query_id, :id
57
+ end
58
+
59
+ class TaskId < String
60
+ def initialize(str)
61
+ super
62
+ splitted = split('.', 3)
63
+ @stage_id = StageId.new("#{splitted[0]}.#{splitted[1]}")
64
+ @query_id = @stage_id.query_id
65
+ @id = splitted[2]
66
+ end
67
+
68
+ attr_reader :query_id, :stage_id, :id
69
+ end
70
+
71
+ class ConnectorSession < Hash
72
+ def initialize(hash)
73
+ super()
74
+ merge!(hash)
75
+ end
76
+ end
77
+
78
+ module PlanNode
79
+ def self.decode(hash)
80
+ unless hash.is_a?(Hash)
81
+ raise TypeError, "Can't convert #{hash.class} to Hash"
82
+ end
83
+ model_class = case hash["@type"]
84
+ when "output" then OutputNode
85
+ when "project" then ProjectNode
86
+ when "tablescan" then TableScanNode
87
+ when "values" then ValuesNode
88
+ when "aggregation" then AggregationNode
89
+ when "markDistinct" then MarkDistinctNode
90
+ when "filter" then FilterNode
91
+ when "window" then WindowNode
92
+ when "rowNumber" then RowNumberNode
93
+ when "topnRowNumber" then TopNRowNumberNode
94
+ when "limit" then LimitNode
95
+ when "distinctlimit" then DistinctLimitNode
96
+ when "topn" then TopNNode
97
+ when "sample" then SampleNode
98
+ when "sort" then SortNode
99
+ when "remoteSource" then RemoteSourceNode
100
+ when "join" then JoinNode
101
+ when "semijoin" then SemiJoinNode
102
+ when "indexjoin" then IndexJoinNode
103
+ when "indexsource" then IndexSourceNode
104
+ when "tablewriter" then TableWriterNode
105
+ when "delete" then DeleteNode
106
+ when "metadatadelete" then MetadataDeleteNode
107
+ when "tablecommit" then TableFinishNode
108
+ when "unnest" then UnnestNode
109
+ when "exchange" then ExchangeNode
110
+ when "union" then UnionNode
111
+ when "intersect" then IntersectNode
112
+ when "scalar" then EnforceSingleRowNode
113
+ when "groupid" then GroupIdNode
114
+ when "explainAnalyze" then ExplainAnalyzeNode
115
+ when "apply" then ApplyNode
116
+ when "assignUniqueId" then AssignUniqueId
117
+ end
118
+ if model_class
119
+ node = model_class.decode(hash)
120
+ class << node
121
+ attr_accessor :plan_node_type
122
+ end
123
+ node.plan_node_type = hash['@type']
124
+ node
125
+ end
126
+ end
127
+ end
128
+
129
+ # io.airlift.stats.Distribution.DistributionSnapshot
130
+ class << DistributionSnapshot =
131
+ Base.new(:max_error, :count, :total, :p01, :p05, :p10, :p25, :p50, :p75, :p90, :p95, :p99, :min, :max)
132
+ def decode(hash)
133
+ unless hash.is_a?(Hash)
134
+ raise TypeError, "Can't convert #{hash.class} to Hash"
135
+ end
136
+ obj = allocate
137
+ obj.send(:initialize_struct,
138
+ hash["maxError"],
139
+ hash["count"],
140
+ hash["total"],
141
+ hash["p01"],
142
+ hash["p05"],
143
+ hash["p10"],
144
+ hash["p25"],
145
+ hash["p50"],
146
+ hash["p75"],
147
+ hash["p90"],
148
+ hash["p95"],
149
+ hash["p99"],
150
+ hash["min"],
151
+ hash["max"],
152
+ )
153
+ obj
154
+ end
155
+ end
156
+
157
+ # This is a hybrid of JoinNode.EquiJoinClause and IndexJoinNode.EquiJoinClause
158
+ class << EquiJoinClause =
159
+ Base.new(:left, :right, :probe, :index)
160
+ def decode(hash)
161
+ unless hash.is_a?(Hash)
162
+ raise TypeError, "Can't convert #{hash.class} to Hash"
163
+ end
164
+ obj = allocate
165
+ obj.send(:initialize_struct,
166
+ hash["left"],
167
+ hash["right"],
168
+ hash["probe"],
169
+ hash["index"],
170
+ )
171
+ obj
172
+ end
173
+ end
174
+
175
+ class << WriterTarget =
176
+ Base.new(:type, :handle)
177
+ def decode(hash)
178
+ unless hash.is_a?(Hash)
179
+ raise TypeError, "Can't convert #{hash.class} to Hash"
180
+ end
181
+ obj = allocate
182
+ model_class = case hash["@type"]
183
+ when "CreateHandle" then OutputTableHandle
184
+ when "InsertHandle" then InsertTableHandle
185
+ when "DeleteHandle" then TableHandle
186
+ end
187
+ obj.send(:initialize_struct,
188
+ hash["@type"],
189
+ model_class.decode(hash['handle'])
190
+ )
191
+ obj
192
+ end
193
+ end
194
+
195
+ class << DeleteHandle =
196
+ Base.new(:handle)
197
+ def decode(hash)
198
+ unless hash.is_a?(Hash)
199
+ raise TypeError, "Can't convert #{hash.class} to Hash"
200
+ end
201
+ obj = allocate
202
+ obj.send(:initialize_struct,
203
+ TableHandle.decode(hash['handle'])
204
+ )
205
+ obj
206
+ end
207
+ end
208
+
209
+ # Inner classes
210
+ class << Specification =
211
+ Base.new(:partition_by, :order_by, :orderings, :frame, :pages_added)
212
+ def decode(hash)
213
+ unless hash.is_a?(Hash)
214
+ raise TypeError, "Can't convert #{hash.class} to Hash"
215
+ end
216
+ obj = allocate
217
+ obj.send(:initialize_struct,
218
+ hash["partitionBy"],
219
+ hash["orderBy"],
220
+ hash["orderings"],
221
+ hash["frame"],
222
+ )
223
+ obj
224
+ end
225
+ end
226
+
227
+ class << ArgumentBinding =
228
+ Base.new(:column, :constant)
229
+ def decode(hash)
230
+ unless hash.is_a?(Hash)
231
+ raise TypeError, "Can't convert #{hash.class} to Hash"
232
+ end
233
+ obj = allocate
234
+ obj.send(:initialize_struct,
235
+ hash["column"],
236
+ hash["constant"]
237
+ )
238
+ obj
239
+ end
240
+ end
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
+
324
+ ##
325
+ # Those model classes are automatically generated
326
+ #
327
+
328
+ class << AggregationNode =
329
+ Base.new(:id, :source, :assignments, :grouping_sets, :step, :hash_symbol, :group_id_symbol)
330
+ def decode(hash)
331
+ unless hash.is_a?(Hash)
332
+ raise TypeError, "Can't convert #{hash.class} to Hash"
333
+ end
334
+ obj = allocate
335
+ obj.send(:initialize_struct,
336
+ hash["id"],
337
+ hash["source"] && PlanNode.decode(hash["source"]),
338
+ hash["assignments"] && Hash[hash["assignments"].to_a.map! {|k,v| [k, Aggregation.decode(v)] }],
339
+ hash["groupingSets"],
340
+ hash["step"] && hash["step"].downcase.to_sym,
341
+ hash["hashSymbol"],
342
+ hash["groupIdSymbol"],
343
+ )
344
+ obj
345
+ end
346
+ end
347
+
348
+ class << ApplyNode =
349
+ Base.new(:id, :input, :subquery, :subquery_assignments, :correlation)
350
+ def decode(hash)
351
+ unless hash.is_a?(Hash)
352
+ raise TypeError, "Can't convert #{hash.class} to Hash"
353
+ end
354
+ obj = allocate
355
+ obj.send(:initialize_struct,
356
+ hash["id"],
357
+ hash["input"] && PlanNode.decode(hash["input"]),
358
+ hash["subquery"] && PlanNode.decode(hash["subquery"]),
359
+ hash["subqueryAssignments"] && Assignments.decode(hash["subqueryAssignments"]),
360
+ hash["correlation"],
361
+ )
362
+ obj
363
+ end
364
+ end
365
+
366
+ class << AssignUniqueId =
367
+ Base.new(:id, :source, :id_column)
368
+ def decode(hash)
369
+ unless hash.is_a?(Hash)
370
+ raise TypeError, "Can't convert #{hash.class} to Hash"
371
+ end
372
+ obj = allocate
373
+ obj.send(:initialize_struct,
374
+ hash["id"],
375
+ hash["source"] && PlanNode.decode(hash["source"]),
376
+ hash["idColumn"],
377
+ )
378
+ obj
379
+ end
380
+ end
381
+
382
+ class << Assignments =
383
+ Base.new(:assignments)
384
+ def decode(hash)
385
+ unless hash.is_a?(Hash)
386
+ raise TypeError, "Can't convert #{hash.class} to Hash"
387
+ end
388
+ obj = allocate
389
+ obj.send(:initialize_struct,
390
+ hash["assignments"],
391
+ )
392
+ obj
393
+ end
394
+ end
395
+
396
+ class << BufferInfo =
397
+ Base.new(:buffer_id, :finished, :buffered_pages, :pages_sent, :page_buffer_info)
398
+ def decode(hash)
399
+ unless hash.is_a?(Hash)
400
+ raise TypeError, "Can't convert #{hash.class} to Hash"
401
+ end
402
+ obj = allocate
403
+ obj.send(:initialize_struct,
404
+ hash["bufferId"],
405
+ hash["finished"],
406
+ hash["bufferedPages"],
407
+ hash["pagesSent"],
408
+ hash["pageBufferInfo"] && PageBufferInfo.decode(hash["pageBufferInfo"]),
409
+ )
410
+ obj
411
+ end
412
+ end
413
+
414
+ class << ClientColumn =
415
+ Base.new(:name, :type, :type_signature)
416
+ def decode(hash)
417
+ unless hash.is_a?(Hash)
418
+ raise TypeError, "Can't convert #{hash.class} to Hash"
419
+ end
420
+ obj = allocate
421
+ obj.send(:initialize_struct,
422
+ hash["name"],
423
+ hash["type"],
424
+ hash["typeSignature"] && ClientTypeSignature.decode(hash["typeSignature"]),
425
+ )
426
+ obj
427
+ end
428
+ end
429
+
430
+ class << ClientStageStats =
431
+ Base.new(:stage_id, :state, :done, :nodes, :total_splits, :queued_splits, :running_splits, :completed_splits, :user_time_millis, :cpu_time_millis, :wall_time_millis, :processed_rows, :processed_bytes, :sub_stages)
432
+ def decode(hash)
433
+ unless hash.is_a?(Hash)
434
+ raise TypeError, "Can't convert #{hash.class} to Hash"
435
+ end
436
+ obj = allocate
437
+ obj.send(:initialize_struct,
438
+ hash["stageId"],
439
+ hash["state"],
440
+ hash["done"],
441
+ hash["nodes"],
442
+ hash["totalSplits"],
443
+ hash["queuedSplits"],
444
+ hash["runningSplits"],
445
+ hash["completedSplits"],
446
+ hash["userTimeMillis"],
447
+ hash["cpuTimeMillis"],
448
+ hash["wallTimeMillis"],
449
+ hash["processedRows"],
450
+ hash["processedBytes"],
451
+ hash["subStages"] && hash["subStages"].map {|h| ClientStageStats.decode(h) },
452
+ )
453
+ obj
454
+ end
455
+ end
456
+
457
+ class << ClientTypeSignature =
458
+ Base.new(:raw_type, :type_arguments, :literal_arguments, :arguments)
459
+ def decode(hash)
460
+ unless hash.is_a?(Hash)
461
+ raise TypeError, "Can't convert #{hash.class} to Hash"
462
+ end
463
+ obj = allocate
464
+ obj.send(:initialize_struct,
465
+ hash["rawType"],
466
+ hash["typeArguments"] && hash["typeArguments"].map {|h| ClientTypeSignature.decode(h) },
467
+ hash["literalArguments"],
468
+ hash["arguments"] && hash["arguments"].map {|h| ClientTypeSignatureParameter.decode(h) },
469
+ )
470
+ obj
471
+ end
472
+ end
473
+
474
+ class << ClientTypeSignatureParameter =
475
+ Base.new(:kind, :value)
476
+ def decode(hash)
477
+ unless hash.is_a?(Hash)
478
+ raise TypeError, "Can't convert #{hash.class} to Hash"
479
+ end
480
+ obj = allocate
481
+ obj.send(:initialize_struct,
482
+ hash["kind"] && hash["kind"].downcase.to_sym,
483
+ hash["value"],
484
+ )
485
+ obj
486
+ end
487
+ end
488
+
489
+ class << Column =
490
+ Base.new(:name, :type)
491
+ def decode(hash)
492
+ unless hash.is_a?(Hash)
493
+ raise TypeError, "Can't convert #{hash.class} to Hash"
494
+ end
495
+ obj = allocate
496
+ obj.send(:initialize_struct,
497
+ hash["name"],
498
+ hash["type"],
499
+ )
500
+ obj
501
+ end
502
+ end
503
+
504
+ class << DeleteNode =
505
+ Base.new(:id, :source, :target, :row_id, :outputs)
506
+ def decode(hash)
507
+ unless hash.is_a?(Hash)
508
+ raise TypeError, "Can't convert #{hash.class} to Hash"
509
+ end
510
+ obj = allocate
511
+ obj.send(:initialize_struct,
512
+ hash["id"],
513
+ hash["source"] && PlanNode.decode(hash["source"]),
514
+ hash["target"] && DeleteHandle.decode(hash["target"]),
515
+ hash["rowId"],
516
+ hash["outputs"],
517
+ )
518
+ obj
519
+ end
520
+ end
521
+
522
+ class << DistinctLimitNode =
523
+ Base.new(:id, :source, :limit, :partial, :distinct_symbols, :hash_symbol)
524
+ def decode(hash)
525
+ unless hash.is_a?(Hash)
526
+ raise TypeError, "Can't convert #{hash.class} to Hash"
527
+ end
528
+ obj = allocate
529
+ obj.send(:initialize_struct,
530
+ hash["id"],
531
+ hash["source"] && PlanNode.decode(hash["source"]),
532
+ hash["limit"],
533
+ hash["partial"],
534
+ hash["distinctSymbols"],
535
+ hash["hashSymbol"],
536
+ )
537
+ obj
538
+ end
539
+ end
540
+
541
+ class << DriverStats =
542
+ Base.new(:create_time, :start_time, :end_time, :queued_time, :elapsed_time, :memory_reservation, :peak_memory_reservation, :system_memory_reservation, :total_scheduled_time, :total_cpu_time, :total_user_time, :total_blocked_time, :fully_blocked, :blocked_reasons, :raw_input_data_size, :raw_input_positions, :raw_input_read_time, :processed_input_data_size, :processed_input_positions, :output_data_size, :output_positions, :operator_stats)
543
+ def decode(hash)
544
+ unless hash.is_a?(Hash)
545
+ raise TypeError, "Can't convert #{hash.class} to Hash"
546
+ end
547
+ obj = allocate
548
+ obj.send(:initialize_struct,
549
+ hash["createTime"],
550
+ hash["startTime"],
551
+ hash["endTime"],
552
+ hash["queuedTime"],
553
+ hash["elapsedTime"],
554
+ hash["memoryReservation"],
555
+ hash["peakMemoryReservation"],
556
+ hash["systemMemoryReservation"],
557
+ hash["totalScheduledTime"],
558
+ hash["totalCpuTime"],
559
+ hash["totalUserTime"],
560
+ hash["totalBlockedTime"],
561
+ hash["fullyBlocked"],
562
+ hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
563
+ hash["rawInputDataSize"],
564
+ hash["rawInputPositions"],
565
+ hash["rawInputReadTime"],
566
+ hash["processedInputDataSize"],
567
+ hash["processedInputPositions"],
568
+ hash["outputDataSize"],
569
+ hash["outputPositions"],
570
+ hash["operatorStats"] && hash["operatorStats"].map {|h| OperatorStats.decode(h) },
571
+ )
572
+ obj
573
+ end
574
+ end
575
+
576
+ class << EnforceSingleRowNode =
577
+ Base.new(:id, :source)
578
+ def decode(hash)
579
+ unless hash.is_a?(Hash)
580
+ raise TypeError, "Can't convert #{hash.class} to Hash"
581
+ end
582
+ obj = allocate
583
+ obj.send(:initialize_struct,
584
+ hash["id"],
585
+ hash["source"] && PlanNode.decode(hash["source"]),
586
+ )
587
+ obj
588
+ end
589
+ end
590
+
591
+ class << ErrorCode =
592
+ Base.new(:code, :name, :type)
593
+ def decode(hash)
594
+ unless hash.is_a?(Hash)
595
+ raise TypeError, "Can't convert #{hash.class} to Hash"
596
+ end
597
+ obj = allocate
598
+ obj.send(:initialize_struct,
599
+ hash["code"],
600
+ hash["name"],
601
+ hash["type"] && hash["type"].downcase.to_sym,
602
+ )
603
+ obj
604
+ end
605
+ end
606
+
607
+ class << ErrorLocation =
608
+ Base.new(:line_number, :column_number)
609
+ def decode(hash)
610
+ unless hash.is_a?(Hash)
611
+ raise TypeError, "Can't convert #{hash.class} to Hash"
612
+ end
613
+ obj = allocate
614
+ obj.send(:initialize_struct,
615
+ hash["lineNumber"],
616
+ hash["columnNumber"],
617
+ )
618
+ obj
619
+ end
620
+ end
621
+
622
+ class << ExchangeClientStatus =
623
+ Base.new(:buffered_bytes, :max_buffered_bytes, :average_bytes_per_request, :successful_requests_count, :buffered_pages, :no_more_locations, :page_buffer_client_statuses)
624
+ def decode(hash)
625
+ unless hash.is_a?(Hash)
626
+ raise TypeError, "Can't convert #{hash.class} to Hash"
627
+ end
628
+ obj = allocate
629
+ obj.send(:initialize_struct,
630
+ hash["bufferedBytes"],
631
+ hash["maxBufferedBytes"],
632
+ hash["averageBytesPerRequest"],
633
+ hash["successfulRequestsCount"],
634
+ hash["bufferedPages"],
635
+ hash["noMoreLocations"],
636
+ hash["pageBufferClientStatuses"] && hash["pageBufferClientStatuses"].map {|h| PageBufferClientStatus.decode(h) },
637
+ )
638
+ obj
639
+ end
640
+ end
641
+
642
+ class << ExchangeNode =
643
+ Base.new(:id, :type, :scope, :partitioning_scheme, :sources, :inputs)
644
+ def decode(hash)
645
+ unless hash.is_a?(Hash)
646
+ raise TypeError, "Can't convert #{hash.class} to Hash"
647
+ end
648
+ obj = allocate
649
+ obj.send(:initialize_struct,
650
+ hash["id"],
651
+ hash["type"],
652
+ hash["scope"] && hash["scope"].downcase.to_sym,
653
+ hash["partitioningScheme"] && PartitioningScheme.decode(hash["partitioningScheme"]),
654
+ hash["sources"] && hash["sources"].map {|h| PlanNode.decode(h) },
655
+ hash["inputs"],
656
+ )
657
+ obj
658
+ end
659
+ end
660
+
661
+ class << ExecutionFailureInfo =
662
+ Base.new(:type, :message, :cause, :suppressed, :stack, :error_location, :error_code, :remote_host)
663
+ def decode(hash)
664
+ unless hash.is_a?(Hash)
665
+ raise TypeError, "Can't convert #{hash.class} to Hash"
666
+ end
667
+ obj = allocate
668
+ obj.send(:initialize_struct,
669
+ hash["type"],
670
+ hash["message"],
671
+ hash["cause"] && ExecutionFailureInfo.decode(hash["cause"]),
672
+ hash["suppressed"] && hash["suppressed"].map {|h| ExecutionFailureInfo.decode(h) },
673
+ hash["stack"],
674
+ hash["errorLocation"] && ErrorLocation.decode(hash["errorLocation"]),
675
+ hash["errorCode"] && ErrorCode.decode(hash["errorCode"]),
676
+ hash["remoteHost"],
677
+ )
678
+ obj
679
+ end
680
+ end
681
+
682
+ class << ExplainAnalyzeNode =
683
+ Base.new(:id, :source, :output_symbol)
684
+ def decode(hash)
685
+ unless hash.is_a?(Hash)
686
+ raise TypeError, "Can't convert #{hash.class} to Hash"
687
+ end
688
+ obj = allocate
689
+ obj.send(:initialize_struct,
690
+ hash["id"],
691
+ hash["source"] && PlanNode.decode(hash["source"]),
692
+ hash["outputSymbol"],
693
+ )
694
+ obj
695
+ end
696
+ end
697
+
698
+ class << FailureInfo =
699
+ Base.new(:type, :message, :cause, :suppressed, :stack, :error_location)
700
+ def decode(hash)
701
+ unless hash.is_a?(Hash)
702
+ raise TypeError, "Can't convert #{hash.class} to Hash"
703
+ end
704
+ obj = allocate
705
+ obj.send(:initialize_struct,
706
+ hash["type"],
707
+ hash["message"],
708
+ hash["cause"] && FailureInfo.decode(hash["cause"]),
709
+ hash["suppressed"] && hash["suppressed"].map {|h| FailureInfo.decode(h) },
710
+ hash["stack"],
711
+ hash["errorLocation"] && ErrorLocation.decode(hash["errorLocation"]),
712
+ )
713
+ obj
714
+ end
715
+ end
716
+
717
+ class << FilterNode =
718
+ Base.new(:id, :source, :predicate)
719
+ def decode(hash)
720
+ unless hash.is_a?(Hash)
721
+ raise TypeError, "Can't convert #{hash.class} to Hash"
722
+ end
723
+ obj = allocate
724
+ obj.send(:initialize_struct,
725
+ hash["id"],
726
+ hash["source"] && PlanNode.decode(hash["source"]),
727
+ hash["predicate"],
728
+ )
729
+ obj
730
+ end
731
+ end
732
+
733
+ class << GroupIdNode =
734
+ Base.new(:id, :source, :grouping_sets, :grouping_set_mappings, :argument_mappings, :group_id_symbol)
735
+ def decode(hash)
736
+ unless hash.is_a?(Hash)
737
+ raise TypeError, "Can't convert #{hash.class} to Hash"
738
+ end
739
+ obj = allocate
740
+ obj.send(:initialize_struct,
741
+ hash["id"],
742
+ hash["source"] && PlanNode.decode(hash["source"]),
743
+ hash["groupingSets"],
744
+ hash["groupingSetMappings"],
745
+ hash["argumentMappings"],
746
+ hash["groupIdSymbol"],
747
+ )
748
+ obj
749
+ end
750
+ end
751
+
752
+ class << IndexHandle =
753
+ Base.new(:connector_id, :transaction_handle, :connector_handle)
754
+ def decode(hash)
755
+ unless hash.is_a?(Hash)
756
+ raise TypeError, "Can't convert #{hash.class} to Hash"
757
+ end
758
+ obj = allocate
759
+ obj.send(:initialize_struct,
760
+ hash["connectorId"],
761
+ hash["transactionHandle"],
762
+ hash["connectorHandle"],
763
+ )
764
+ obj
765
+ end
766
+ end
767
+
768
+ class << IndexJoinNode =
769
+ Base.new(:id, :type, :probe_source, :index_source, :criteria, :probe_hash_symbol, :index_hash_symbol)
770
+ def decode(hash)
771
+ unless hash.is_a?(Hash)
772
+ raise TypeError, "Can't convert #{hash.class} to Hash"
773
+ end
774
+ obj = allocate
775
+ obj.send(:initialize_struct,
776
+ hash["id"],
777
+ hash["type"],
778
+ hash["probeSource"] && PlanNode.decode(hash["probeSource"]),
779
+ hash["indexSource"] && PlanNode.decode(hash["indexSource"]),
780
+ hash["criteria"] && hash["criteria"].map {|h| EquiJoinClause.decode(h) },
781
+ hash["probeHashSymbol"],
782
+ hash["indexHashSymbol"],
783
+ )
784
+ obj
785
+ end
786
+ end
787
+
788
+ class << IndexSourceNode =
789
+ Base.new(:id, :index_handle, :table_handle, :table_layout, :lookup_symbols, :output_symbols, :assignments, :effective_tuple_domain)
790
+ def decode(hash)
791
+ unless hash.is_a?(Hash)
792
+ raise TypeError, "Can't convert #{hash.class} to Hash"
793
+ end
794
+ obj = allocate
795
+ obj.send(:initialize_struct,
796
+ hash["id"],
797
+ hash["indexHandle"] && IndexHandle.decode(hash["indexHandle"]),
798
+ hash["tableHandle"] && TableHandle.decode(hash["tableHandle"]),
799
+ hash["tableLayout"] && TableLayoutHandle.decode(hash["tableLayout"]),
800
+ hash["lookupSymbols"],
801
+ hash["outputSymbols"],
802
+ hash["assignments"],
803
+ hash["effectiveTupleDomain"],
804
+ )
805
+ obj
806
+ end
807
+ end
808
+
809
+ class << Input =
810
+ Base.new(:connector_id, :schema, :table, :connector_info, :columns)
811
+ def decode(hash)
812
+ unless hash.is_a?(Hash)
813
+ raise TypeError, "Can't convert #{hash.class} to Hash"
814
+ end
815
+ obj = allocate
816
+ obj.send(:initialize_struct,
817
+ hash["connectorId"],
818
+ hash["schema"],
819
+ hash["table"],
820
+ hash["connectorInfo"],
821
+ hash["columns"] && hash["columns"].map {|h| Column.decode(h) },
822
+ )
823
+ obj
824
+ end
825
+ end
826
+
827
+ class << InsertTableHandle =
828
+ Base.new(:connector_id, :transaction_handle, :connector_handle)
829
+ def decode(hash)
830
+ unless hash.is_a?(Hash)
831
+ raise TypeError, "Can't convert #{hash.class} to Hash"
832
+ end
833
+ obj = allocate
834
+ obj.send(:initialize_struct,
835
+ hash["connectorId"],
836
+ hash["transactionHandle"],
837
+ hash["connectorHandle"],
838
+ )
839
+ obj
840
+ end
841
+ end
842
+
843
+ class << IntersectNode =
844
+ Base.new(:id, :sources, :output_to_inputs, :outputs)
845
+ def decode(hash)
846
+ unless hash.is_a?(Hash)
847
+ raise TypeError, "Can't convert #{hash.class} to Hash"
848
+ end
849
+ obj = allocate
850
+ obj.send(:initialize_struct,
851
+ hash["id"],
852
+ hash["sources"] && hash["sources"].map {|h| PlanNode.decode(h) },
853
+ hash["outputToInputs"],
854
+ hash["outputs"],
855
+ )
856
+ obj
857
+ end
858
+ end
859
+
860
+ class << JoinNode =
861
+ Base.new(:id, :type, :left, :right, :criteria, :output_symbols, :filter, :left_hash_symbol, :right_hash_symbol, :distribution_type)
862
+ def decode(hash)
863
+ unless hash.is_a?(Hash)
864
+ raise TypeError, "Can't convert #{hash.class} to Hash"
865
+ end
866
+ obj = allocate
867
+ obj.send(:initialize_struct,
868
+ hash["id"],
869
+ hash["type"],
870
+ hash["left"] && PlanNode.decode(hash["left"]),
871
+ hash["right"] && PlanNode.decode(hash["right"]),
872
+ hash["criteria"] && hash["criteria"].map {|h| EquiJoinClause.decode(h) },
873
+ hash["outputSymbols"],
874
+ hash["filter"],
875
+ hash["leftHashSymbol"],
876
+ hash["rightHashSymbol"],
877
+ hash["distributionType"] && hash["distributionType"].downcase.to_sym,
878
+ )
879
+ obj
880
+ end
881
+ end
882
+
883
+ class << LimitNode =
884
+ Base.new(:id, :source, :count, :partial)
885
+ def decode(hash)
886
+ unless hash.is_a?(Hash)
887
+ raise TypeError, "Can't convert #{hash.class} to Hash"
888
+ end
889
+ obj = allocate
890
+ obj.send(:initialize_struct,
891
+ hash["id"],
892
+ hash["source"] && PlanNode.decode(hash["source"]),
893
+ hash["count"],
894
+ hash["partial"],
895
+ )
896
+ obj
897
+ end
898
+ end
899
+
900
+ class << LocalExchangeBufferInfo =
901
+ Base.new(:buffered_bytes, :buffered_pages)
902
+ def decode(hash)
903
+ unless hash.is_a?(Hash)
904
+ raise TypeError, "Can't convert #{hash.class} to Hash"
905
+ end
906
+ obj = allocate
907
+ obj.send(:initialize_struct,
908
+ hash["bufferedBytes"],
909
+ hash["bufferedPages"],
910
+ )
911
+ obj
912
+ end
913
+ end
914
+
915
+ class << MarkDistinctNode =
916
+ Base.new(:id, :source, :marker_symbol, :distinct_symbols, :hash_symbol)
917
+ def decode(hash)
918
+ unless hash.is_a?(Hash)
919
+ raise TypeError, "Can't convert #{hash.class} to Hash"
920
+ end
921
+ obj = allocate
922
+ obj.send(:initialize_struct,
923
+ hash["id"],
924
+ hash["source"] && PlanNode.decode(hash["source"]),
925
+ hash["markerSymbol"],
926
+ hash["distinctSymbols"],
927
+ hash["hashSymbol"],
928
+ )
929
+ obj
930
+ end
931
+ end
932
+
933
+ class << MetadataDeleteNode =
934
+ Base.new(:id, :target, :output, :table_layout)
935
+ def decode(hash)
936
+ unless hash.is_a?(Hash)
937
+ raise TypeError, "Can't convert #{hash.class} to Hash"
938
+ end
939
+ obj = allocate
940
+ obj.send(:initialize_struct,
941
+ hash["id"],
942
+ hash["target"] && DeleteHandle.decode(hash["target"]),
943
+ hash["output"],
944
+ hash["tableLayout"] && TableLayoutHandle.decode(hash["tableLayout"]),
945
+ )
946
+ obj
947
+ end
948
+ end
949
+
950
+ class << OperatorStats =
951
+ Base.new(:pipeline_id, :operator_id, :plan_node_id, :operator_type, :total_drivers, :add_input_calls, :add_input_wall, :add_input_cpu, :add_input_user, :input_data_size, :input_positions, :sum_squared_input_positions, :get_output_calls, :get_output_wall, :get_output_cpu, :get_output_user, :output_data_size, :output_positions, :blocked_wall, :finish_calls, :finish_wall, :finish_cpu, :finish_user, :memory_reservation, :system_memory_reservation, :blocked_reason, :info)
952
+ def decode(hash)
953
+ unless hash.is_a?(Hash)
954
+ raise TypeError, "Can't convert #{hash.class} to Hash"
955
+ end
956
+ obj = allocate
957
+ obj.send(:initialize_struct,
958
+ hash["pipelineId"],
959
+ hash["operatorId"],
960
+ hash["planNodeId"],
961
+ hash["operatorType"],
962
+ hash["totalDrivers"],
963
+ hash["addInputCalls"],
964
+ hash["addInputWall"],
965
+ hash["addInputCpu"],
966
+ hash["addInputUser"],
967
+ hash["inputDataSize"],
968
+ hash["inputPositions"],
969
+ hash["sumSquaredInputPositions"],
970
+ hash["getOutputCalls"],
971
+ hash["getOutputWall"],
972
+ hash["getOutputCpu"],
973
+ hash["getOutputUser"],
974
+ hash["outputDataSize"],
975
+ hash["outputPositions"],
976
+ hash["blockedWall"],
977
+ hash["finishCalls"],
978
+ hash["finishWall"],
979
+ hash["finishCpu"],
980
+ hash["finishUser"],
981
+ hash["memoryReservation"],
982
+ hash["systemMemoryReservation"],
983
+ hash["blockedReason"] && hash["blockedReason"].downcase.to_sym,
984
+ hash["info"] && OperatorInfo.decode(hash["info"]),
985
+ )
986
+ obj
987
+ end
988
+ end
989
+
990
+ class << Output =
991
+ Base.new(:connector_id, :schema, :table)
992
+ def decode(hash)
993
+ unless hash.is_a?(Hash)
994
+ raise TypeError, "Can't convert #{hash.class} to Hash"
995
+ end
996
+ obj = allocate
997
+ obj.send(:initialize_struct,
998
+ hash["connectorId"],
999
+ hash["schema"],
1000
+ hash["table"],
1001
+ )
1002
+ obj
1003
+ end
1004
+ end
1005
+
1006
+ class << OutputBufferInfo =
1007
+ Base.new(:type, :state, :can_add_buffers, :can_add_pages, :total_buffered_bytes, :total_buffered_pages, :total_rows_sent, :total_pages_sent, :buffers)
1008
+ def decode(hash)
1009
+ unless hash.is_a?(Hash)
1010
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1011
+ end
1012
+ obj = allocate
1013
+ obj.send(:initialize_struct,
1014
+ hash["type"],
1015
+ hash["state"] && hash["state"].downcase.to_sym,
1016
+ hash["canAddBuffers"],
1017
+ hash["canAddPages"],
1018
+ hash["totalBufferedBytes"],
1019
+ hash["totalBufferedPages"],
1020
+ hash["totalRowsSent"],
1021
+ hash["totalPagesSent"],
1022
+ hash["buffers"] && hash["buffers"].map {|h| BufferInfo.decode(h) },
1023
+ )
1024
+ obj
1025
+ end
1026
+ end
1027
+
1028
+ class << OutputNode =
1029
+ Base.new(:id, :source, :columns, :outputs)
1030
+ def decode(hash)
1031
+ unless hash.is_a?(Hash)
1032
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1033
+ end
1034
+ obj = allocate
1035
+ obj.send(:initialize_struct,
1036
+ hash["id"],
1037
+ hash["source"] && PlanNode.decode(hash["source"]),
1038
+ hash["columns"],
1039
+ hash["outputs"],
1040
+ )
1041
+ obj
1042
+ end
1043
+ end
1044
+
1045
+ class << OutputTableHandle =
1046
+ Base.new(:connector_id, :transaction_handle, :connector_handle)
1047
+ def decode(hash)
1048
+ unless hash.is_a?(Hash)
1049
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1050
+ end
1051
+ obj = allocate
1052
+ obj.send(:initialize_struct,
1053
+ hash["connectorId"],
1054
+ hash["transactionHandle"],
1055
+ hash["connectorHandle"],
1056
+ )
1057
+ obj
1058
+ end
1059
+ end
1060
+
1061
+ class << PageBufferClientStatus =
1062
+ Base.new(:uri, :state, :last_update, :rows_received, :pages_received, :rows_rejected, :pages_rejected, :requests_scheduled, :requests_completed, :requests_failed, :http_request_state)
1063
+ def decode(hash)
1064
+ unless hash.is_a?(Hash)
1065
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1066
+ end
1067
+ obj = allocate
1068
+ obj.send(:initialize_struct,
1069
+ hash["uri"],
1070
+ hash["state"],
1071
+ hash["lastUpdate"],
1072
+ hash["rowsReceived"],
1073
+ hash["pagesReceived"],
1074
+ hash["rowsRejected"],
1075
+ hash["pagesRejected"],
1076
+ hash["requestsScheduled"],
1077
+ hash["requestsCompleted"],
1078
+ hash["requestsFailed"],
1079
+ hash["httpRequestState"],
1080
+ )
1081
+ obj
1082
+ end
1083
+ end
1084
+
1085
+ class << PageBufferInfo =
1086
+ Base.new(:partition, :buffered_pages, :buffered_bytes, :rows_added, :pages_added)
1087
+ def decode(hash)
1088
+ unless hash.is_a?(Hash)
1089
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1090
+ end
1091
+ obj = allocate
1092
+ obj.send(:initialize_struct,
1093
+ hash["partition"],
1094
+ hash["bufferedPages"],
1095
+ hash["bufferedBytes"],
1096
+ hash["rowsAdded"],
1097
+ hash["pagesAdded"],
1098
+ )
1099
+ obj
1100
+ end
1101
+ end
1102
+
1103
+ class << Partitioning =
1104
+ Base.new(:handle, :arguments)
1105
+ def decode(hash)
1106
+ unless hash.is_a?(Hash)
1107
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1108
+ end
1109
+ obj = allocate
1110
+ obj.send(:initialize_struct,
1111
+ hash["handle"] && PartitioningHandle.decode(hash["handle"]),
1112
+ hash["arguments"] && hash["arguments"].map {|h| ArgumentBinding.decode(h) },
1113
+ )
1114
+ obj
1115
+ end
1116
+ end
1117
+
1118
+ class << PartitioningHandle =
1119
+ Base.new(:connector_id, :transaction_handle, :connector_handle)
1120
+ def decode(hash)
1121
+ unless hash.is_a?(Hash)
1122
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1123
+ end
1124
+ obj = allocate
1125
+ obj.send(:initialize_struct,
1126
+ hash["connectorId"],
1127
+ hash["transactionHandle"],
1128
+ hash["connectorHandle"],
1129
+ )
1130
+ obj
1131
+ end
1132
+ end
1133
+
1134
+ class << PartitioningScheme =
1135
+ Base.new(:partitioning, :output_layout, :hash_column, :replicate_nulls_and_any, :bucket_to_partition)
1136
+ def decode(hash)
1137
+ unless hash.is_a?(Hash)
1138
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1139
+ end
1140
+ obj = allocate
1141
+ obj.send(:initialize_struct,
1142
+ hash["partitioning"] && Partitioning.decode(hash["partitioning"]),
1143
+ hash["outputLayout"],
1144
+ hash["hashColumn"],
1145
+ hash["replicateNullsAndAny"],
1146
+ hash["bucketToPartition"],
1147
+ )
1148
+ obj
1149
+ end
1150
+ end
1151
+
1152
+ class << PipelineStats =
1153
+ Base.new(:pipeline_id, :first_start_time, :last_start_time, :last_end_time, :input_pipeline, :output_pipeline, :total_drivers, :queued_drivers, :queued_partitioned_drivers, :running_drivers, :running_partitioned_drivers, :blocked_drivers, :completed_drivers, :memory_reservation, :system_memory_reservation, :queued_time, :elapsed_time, :total_scheduled_time, :total_cpu_time, :total_user_time, :total_blocked_time, :fully_blocked, :blocked_reasons, :raw_input_data_size, :raw_input_positions, :processed_input_data_size, :processed_input_positions, :output_data_size, :output_positions, :operator_summaries, :drivers)
1154
+ def decode(hash)
1155
+ unless hash.is_a?(Hash)
1156
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1157
+ end
1158
+ obj = allocate
1159
+ obj.send(:initialize_struct,
1160
+ hash["pipelineId"],
1161
+ hash["firstStartTime"],
1162
+ hash["lastStartTime"],
1163
+ hash["lastEndTime"],
1164
+ hash["inputPipeline"],
1165
+ hash["outputPipeline"],
1166
+ hash["totalDrivers"],
1167
+ hash["queuedDrivers"],
1168
+ hash["queuedPartitionedDrivers"],
1169
+ hash["runningDrivers"],
1170
+ hash["runningPartitionedDrivers"],
1171
+ hash["blockedDrivers"],
1172
+ hash["completedDrivers"],
1173
+ hash["memoryReservation"],
1174
+ hash["systemMemoryReservation"],
1175
+ hash["queuedTime"] && DistributionSnapshot.decode(hash["queuedTime"]),
1176
+ hash["elapsedTime"] && DistributionSnapshot.decode(hash["elapsedTime"]),
1177
+ hash["totalScheduledTime"],
1178
+ hash["totalCpuTime"],
1179
+ hash["totalUserTime"],
1180
+ hash["totalBlockedTime"],
1181
+ hash["fullyBlocked"],
1182
+ hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1183
+ hash["rawInputDataSize"],
1184
+ hash["rawInputPositions"],
1185
+ hash["processedInputDataSize"],
1186
+ hash["processedInputPositions"],
1187
+ hash["outputDataSize"],
1188
+ hash["outputPositions"],
1189
+ hash["operatorSummaries"] && hash["operatorSummaries"].map {|h| OperatorStats.decode(h) },
1190
+ hash["drivers"] && hash["drivers"].map {|h| DriverStats.decode(h) },
1191
+ )
1192
+ obj
1193
+ end
1194
+ end
1195
+
1196
+ class << PlanFragment =
1197
+ Base.new(:id, :root, :symbols, :partitioning, :partitioned_sources, :partitioning_scheme)
1198
+ def decode(hash)
1199
+ unless hash.is_a?(Hash)
1200
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1201
+ end
1202
+ obj = allocate
1203
+ obj.send(:initialize_struct,
1204
+ hash["id"],
1205
+ hash["root"] && PlanNode.decode(hash["root"]),
1206
+ hash["symbols"],
1207
+ hash["partitioning"] && PartitioningHandle.decode(hash["partitioning"]),
1208
+ hash["partitionedSources"],
1209
+ hash["partitioningScheme"] && PartitioningScheme.decode(hash["partitioningScheme"]),
1210
+ )
1211
+ obj
1212
+ end
1213
+ end
1214
+
1215
+ class << ProjectNode =
1216
+ Base.new(:id, :source, :assignments)
1217
+ def decode(hash)
1218
+ unless hash.is_a?(Hash)
1219
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1220
+ end
1221
+ obj = allocate
1222
+ obj.send(:initialize_struct,
1223
+ hash["id"],
1224
+ hash["source"] && PlanNode.decode(hash["source"]),
1225
+ hash["assignments"] && Assignments.decode(hash["assignments"]),
1226
+ )
1227
+ obj
1228
+ end
1229
+ end
1230
+
1231
+ class << QueryError =
1232
+ Base.new(:message, :sql_state, :error_code, :error_name, :error_type, :error_location, :failure_info)
1233
+ def decode(hash)
1234
+ unless hash.is_a?(Hash)
1235
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1236
+ end
1237
+ obj = allocate
1238
+ obj.send(:initialize_struct,
1239
+ hash["message"],
1240
+ hash["sqlState"],
1241
+ hash["errorCode"],
1242
+ hash["errorName"],
1243
+ hash["errorType"],
1244
+ hash["errorLocation"] && ErrorLocation.decode(hash["errorLocation"]),
1245
+ hash["failureInfo"] && FailureInfo.decode(hash["failureInfo"]),
1246
+ )
1247
+ obj
1248
+ end
1249
+ end
1250
+
1251
+ class << QueryInfo =
1252
+ Base.new(:query_id, :session, :state, :memory_pool, :scheduled, :self, :field_names, :query, :query_stats, :set_session_properties, :reset_session_properties, :added_prepared_statements, :deallocated_prepared_statements, :started_transaction_id, :clear_transaction_id, :update_type, :output_stage, :failure_info, :error_code, :inputs, :output, :complete_info, :resource_group_name)
1253
+ def decode(hash)
1254
+ unless hash.is_a?(Hash)
1255
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1256
+ end
1257
+ obj = allocate
1258
+ obj.send(:initialize_struct,
1259
+ hash["queryId"],
1260
+ hash["session"] && SessionRepresentation.decode(hash["session"]),
1261
+ hash["state"] && hash["state"].downcase.to_sym,
1262
+ hash["memoryPool"],
1263
+ hash["scheduled"],
1264
+ hash["self"],
1265
+ hash["fieldNames"],
1266
+ hash["query"],
1267
+ hash["queryStats"] && QueryStats.decode(hash["queryStats"]),
1268
+ hash["setSessionProperties"],
1269
+ hash["resetSessionProperties"],
1270
+ hash["addedPreparedStatements"],
1271
+ hash["deallocatedPreparedStatements"],
1272
+ hash["startedTransactionId"],
1273
+ hash["clearTransactionId"],
1274
+ hash["updateType"],
1275
+ hash["outputStage"] && StageInfo.decode(hash["outputStage"]),
1276
+ hash["failureInfo"] && FailureInfo.decode(hash["failureInfo"]),
1277
+ hash["errorCode"] && ErrorCode.decode(hash["errorCode"]),
1278
+ hash["inputs"] && hash["inputs"].map {|h| Input.decode(h) },
1279
+ hash["output"] && Output.decode(hash["output"]),
1280
+ hash["completeInfo"],
1281
+ hash["resourceGroupName"],
1282
+ )
1283
+ obj
1284
+ end
1285
+ end
1286
+
1287
+ class << QueryResults =
1288
+ Base.new(:id, :info_uri, :partial_cancel_uri, :next_uri, :columns, :data, :stats, :error, :update_type, :update_count)
1289
+ def decode(hash)
1290
+ unless hash.is_a?(Hash)
1291
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1292
+ end
1293
+ obj = allocate
1294
+ obj.send(:initialize_struct,
1295
+ hash["id"],
1296
+ hash["infoUri"],
1297
+ hash["partialCancelUri"],
1298
+ hash["nextUri"],
1299
+ hash["columns"] && hash["columns"].map {|h| ClientColumn.decode(h) },
1300
+ hash["data"],
1301
+ hash["stats"] && StatementStats.decode(hash["stats"]),
1302
+ hash["error"] && QueryError.decode(hash["error"]),
1303
+ hash["updateType"],
1304
+ hash["updateCount"],
1305
+ )
1306
+ obj
1307
+ end
1308
+ end
1309
+
1310
+ class << QueryStats =
1311
+ Base.new(:create_time, :execution_start_time, :last_heartbeat, :end_time, :elapsed_time, :queued_time, :analysis_time, :distributed_planning_time, :total_planning_time, :finishing_time, :total_tasks, :running_tasks, :completed_tasks, :total_drivers, :queued_drivers, :running_drivers, :blocked_drivers, :completed_drivers, :cumulative_memory, :total_memory_reservation, :peak_memory_reservation, :scheduled, :total_scheduled_time, :total_cpu_time, :total_user_time, :total_blocked_time, :fully_blocked, :blocked_reasons, :raw_input_data_size, :raw_input_positions, :processed_input_data_size, :processed_input_positions, :output_data_size, :output_positions, :operator_summaries)
1312
+ def decode(hash)
1313
+ unless hash.is_a?(Hash)
1314
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1315
+ end
1316
+ obj = allocate
1317
+ obj.send(:initialize_struct,
1318
+ hash["createTime"],
1319
+ hash["executionStartTime"],
1320
+ hash["lastHeartbeat"],
1321
+ hash["endTime"],
1322
+ hash["elapsedTime"],
1323
+ hash["queuedTime"],
1324
+ hash["analysisTime"],
1325
+ hash["distributedPlanningTime"],
1326
+ hash["totalPlanningTime"],
1327
+ hash["finishingTime"],
1328
+ hash["totalTasks"],
1329
+ hash["runningTasks"],
1330
+ hash["completedTasks"],
1331
+ hash["totalDrivers"],
1332
+ hash["queuedDrivers"],
1333
+ hash["runningDrivers"],
1334
+ hash["blockedDrivers"],
1335
+ hash["completedDrivers"],
1336
+ hash["cumulativeMemory"],
1337
+ hash["totalMemoryReservation"],
1338
+ hash["peakMemoryReservation"],
1339
+ hash["scheduled"],
1340
+ hash["totalScheduledTime"],
1341
+ hash["totalCpuTime"],
1342
+ hash["totalUserTime"],
1343
+ hash["totalBlockedTime"],
1344
+ hash["fullyBlocked"],
1345
+ hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1346
+ hash["rawInputDataSize"],
1347
+ hash["rawInputPositions"],
1348
+ hash["processedInputDataSize"],
1349
+ hash["processedInputPositions"],
1350
+ hash["outputDataSize"],
1351
+ hash["outputPositions"],
1352
+ hash["operatorSummaries"] && hash["operatorSummaries"].map {|h| OperatorStats.decode(h) },
1353
+ )
1354
+ obj
1355
+ end
1356
+ end
1357
+
1358
+ class << RemoteSourceNode =
1359
+ Base.new(:id, :source_fragment_ids, :outputs)
1360
+ def decode(hash)
1361
+ unless hash.is_a?(Hash)
1362
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1363
+ end
1364
+ obj = allocate
1365
+ obj.send(:initialize_struct,
1366
+ hash["id"],
1367
+ hash["sourceFragmentIds"],
1368
+ hash["outputs"],
1369
+ )
1370
+ obj
1371
+ end
1372
+ end
1373
+
1374
+ class << RowNumberNode =
1375
+ Base.new(:id, :source, :partition_by, :row_number_symbol, :max_row_count_per_partition, :hash_symbol)
1376
+ def decode(hash)
1377
+ unless hash.is_a?(Hash)
1378
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1379
+ end
1380
+ obj = allocate
1381
+ obj.send(:initialize_struct,
1382
+ hash["id"],
1383
+ hash["source"] && PlanNode.decode(hash["source"]),
1384
+ hash["partitionBy"],
1385
+ hash["rowNumberSymbol"],
1386
+ hash["maxRowCountPerPartition"],
1387
+ hash["hashSymbol"],
1388
+ )
1389
+ obj
1390
+ end
1391
+ end
1392
+
1393
+ class << SampleNode =
1394
+ Base.new(:id, :source, :sample_ratio, :sample_type)
1395
+ def decode(hash)
1396
+ unless hash.is_a?(Hash)
1397
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1398
+ end
1399
+ obj = allocate
1400
+ obj.send(:initialize_struct,
1401
+ hash["id"],
1402
+ hash["source"] && PlanNode.decode(hash["source"]),
1403
+ hash["sampleRatio"],
1404
+ hash["sampleType"],
1405
+ )
1406
+ obj
1407
+ end
1408
+ end
1409
+
1410
+ class << SemiJoinNode =
1411
+ Base.new(:id, :source, :filtering_source, :source_join_symbol, :filtering_source_join_symbol, :semi_join_output, :source_hash_symbol, :filtering_source_hash_symbol, :distribution_type)
1412
+ def decode(hash)
1413
+ unless hash.is_a?(Hash)
1414
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1415
+ end
1416
+ obj = allocate
1417
+ obj.send(:initialize_struct,
1418
+ hash["id"],
1419
+ hash["source"] && PlanNode.decode(hash["source"]),
1420
+ hash["filteringSource"] && PlanNode.decode(hash["filteringSource"]),
1421
+ hash["sourceJoinSymbol"],
1422
+ hash["filteringSourceJoinSymbol"],
1423
+ hash["semiJoinOutput"],
1424
+ hash["sourceHashSymbol"],
1425
+ hash["filteringSourceHashSymbol"],
1426
+ hash["distributionType"] && hash["distributionType"].downcase.to_sym,
1427
+ )
1428
+ obj
1429
+ end
1430
+ end
1431
+
1432
+ class << SessionRepresentation =
1433
+ Base.new(:query_id, :transaction_id, :client_transaction_support, :user, :principal, :source, :catalog, :schema, :time_zone_key, :locale, :remote_user_address, :user_agent, :client_info, :start_time, :system_properties, :catalog_properties, :prepared_statements)
1434
+ def decode(hash)
1435
+ unless hash.is_a?(Hash)
1436
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1437
+ end
1438
+ obj = allocate
1439
+ obj.send(:initialize_struct,
1440
+ hash["queryId"],
1441
+ hash["transactionId"],
1442
+ hash["clientTransactionSupport"],
1443
+ hash["user"],
1444
+ hash["principal"],
1445
+ hash["source"],
1446
+ hash["catalog"],
1447
+ hash["schema"],
1448
+ hash["timeZoneKey"],
1449
+ hash["locale"],
1450
+ hash["remoteUserAddress"],
1451
+ hash["userAgent"],
1452
+ hash["clientInfo"],
1453
+ hash["startTime"],
1454
+ hash["systemProperties"],
1455
+ hash["catalogProperties"],
1456
+ hash["preparedStatements"],
1457
+ )
1458
+ obj
1459
+ end
1460
+ end
1461
+
1462
+ class << SortNode =
1463
+ Base.new(:id, :source, :order_by, :orderings)
1464
+ def decode(hash)
1465
+ unless hash.is_a?(Hash)
1466
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1467
+ end
1468
+ obj = allocate
1469
+ obj.send(:initialize_struct,
1470
+ hash["id"],
1471
+ hash["source"] && PlanNode.decode(hash["source"]),
1472
+ hash["orderBy"],
1473
+ hash["orderings"] && Hash[hash["orderings"].to_a.map! {|k,v| [k, v.downcase.to_sym] }],
1474
+ )
1475
+ obj
1476
+ end
1477
+ end
1478
+
1479
+ class << SplitOperatorInfo =
1480
+ Base.new(:split_info)
1481
+ def decode(hash)
1482
+ unless hash.is_a?(Hash)
1483
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1484
+ end
1485
+ obj = allocate
1486
+ obj.send(:initialize_struct,
1487
+ hash["splitInfo"],
1488
+ )
1489
+ obj
1490
+ end
1491
+ end
1492
+
1493
+ class << StageInfo =
1494
+ Base.new(:stage_id, :state, :self, :plan, :types, :stage_stats, :tasks, :sub_stages, :failure_cause)
1495
+ def decode(hash)
1496
+ unless hash.is_a?(Hash)
1497
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1498
+ end
1499
+ obj = allocate
1500
+ obj.send(:initialize_struct,
1501
+ hash["stageId"] && StageId.new(hash["stageId"]),
1502
+ hash["state"] && hash["state"].downcase.to_sym,
1503
+ hash["self"],
1504
+ hash["plan"] && PlanFragment.decode(hash["plan"]),
1505
+ hash["types"],
1506
+ hash["stageStats"] && StageStats.decode(hash["stageStats"]),
1507
+ hash["tasks"] && hash["tasks"].map {|h| TaskInfo.decode(h) },
1508
+ hash["subStages"] && hash["subStages"].map {|h| StageInfo.decode(h) },
1509
+ hash["failureCause"] && ExecutionFailureInfo.decode(hash["failureCause"]),
1510
+ )
1511
+ obj
1512
+ end
1513
+ end
1514
+
1515
+ class << StageStats =
1516
+ Base.new(:scheduling_complete, :get_split_distribution, :schedule_task_distribution, :add_split_distribution, :total_tasks, :running_tasks, :completed_tasks, :total_drivers, :queued_drivers, :running_drivers, :blocked_drivers, :completed_drivers, :cumulative_memory, :total_memory_reservation, :peak_memory_reservation, :total_scheduled_time, :total_cpu_time, :total_user_time, :total_blocked_time, :fully_blocked, :blocked_reasons, :raw_input_data_size, :raw_input_positions, :processed_input_data_size, :processed_input_positions, :buffered_data_size, :output_data_size, :output_positions, :operator_summaries)
1517
+ def decode(hash)
1518
+ unless hash.is_a?(Hash)
1519
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1520
+ end
1521
+ obj = allocate
1522
+ obj.send(:initialize_struct,
1523
+ hash["schedulingComplete"],
1524
+ hash["getSplitDistribution"] && DistributionSnapshot.decode(hash["getSplitDistribution"]),
1525
+ hash["scheduleTaskDistribution"] && DistributionSnapshot.decode(hash["scheduleTaskDistribution"]),
1526
+ hash["addSplitDistribution"] && DistributionSnapshot.decode(hash["addSplitDistribution"]),
1527
+ hash["totalTasks"],
1528
+ hash["runningTasks"],
1529
+ hash["completedTasks"],
1530
+ hash["totalDrivers"],
1531
+ hash["queuedDrivers"],
1532
+ hash["runningDrivers"],
1533
+ hash["blockedDrivers"],
1534
+ hash["completedDrivers"],
1535
+ hash["cumulativeMemory"],
1536
+ hash["totalMemoryReservation"],
1537
+ hash["peakMemoryReservation"],
1538
+ hash["totalScheduledTime"],
1539
+ hash["totalCpuTime"],
1540
+ hash["totalUserTime"],
1541
+ hash["totalBlockedTime"],
1542
+ hash["fullyBlocked"],
1543
+ hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1544
+ hash["rawInputDataSize"],
1545
+ hash["rawInputPositions"],
1546
+ hash["processedInputDataSize"],
1547
+ hash["processedInputPositions"],
1548
+ hash["bufferedDataSize"],
1549
+ hash["outputDataSize"],
1550
+ hash["outputPositions"],
1551
+ hash["operatorSummaries"] && hash["operatorSummaries"].map {|h| OperatorStats.decode(h) },
1552
+ )
1553
+ obj
1554
+ end
1555
+ end
1556
+
1557
+ class << StatementStats =
1558
+ Base.new(:state, :queued, :scheduled, :nodes, :total_splits, :queued_splits, :running_splits, :completed_splits, :user_time_millis, :cpu_time_millis, :wall_time_millis, :processed_rows, :processed_bytes, :root_stage)
1559
+ def decode(hash)
1560
+ unless hash.is_a?(Hash)
1561
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1562
+ end
1563
+ obj = allocate
1564
+ obj.send(:initialize_struct,
1565
+ hash["state"],
1566
+ hash["queued"],
1567
+ hash["scheduled"],
1568
+ hash["nodes"],
1569
+ hash["totalSplits"],
1570
+ hash["queuedSplits"],
1571
+ hash["runningSplits"],
1572
+ hash["completedSplits"],
1573
+ hash["userTimeMillis"],
1574
+ hash["cpuTimeMillis"],
1575
+ hash["wallTimeMillis"],
1576
+ hash["processedRows"],
1577
+ hash["processedBytes"],
1578
+ hash["rootStage"] && ClientStageStats.decode(hash["rootStage"]),
1579
+ )
1580
+ obj
1581
+ end
1582
+ end
1583
+
1584
+ class << TableFinishInfo =
1585
+ Base.new(:connector_output_metadata)
1586
+ def decode(hash)
1587
+ unless hash.is_a?(Hash)
1588
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1589
+ end
1590
+ obj = allocate
1591
+ obj.send(:initialize_struct,
1592
+ hash["connectorOutputMetadata"],
1593
+ )
1594
+ obj
1595
+ end
1596
+ end
1597
+
1598
+ class << TableFinishNode =
1599
+ Base.new(:id, :source, :target, :outputs)
1600
+ def decode(hash)
1601
+ unless hash.is_a?(Hash)
1602
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1603
+ end
1604
+ obj = allocate
1605
+ obj.send(:initialize_struct,
1606
+ hash["id"],
1607
+ hash["source"] && PlanNode.decode(hash["source"]),
1608
+ hash["target"] && WriterTarget.decode(hash["target"]),
1609
+ hash["outputs"],
1610
+ )
1611
+ obj
1612
+ end
1613
+ end
1614
+
1615
+ class << TableHandle =
1616
+ Base.new(:connector_id, :connector_handle)
1617
+ def decode(hash)
1618
+ unless hash.is_a?(Hash)
1619
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1620
+ end
1621
+ obj = allocate
1622
+ obj.send(:initialize_struct,
1623
+ hash["connectorId"],
1624
+ hash["connectorHandle"],
1625
+ )
1626
+ obj
1627
+ end
1628
+ end
1629
+
1630
+ class << TableLayoutHandle =
1631
+ Base.new(:connector_id, :transaction_handle, :connector_handle)
1632
+ def decode(hash)
1633
+ unless hash.is_a?(Hash)
1634
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1635
+ end
1636
+ obj = allocate
1637
+ obj.send(:initialize_struct,
1638
+ hash["connectorId"],
1639
+ hash["transactionHandle"],
1640
+ hash["connectorHandle"],
1641
+ )
1642
+ obj
1643
+ end
1644
+ end
1645
+
1646
+ class << TableScanNode =
1647
+ Base.new(:id, :table, :output_symbols, :assignments, :layout, :current_constraint, :original_constraint)
1648
+ def decode(hash)
1649
+ unless hash.is_a?(Hash)
1650
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1651
+ end
1652
+ obj = allocate
1653
+ obj.send(:initialize_struct,
1654
+ hash["id"],
1655
+ hash["table"] && TableHandle.decode(hash["table"]),
1656
+ hash["outputSymbols"],
1657
+ hash["assignments"],
1658
+ hash["layout"] && TableLayoutHandle.decode(hash["layout"]),
1659
+ hash["currentConstraint"],
1660
+ hash["originalConstraint"],
1661
+ )
1662
+ obj
1663
+ end
1664
+ end
1665
+
1666
+ class << TableWriterNode =
1667
+ Base.new(:id, :source, :target, :columns, :column_names, :outputs, :partitioning_scheme)
1668
+ def decode(hash)
1669
+ unless hash.is_a?(Hash)
1670
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1671
+ end
1672
+ obj = allocate
1673
+ obj.send(:initialize_struct,
1674
+ hash["id"],
1675
+ hash["source"] && PlanNode.decode(hash["source"]),
1676
+ hash["target"] && WriterTarget.decode(hash["target"]),
1677
+ hash["columns"],
1678
+ hash["columnNames"],
1679
+ hash["outputs"],
1680
+ hash["partitioningScheme"] && PartitioningScheme.decode(hash["partitioningScheme"]),
1681
+ )
1682
+ obj
1683
+ end
1684
+ end
1685
+
1686
+ class << TaskInfo =
1687
+ Base.new(:task_status, :last_heartbeat, :output_buffers, :no_more_splits, :stats, :needs_plan, :complete)
1688
+ def decode(hash)
1689
+ unless hash.is_a?(Hash)
1690
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1691
+ end
1692
+ obj = allocate
1693
+ obj.send(:initialize_struct,
1694
+ hash["taskStatus"] && TaskStatus.decode(hash["taskStatus"]),
1695
+ hash["lastHeartbeat"],
1696
+ hash["outputBuffers"] && OutputBufferInfo.decode(hash["outputBuffers"]),
1697
+ hash["noMoreSplits"],
1698
+ hash["stats"] && TaskStats.decode(hash["stats"]),
1699
+ hash["needsPlan"],
1700
+ hash["complete"],
1701
+ )
1702
+ obj
1703
+ end
1704
+ end
1705
+
1706
+ class << TaskStats =
1707
+ Base.new(:create_time, :first_start_time, :last_start_time, :last_end_time, :end_time, :elapsed_time, :queued_time, :total_drivers, :queued_drivers, :queued_partitioned_drivers, :running_drivers, :running_partitioned_drivers, :blocked_drivers, :completed_drivers, :cumulative_memory, :memory_reservation, :system_memory_reservation, :total_scheduled_time, :total_cpu_time, :total_user_time, :total_blocked_time, :fully_blocked, :blocked_reasons, :raw_input_data_size, :raw_input_positions, :processed_input_data_size, :processed_input_positions, :output_data_size, :output_positions, :pipelines)
1708
+ def decode(hash)
1709
+ unless hash.is_a?(Hash)
1710
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1711
+ end
1712
+ obj = allocate
1713
+ obj.send(:initialize_struct,
1714
+ hash["createTime"],
1715
+ hash["firstStartTime"],
1716
+ hash["lastStartTime"],
1717
+ hash["lastEndTime"],
1718
+ hash["endTime"],
1719
+ hash["elapsedTime"],
1720
+ hash["queuedTime"],
1721
+ hash["totalDrivers"],
1722
+ hash["queuedDrivers"],
1723
+ hash["queuedPartitionedDrivers"],
1724
+ hash["runningDrivers"],
1725
+ hash["runningPartitionedDrivers"],
1726
+ hash["blockedDrivers"],
1727
+ hash["completedDrivers"],
1728
+ hash["cumulativeMemory"],
1729
+ hash["memoryReservation"],
1730
+ hash["systemMemoryReservation"],
1731
+ hash["totalScheduledTime"],
1732
+ hash["totalCpuTime"],
1733
+ hash["totalUserTime"],
1734
+ hash["totalBlockedTime"],
1735
+ hash["fullyBlocked"],
1736
+ hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1737
+ hash["rawInputDataSize"],
1738
+ hash["rawInputPositions"],
1739
+ hash["processedInputDataSize"],
1740
+ hash["processedInputPositions"],
1741
+ hash["outputDataSize"],
1742
+ hash["outputPositions"],
1743
+ hash["pipelines"] && hash["pipelines"].map {|h| PipelineStats.decode(h) },
1744
+ )
1745
+ obj
1746
+ end
1747
+ end
1748
+
1749
+ class << TaskStatus =
1750
+ Base.new(:task_id, :task_instance_id, :version, :state, :self, :failures, :queued_partitioned_drivers, :running_partitioned_drivers, :memory_reservation)
1751
+ def decode(hash)
1752
+ unless hash.is_a?(Hash)
1753
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1754
+ end
1755
+ obj = allocate
1756
+ obj.send(:initialize_struct,
1757
+ hash["taskId"] && TaskId.new(hash["taskId"]),
1758
+ hash["taskInstanceId"],
1759
+ hash["version"],
1760
+ hash["state"] && hash["state"].downcase.to_sym,
1761
+ hash["self"],
1762
+ hash["failures"] && hash["failures"].map {|h| ExecutionFailureInfo.decode(h) },
1763
+ hash["queuedPartitionedDrivers"],
1764
+ hash["runningPartitionedDrivers"],
1765
+ hash["memoryReservation"],
1766
+ )
1767
+ obj
1768
+ end
1769
+ end
1770
+
1771
+ class << TopNNode =
1772
+ Base.new(:id, :source, :count, :order_by, :orderings, :step)
1773
+ def decode(hash)
1774
+ unless hash.is_a?(Hash)
1775
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1776
+ end
1777
+ obj = allocate
1778
+ obj.send(:initialize_struct,
1779
+ hash["id"],
1780
+ hash["source"] && PlanNode.decode(hash["source"]),
1781
+ hash["count"],
1782
+ hash["orderBy"],
1783
+ hash["orderings"] && Hash[hash["orderings"].to_a.map! {|k,v| [k, v.downcase.to_sym] }],
1784
+ hash["step"] && hash["step"].downcase.to_sym,
1785
+ )
1786
+ obj
1787
+ end
1788
+ end
1789
+
1790
+ class << TopNRowNumberNode =
1791
+ Base.new(:id, :source, :specification, :row_number_symbol, :max_row_count_per_partition, :partial, :hash_symbol)
1792
+ def decode(hash)
1793
+ unless hash.is_a?(Hash)
1794
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1795
+ end
1796
+ obj = allocate
1797
+ obj.send(:initialize_struct,
1798
+ hash["id"],
1799
+ hash["source"] && PlanNode.decode(hash["source"]),
1800
+ hash["specification"] && Specification.decode(hash["specification"]),
1801
+ hash["rowNumberSymbol"],
1802
+ hash["maxRowCountPerPartition"],
1803
+ hash["partial"],
1804
+ hash["hashSymbol"],
1805
+ )
1806
+ obj
1807
+ end
1808
+ end
1809
+
1810
+ class << UnionNode =
1811
+ Base.new(:id, :sources, :output_to_inputs, :outputs)
1812
+ def decode(hash)
1813
+ unless hash.is_a?(Hash)
1814
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1815
+ end
1816
+ obj = allocate
1817
+ obj.send(:initialize_struct,
1818
+ hash["id"],
1819
+ hash["sources"] && hash["sources"].map {|h| PlanNode.decode(h) },
1820
+ hash["outputToInputs"],
1821
+ hash["outputs"],
1822
+ )
1823
+ obj
1824
+ end
1825
+ end
1826
+
1827
+ class << UnnestNode =
1828
+ Base.new(:id, :source, :replicate_symbols, :unnest_symbols, :ordinality_symbol)
1829
+ def decode(hash)
1830
+ unless hash.is_a?(Hash)
1831
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1832
+ end
1833
+ obj = allocate
1834
+ obj.send(:initialize_struct,
1835
+ hash["id"],
1836
+ hash["source"] && PlanNode.decode(hash["source"]),
1837
+ hash["replicateSymbols"],
1838
+ hash["unnestSymbols"],
1839
+ hash["ordinalitySymbol"],
1840
+ )
1841
+ obj
1842
+ end
1843
+ end
1844
+
1845
+ class << ValuesNode =
1846
+ Base.new(:id, :output_symbols, :rows)
1847
+ def decode(hash)
1848
+ unless hash.is_a?(Hash)
1849
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1850
+ end
1851
+ obj = allocate
1852
+ obj.send(:initialize_struct,
1853
+ hash["id"],
1854
+ hash["outputSymbols"],
1855
+ hash["rows"],
1856
+ )
1857
+ obj
1858
+ end
1859
+ end
1860
+
1861
+ class << WindowNode =
1862
+ Base.new(:id, :source, :specification, :window_functions, :hash_symbol, :pre_partitioned_inputs, :pre_sorted_order_prefix)
1863
+ def decode(hash)
1864
+ unless hash.is_a?(Hash)
1865
+ raise TypeError, "Can't convert #{hash.class} to Hash"
1866
+ end
1867
+ obj = allocate
1868
+ obj.send(:initialize_struct,
1869
+ hash["id"],
1870
+ hash["source"] && PlanNode.decode(hash["source"]),
1871
+ hash["specification"] && Specification.decode(hash["specification"]),
1872
+ hash["windowFunctions"] && Hash[hash["windowFunctions"].to_a.map! {|k,v| [k, Function.decode(v)] }],
1873
+ hash["hashSymbol"],
1874
+ hash["prePartitionedInputs"],
1875
+ hash["preSortedOrderPrefix"],
1876
+ )
1877
+ obj
1878
+ end
1879
+ end
1880
+
1881
+
1882
+ end
1883
+ end