presto-client 0.4.17 → 0.5.0

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.
@@ -16,1687 +16,17 @@
16
16
  module Presto::Client
17
17
 
18
18
  ####
19
- ## lib/presto/client/models.rb is automatically generated using "rake modelgen" command.
19
+ ## lib/presto/client/models.rb is automatically generated using "rake modelgen:latest" command.
20
20
  ## You should not edit this file directly. To modify the class definitions, edit
21
- ## modelgen/models.rb file and run "rake modelgen".
21
+ ## modelgen/models.rb file and run "rake modelgen:latest".
22
22
  ##
23
23
 
24
- module Models
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
- end
117
- if model_class
118
- node = model_class.decode(hash)
119
- class << node
120
- attr_accessor :plan_node_type
121
- end
122
- node.plan_node_type = hash['@type']
123
- node
124
- end
125
- end
126
- end
127
-
128
- # io.airlift.stats.Distribution.DistributionSnapshot
129
- class << DistributionSnapshot =
130
- Base.new(:max_error, :count, :total, :p01, :p05, :p10, :p25, :p50, :p75, :p90, :p95, :p99, :min, :max)
131
- def decode(hash)
132
- unless hash.is_a?(Hash)
133
- raise TypeError, "Can't convert #{hash.class} to Hash"
134
- end
135
- obj = allocate
136
- obj.send(:initialize_struct,
137
- hash["maxError"],
138
- hash["count"],
139
- hash["total"],
140
- hash["p01"],
141
- hash["p05"],
142
- hash["p10"],
143
- hash["p25"],
144
- hash["p50"],
145
- hash["p75"],
146
- hash["p90"],
147
- hash["p95"],
148
- hash["p99"],
149
- hash["min"],
150
- hash["max"],
151
- )
152
- obj
153
- end
154
- end
155
-
156
- # This is a hybrid of JoinNode.EquiJoinClause and IndexJoinNode.EquiJoinClause
157
- class << EquiJoinClause =
158
- Base.new(:left, :right, :probe, :index)
159
- def decode(hash)
160
- unless hash.is_a?(Hash)
161
- raise TypeError, "Can't convert #{hash.class} to Hash"
162
- end
163
- obj = allocate
164
- obj.send(:initialize_struct,
165
- hash["left"],
166
- hash["right"],
167
- hash["probe"],
168
- hash["index"],
169
- )
170
- obj
171
- end
172
- end
173
-
174
- class << WriterTarget =
175
- Base.new(:type, :handle)
176
- def decode(hash)
177
- unless hash.is_a?(Hash)
178
- raise TypeError, "Can't convert #{hash.class} to Hash"
179
- end
180
- obj = allocate
181
- model_class = case hash["@type"]
182
- when "CreateHandle" then OutputTableHandle
183
- when "InsertHandle" then InsertTableHandle
184
- when "DeleteHandle" then TableHandle
185
- end
186
- obj.send(:initialize_struct,
187
- hash["@type"],
188
- model_class.decode(hash['handle'])
189
- )
190
- obj
191
- end
192
- end
193
-
194
- class << DeleteHandle =
195
- Base.new(:handle)
196
- def decode(hash)
197
- unless hash.is_a?(Hash)
198
- raise TypeError, "Can't convert #{hash.class} to Hash"
199
- end
200
- obj = allocate
201
- obj.send(:initialize_struct,
202
- TableHandle.decode(hash['handle'])
203
- )
204
- obj
205
- end
206
- end
207
-
208
- # Inner classes
209
- class << Specification =
210
- Base.new(:partition_by, :order_by, :orderings, :frame, :pages_added)
211
- def decode(hash)
212
- unless hash.is_a?(Hash)
213
- raise TypeError, "Can't convert #{hash.class} to Hash"
214
- end
215
- obj = allocate
216
- obj.send(:initialize_struct,
217
- hash["partitionBy"],
218
- hash["orderBy"],
219
- hash["orderings"],
220
- hash["frame"],
221
- )
222
- obj
223
- end
224
- end
225
-
226
- class << ArgumentBinding =
227
- Base.new(:column, :constant)
228
- def decode(hash)
229
- unless hash.is_a?(Hash)
230
- raise TypeError, "Can't convert #{hash.class} to Hash"
231
- end
232
- obj = allocate
233
- obj.send(:initialize_struct,
234
- hash["column"],
235
- hash["constant"]
236
- )
237
- obj
238
- end
239
- end
240
-
241
- ##
242
- # Those model classes are automatically generated
243
- #
244
-
245
- class << AggregationNode =
246
- Base.new(:id, :source, :group_by, :aggregations, :functions, :masks, :grouping_sets, :step, :sample_weight, :confidence, :hash_symbol)
247
- def decode(hash)
248
- unless hash.is_a?(Hash)
249
- raise TypeError, "Can't convert #{hash.class} to Hash"
250
- end
251
- obj = allocate
252
- obj.send(:initialize_struct,
253
- hash["id"],
254
- hash["source"] && PlanNode.decode(hash["source"]),
255
- hash["groupBy"],
256
- hash["aggregations"],
257
- hash["functions"] && Hash[hash["functions"].to_a.map! {|k,v| [k, Signature.decode(v)] }],
258
- hash["masks"],
259
- hash["groupingSets"],
260
- hash["step"] && hash["step"].downcase.to_sym,
261
- hash["sampleWeight"],
262
- hash["confidence"],
263
- hash["hashSymbol"],
264
- )
265
- obj
266
- end
267
- end
268
-
269
- class << ApplyNode =
270
- Base.new(:id, :input, :subquery, :correlation)
271
- def decode(hash)
272
- unless hash.is_a?(Hash)
273
- raise TypeError, "Can't convert #{hash.class} to Hash"
274
- end
275
- obj = allocate
276
- obj.send(:initialize_struct,
277
- hash["id"],
278
- hash["input"] && PlanNode.decode(hash["input"]),
279
- hash["subquery"] && PlanNode.decode(hash["subquery"]),
280
- hash["correlation"],
281
- )
282
- obj
283
- end
284
- end
285
-
286
- class << BufferInfo =
287
- Base.new(:buffer_id, :finished, :buffered_pages, :pages_sent, :page_buffer_info)
288
- def decode(hash)
289
- unless hash.is_a?(Hash)
290
- raise TypeError, "Can't convert #{hash.class} to Hash"
291
- end
292
- obj = allocate
293
- obj.send(:initialize_struct,
294
- hash["bufferId"],
295
- hash["finished"],
296
- hash["bufferedPages"],
297
- hash["pagesSent"],
298
- hash["pageBufferInfo"] && PageBufferInfo.decode(hash["pageBufferInfo"]),
299
- )
300
- obj
301
- end
302
- end
303
-
304
- class << ClientColumn =
305
- Base.new(:name, :type, :type_signature)
306
- def decode(hash)
307
- unless hash.is_a?(Hash)
308
- raise TypeError, "Can't convert #{hash.class} to Hash"
309
- end
310
- obj = allocate
311
- obj.send(:initialize_struct,
312
- hash["name"],
313
- hash["type"],
314
- hash["typeSignature"] && ClientTypeSignature.decode(hash["typeSignature"]),
315
- )
316
- obj
317
- end
318
- end
319
-
320
- class << ClientStageStats =
321
- 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)
322
- def decode(hash)
323
- unless hash.is_a?(Hash)
324
- raise TypeError, "Can't convert #{hash.class} to Hash"
325
- end
326
- obj = allocate
327
- obj.send(:initialize_struct,
328
- hash["stageId"],
329
- hash["state"],
330
- hash["done"],
331
- hash["nodes"],
332
- hash["totalSplits"],
333
- hash["queuedSplits"],
334
- hash["runningSplits"],
335
- hash["completedSplits"],
336
- hash["userTimeMillis"],
337
- hash["cpuTimeMillis"],
338
- hash["wallTimeMillis"],
339
- hash["processedRows"],
340
- hash["processedBytes"],
341
- hash["subStages"] && hash["subStages"].map {|h| ClientStageStats.decode(h) },
342
- )
343
- obj
344
- end
345
- end
346
-
347
- class << ClientTypeSignature =
348
- Base.new(:raw_type, :type_arguments, :literal_arguments, :arguments)
349
- def decode(hash)
350
- unless hash.is_a?(Hash)
351
- raise TypeError, "Can't convert #{hash.class} to Hash"
352
- end
353
- obj = allocate
354
- obj.send(:initialize_struct,
355
- hash["rawType"],
356
- hash["typeArguments"] && hash["typeArguments"].map {|h| ClientTypeSignature.decode(h) },
357
- hash["literalArguments"],
358
- hash["arguments"] && hash["arguments"].map {|h| ClientTypeSignatureParameter.decode(h) },
359
- )
360
- obj
361
- end
362
- end
363
-
364
- class << ClientTypeSignatureParameter =
365
- Base.new(:kind, :value)
366
- def decode(hash)
367
- unless hash.is_a?(Hash)
368
- raise TypeError, "Can't convert #{hash.class} to Hash"
369
- end
370
- obj = allocate
371
- obj.send(:initialize_struct,
372
- hash["kind"] && hash["kind"].downcase.to_sym,
373
- hash["value"],
374
- )
375
- obj
376
- end
377
- end
378
-
379
- class << Column =
380
- Base.new(:name, :type)
381
- def decode(hash)
382
- unless hash.is_a?(Hash)
383
- raise TypeError, "Can't convert #{hash.class} to Hash"
384
- end
385
- obj = allocate
386
- obj.send(:initialize_struct,
387
- hash["name"],
388
- hash["type"],
389
- )
390
- obj
391
- end
392
- end
393
-
394
- class << DeleteNode =
395
- Base.new(:id, :source, :target, :row_id, :outputs)
396
- def decode(hash)
397
- unless hash.is_a?(Hash)
398
- raise TypeError, "Can't convert #{hash.class} to Hash"
399
- end
400
- obj = allocate
401
- obj.send(:initialize_struct,
402
- hash["id"],
403
- hash["source"] && PlanNode.decode(hash["source"]),
404
- hash["target"] && DeleteHandle.decode(hash["target"]),
405
- hash["rowId"],
406
- hash["outputs"],
407
- )
408
- obj
409
- end
410
- end
411
-
412
- class << DistinctLimitNode =
413
- Base.new(:id, :source, :limit, :partial, :hash_symbol)
414
- def decode(hash)
415
- unless hash.is_a?(Hash)
416
- raise TypeError, "Can't convert #{hash.class} to Hash"
417
- end
418
- obj = allocate
419
- obj.send(:initialize_struct,
420
- hash["id"],
421
- hash["source"] && PlanNode.decode(hash["source"]),
422
- hash["limit"],
423
- hash["partial"],
424
- hash["hashSymbol"],
425
- )
426
- obj
427
- end
428
- end
429
-
430
- class << DriverStats =
431
- Base.new(:create_time, :start_time, :end_time, :queued_time, :elapsed_time, :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)
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["createTime"],
439
- hash["startTime"],
440
- hash["endTime"],
441
- hash["queuedTime"],
442
- hash["elapsedTime"],
443
- hash["memoryReservation"],
444
- hash["systemMemoryReservation"],
445
- hash["totalScheduledTime"],
446
- hash["totalCpuTime"],
447
- hash["totalUserTime"],
448
- hash["totalBlockedTime"],
449
- hash["fullyBlocked"],
450
- hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
451
- hash["rawInputDataSize"],
452
- hash["rawInputPositions"],
453
- hash["rawInputReadTime"],
454
- hash["processedInputDataSize"],
455
- hash["processedInputPositions"],
456
- hash["outputDataSize"],
457
- hash["outputPositions"],
458
- hash["operatorStats"] && hash["operatorStats"].map {|h| OperatorStats.decode(h) },
459
- )
460
- obj
461
- end
462
- end
463
-
464
- class << EnforceSingleRowNode =
465
- Base.new(:id, :source)
466
- def decode(hash)
467
- unless hash.is_a?(Hash)
468
- raise TypeError, "Can't convert #{hash.class} to Hash"
469
- end
470
- obj = allocate
471
- obj.send(:initialize_struct,
472
- hash["id"],
473
- hash["source"] && PlanNode.decode(hash["source"]),
474
- )
475
- obj
476
- end
477
- end
478
-
479
- class << ErrorCode =
480
- Base.new(:code, :name, :type)
481
- def decode(hash)
482
- unless hash.is_a?(Hash)
483
- raise TypeError, "Can't convert #{hash.class} to Hash"
484
- end
485
- obj = allocate
486
- obj.send(:initialize_struct,
487
- hash["code"],
488
- hash["name"],
489
- hash["type"] && hash["type"].downcase.to_sym,
490
- )
491
- obj
492
- end
493
- end
494
-
495
- class << ErrorLocation =
496
- Base.new(:line_number, :column_number)
497
- def decode(hash)
498
- unless hash.is_a?(Hash)
499
- raise TypeError, "Can't convert #{hash.class} to Hash"
500
- end
501
- obj = allocate
502
- obj.send(:initialize_struct,
503
- hash["lineNumber"],
504
- hash["columnNumber"],
505
- )
506
- obj
507
- end
508
- end
509
-
510
- class << ExchangeNode =
511
- Base.new(:id, :type, :scope, :partitioning_scheme, :sources, :inputs)
512
- def decode(hash)
513
- unless hash.is_a?(Hash)
514
- raise TypeError, "Can't convert #{hash.class} to Hash"
515
- end
516
- obj = allocate
517
- obj.send(:initialize_struct,
518
- hash["id"],
519
- hash["type"],
520
- hash["scope"] && hash["scope"].downcase.to_sym,
521
- hash["partitioningScheme"] && PartitioningScheme.decode(hash["partitioningScheme"]),
522
- hash["sources"] && hash["sources"].map {|h| PlanNode.decode(h) },
523
- hash["inputs"],
524
- )
525
- obj
526
- end
527
- end
528
-
529
- class << ExecutionFailureInfo =
530
- Base.new(:type, :message, :cause, :suppressed, :stack, :error_location, :error_code)
531
- def decode(hash)
532
- unless hash.is_a?(Hash)
533
- raise TypeError, "Can't convert #{hash.class} to Hash"
534
- end
535
- obj = allocate
536
- obj.send(:initialize_struct,
537
- hash["type"],
538
- hash["message"],
539
- hash["cause"] && ExecutionFailureInfo.decode(hash["cause"]),
540
- hash["suppressed"] && hash["suppressed"].map {|h| ExecutionFailureInfo.decode(h) },
541
- hash["stack"],
542
- hash["errorLocation"] && ErrorLocation.decode(hash["errorLocation"]),
543
- hash["errorCode"] && ErrorCode.decode(hash["errorCode"]),
544
- )
545
- obj
546
- end
547
- end
548
-
549
- class << ExplainAnalyzeNode =
550
- Base.new(:id, :source, :output_symbol)
551
- def decode(hash)
552
- unless hash.is_a?(Hash)
553
- raise TypeError, "Can't convert #{hash.class} to Hash"
554
- end
555
- obj = allocate
556
- obj.send(:initialize_struct,
557
- hash["id"],
558
- hash["source"] && PlanNode.decode(hash["source"]),
559
- hash["outputSymbol"],
560
- )
561
- obj
562
- end
563
- end
564
-
565
- class << FailureInfo =
566
- Base.new(:type, :message, :cause, :suppressed, :stack, :error_location)
567
- def decode(hash)
568
- unless hash.is_a?(Hash)
569
- raise TypeError, "Can't convert #{hash.class} to Hash"
570
- end
571
- obj = allocate
572
- obj.send(:initialize_struct,
573
- hash["type"],
574
- hash["message"],
575
- hash["cause"] && FailureInfo.decode(hash["cause"]),
576
- hash["suppressed"] && hash["suppressed"].map {|h| FailureInfo.decode(h) },
577
- hash["stack"],
578
- hash["errorLocation"] && ErrorLocation.decode(hash["errorLocation"]),
579
- )
580
- obj
581
- end
582
- end
583
-
584
- class << FilterNode =
585
- Base.new(:id, :source, :predicate)
586
- def decode(hash)
587
- unless hash.is_a?(Hash)
588
- raise TypeError, "Can't convert #{hash.class} to Hash"
589
- end
590
- obj = allocate
591
- obj.send(:initialize_struct,
592
- hash["id"],
593
- hash["source"] && PlanNode.decode(hash["source"]),
594
- hash["predicate"],
595
- )
596
- obj
597
- end
598
- end
599
-
600
- class << GroupIdNode =
601
- Base.new(:id, :source, :grouping_sets, :identity_mappings, :group_id_symbol)
602
- def decode(hash)
603
- unless hash.is_a?(Hash)
604
- raise TypeError, "Can't convert #{hash.class} to Hash"
605
- end
606
- obj = allocate
607
- obj.send(:initialize_struct,
608
- hash["id"],
609
- hash["source"] && PlanNode.decode(hash["source"]),
610
- hash["groupingSets"],
611
- hash["identityMappings"],
612
- hash["groupIdSymbol"],
613
- )
614
- obj
615
- end
616
- end
617
-
618
- class << IndexHandle =
619
- Base.new(:connector_id, :transaction_handle, :connector_handle)
620
- def decode(hash)
621
- unless hash.is_a?(Hash)
622
- raise TypeError, "Can't convert #{hash.class} to Hash"
623
- end
624
- obj = allocate
625
- obj.send(:initialize_struct,
626
- hash["connectorId"],
627
- hash["transactionHandle"],
628
- hash["connectorHandle"],
629
- )
630
- obj
631
- end
632
- end
633
-
634
- class << IndexJoinNode =
635
- Base.new(:id, :type, :probe_source, :index_source, :criteria, :probe_hash_symbol, :index_hash_symbol)
636
- def decode(hash)
637
- unless hash.is_a?(Hash)
638
- raise TypeError, "Can't convert #{hash.class} to Hash"
639
- end
640
- obj = allocate
641
- obj.send(:initialize_struct,
642
- hash["id"],
643
- hash["type"],
644
- hash["probeSource"] && PlanNode.decode(hash["probeSource"]),
645
- hash["indexSource"] && PlanNode.decode(hash["indexSource"]),
646
- hash["criteria"] && hash["criteria"].map {|h| EquiJoinClause.decode(h) },
647
- hash["probeHashSymbol"],
648
- hash["indexHashSymbol"],
649
- )
650
- obj
651
- end
652
- end
653
-
654
- class << IndexSourceNode =
655
- Base.new(:id, :index_handle, :table_handle, :lookup_symbols, :output_symbols, :assignments, :effective_tuple_domain)
656
- def decode(hash)
657
- unless hash.is_a?(Hash)
658
- raise TypeError, "Can't convert #{hash.class} to Hash"
659
- end
660
- obj = allocate
661
- obj.send(:initialize_struct,
662
- hash["id"],
663
- hash["indexHandle"] && IndexHandle.decode(hash["indexHandle"]),
664
- hash["tableHandle"] && TableHandle.decode(hash["tableHandle"]),
665
- hash["lookupSymbols"],
666
- hash["outputSymbols"],
667
- hash["assignments"],
668
- hash["effectiveTupleDomain"],
669
- )
670
- obj
671
- end
672
- end
673
-
674
- class << Input =
675
- Base.new(:connector_id, :schema, :table, :columns)
676
- def decode(hash)
677
- unless hash.is_a?(Hash)
678
- raise TypeError, "Can't convert #{hash.class} to Hash"
679
- end
680
- obj = allocate
681
- obj.send(:initialize_struct,
682
- hash["connectorId"],
683
- hash["schema"],
684
- hash["table"],
685
- hash["columns"] && hash["columns"].map {|h| Column.decode(h) },
686
- )
687
- obj
688
- end
689
- end
690
-
691
- class << InsertTableHandle =
692
- Base.new(:connector_id, :transaction_handle, :connector_handle)
693
- def decode(hash)
694
- unless hash.is_a?(Hash)
695
- raise TypeError, "Can't convert #{hash.class} to Hash"
696
- end
697
- obj = allocate
698
- obj.send(:initialize_struct,
699
- hash["connectorId"],
700
- hash["transactionHandle"],
701
- hash["connectorHandle"],
702
- )
703
- obj
704
- end
705
- end
706
-
707
- class << IntersectNode =
708
- Base.new(:id, :sources, :output_to_inputs, :outputs)
709
- def decode(hash)
710
- unless hash.is_a?(Hash)
711
- raise TypeError, "Can't convert #{hash.class} to Hash"
712
- end
713
- obj = allocate
714
- obj.send(:initialize_struct,
715
- hash["id"],
716
- hash["sources"] && hash["sources"].map {|h| PlanNode.decode(h) },
717
- hash["outputToInputs"],
718
- hash["outputs"],
719
- )
720
- obj
721
- end
722
- end
723
-
724
- class << JoinNode =
725
- Base.new(:id, :type, :left, :right, :criteria, :filter, :left_hash_symbol, :right_hash_symbol)
726
- def decode(hash)
727
- unless hash.is_a?(Hash)
728
- raise TypeError, "Can't convert #{hash.class} to Hash"
729
- end
730
- obj = allocate
731
- obj.send(:initialize_struct,
732
- hash["id"],
733
- hash["type"],
734
- hash["left"] && PlanNode.decode(hash["left"]),
735
- hash["right"] && PlanNode.decode(hash["right"]),
736
- hash["criteria"] && hash["criteria"].map {|h| EquiJoinClause.decode(h) },
737
- hash["filter"],
738
- hash["leftHashSymbol"],
739
- hash["rightHashSymbol"],
740
- )
741
- obj
742
- end
743
- end
744
-
745
- class << LimitNode =
746
- Base.new(:id, :source, :count, :partial)
747
- def decode(hash)
748
- unless hash.is_a?(Hash)
749
- raise TypeError, "Can't convert #{hash.class} to Hash"
750
- end
751
- obj = allocate
752
- obj.send(:initialize_struct,
753
- hash["id"],
754
- hash["source"] && PlanNode.decode(hash["source"]),
755
- hash["count"],
756
- hash["partial"],
757
- )
758
- obj
759
- end
760
- end
761
-
762
- class << LongVariableConstraint =
763
- Base.new(:name, :expression)
764
- def decode(hash)
765
- unless hash.is_a?(Hash)
766
- raise TypeError, "Can't convert #{hash.class} to Hash"
767
- end
768
- obj = allocate
769
- obj.send(:initialize_struct,
770
- hash["name"],
771
- hash["expression"],
772
- )
773
- obj
774
- end
775
- end
776
-
777
- class << MarkDistinctNode =
778
- Base.new(:id, :source, :marker_symbol, :distinct_symbols, :hash_symbol)
779
- def decode(hash)
780
- unless hash.is_a?(Hash)
781
- raise TypeError, "Can't convert #{hash.class} to Hash"
782
- end
783
- obj = allocate
784
- obj.send(:initialize_struct,
785
- hash["id"],
786
- hash["source"] && PlanNode.decode(hash["source"]),
787
- hash["markerSymbol"],
788
- hash["distinctSymbols"],
789
- hash["hashSymbol"],
790
- )
791
- obj
792
- end
793
- end
794
-
795
- class << MetadataDeleteNode =
796
- Base.new(:id, :target, :output, :table_layout)
797
- def decode(hash)
798
- unless hash.is_a?(Hash)
799
- raise TypeError, "Can't convert #{hash.class} to Hash"
800
- end
801
- obj = allocate
802
- obj.send(:initialize_struct,
803
- hash["id"],
804
- hash["target"] && DeleteHandle.decode(hash["target"]),
805
- hash["output"],
806
- hash["tableLayout"] && TableLayoutHandle.decode(hash["tableLayout"]),
807
- )
808
- obj
809
- end
810
- end
811
-
812
- class << OperatorStats =
813
- Base.new(:operator_id, :plan_node_id, :operator_type, :add_input_calls, :add_input_wall, :add_input_cpu, :add_input_user, :input_data_size, :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)
814
- def decode(hash)
815
- unless hash.is_a?(Hash)
816
- raise TypeError, "Can't convert #{hash.class} to Hash"
817
- end
818
- obj = allocate
819
- obj.send(:initialize_struct,
820
- hash["operatorId"],
821
- hash["planNodeId"],
822
- hash["operatorType"],
823
- hash["addInputCalls"],
824
- hash["addInputWall"],
825
- hash["addInputCpu"],
826
- hash["addInputUser"],
827
- hash["inputDataSize"],
828
- hash["inputPositions"],
829
- hash["getOutputCalls"],
830
- hash["getOutputWall"],
831
- hash["getOutputCpu"],
832
- hash["getOutputUser"],
833
- hash["outputDataSize"],
834
- hash["outputPositions"],
835
- hash["blockedWall"],
836
- hash["finishCalls"],
837
- hash["finishWall"],
838
- hash["finishCpu"],
839
- hash["finishUser"],
840
- hash["memoryReservation"],
841
- hash["systemMemoryReservation"],
842
- hash["blockedReason"] && BlockedReason.decode(hash["blockedReason"]),
843
- hash["info"],
844
- )
845
- obj
846
- end
847
- end
848
-
849
- class << OutputBufferInfo =
850
- Base.new(:type, :state, :can_add_buffers, :can_add_pages, :total_buffered_bytes, :total_buffered_pages, :total_rows_sent, :total_pages_sent, :buffers)
851
- def decode(hash)
852
- unless hash.is_a?(Hash)
853
- raise TypeError, "Can't convert #{hash.class} to Hash"
854
- end
855
- obj = allocate
856
- obj.send(:initialize_struct,
857
- hash["type"],
858
- hash["state"] && hash["state"].downcase.to_sym,
859
- hash["canAddBuffers"],
860
- hash["canAddPages"],
861
- hash["totalBufferedBytes"],
862
- hash["totalBufferedPages"],
863
- hash["totalRowsSent"],
864
- hash["totalPagesSent"],
865
- hash["buffers"] && hash["buffers"].map {|h| BufferInfo.decode(h) },
866
- )
867
- obj
868
- end
869
- end
870
-
871
- class << OutputNode =
872
- Base.new(:id, :source, :columns, :outputs)
873
- def decode(hash)
874
- unless hash.is_a?(Hash)
875
- raise TypeError, "Can't convert #{hash.class} to Hash"
876
- end
877
- obj = allocate
878
- obj.send(:initialize_struct,
879
- hash["id"],
880
- hash["source"] && PlanNode.decode(hash["source"]),
881
- hash["columns"],
882
- hash["outputs"],
883
- )
884
- obj
885
- end
886
- end
887
-
888
- class << OutputTableHandle =
889
- Base.new(:connector_id, :transaction_handle, :connector_handle)
890
- def decode(hash)
891
- unless hash.is_a?(Hash)
892
- raise TypeError, "Can't convert #{hash.class} to Hash"
893
- end
894
- obj = allocate
895
- obj.send(:initialize_struct,
896
- hash["connectorId"],
897
- hash["transactionHandle"],
898
- hash["connectorHandle"],
899
- )
900
- obj
901
- end
902
- end
903
-
904
- class << PageBufferInfo =
905
- Base.new(:partition, :buffered_pages, :buffered_bytes, :rows_added, :pages_added)
906
- def decode(hash)
907
- unless hash.is_a?(Hash)
908
- raise TypeError, "Can't convert #{hash.class} to Hash"
909
- end
910
- obj = allocate
911
- obj.send(:initialize_struct,
912
- hash["partition"],
913
- hash["bufferedPages"],
914
- hash["bufferedBytes"],
915
- hash["rowsAdded"],
916
- hash["pagesAdded"],
917
- )
918
- obj
919
- end
920
- end
921
-
922
- class << Partitioning =
923
- Base.new(:handle, :arguments)
924
- def decode(hash)
925
- unless hash.is_a?(Hash)
926
- raise TypeError, "Can't convert #{hash.class} to Hash"
927
- end
928
- obj = allocate
929
- obj.send(:initialize_struct,
930
- hash["handle"] && PartitioningHandle.decode(hash["handle"]),
931
- hash["arguments"] && hash["arguments"].map {|h| ArgumentBinding.decode(h) },
932
- )
933
- obj
934
- end
935
- end
936
-
937
- class << PartitioningHandle =
938
- Base.new(:connector_id, :transaction_handle, :connector_handle)
939
- def decode(hash)
940
- unless hash.is_a?(Hash)
941
- raise TypeError, "Can't convert #{hash.class} to Hash"
942
- end
943
- obj = allocate
944
- obj.send(:initialize_struct,
945
- hash["connectorId"],
946
- hash["transactionHandle"],
947
- hash["connectorHandle"],
948
- )
949
- obj
950
- end
951
- end
952
-
953
- class << PartitioningScheme =
954
- Base.new(:partitioning, :output_layout, :hash_column, :replicate_nulls, :bucket_to_partition)
955
- def decode(hash)
956
- unless hash.is_a?(Hash)
957
- raise TypeError, "Can't convert #{hash.class} to Hash"
958
- end
959
- obj = allocate
960
- obj.send(:initialize_struct,
961
- hash["partitioning"] && Partitioning.decode(hash["partitioning"]),
962
- hash["outputLayout"],
963
- hash["hashColumn"],
964
- hash["replicateNulls"],
965
- hash["bucketToPartition"],
966
- )
967
- obj
968
- end
969
- end
970
-
971
- class << PipelineStats =
972
- Base.new(: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, :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)
973
- def decode(hash)
974
- unless hash.is_a?(Hash)
975
- raise TypeError, "Can't convert #{hash.class} to Hash"
976
- end
977
- obj = allocate
978
- obj.send(:initialize_struct,
979
- hash["firstStartTime"],
980
- hash["lastStartTime"],
981
- hash["lastEndTime"],
982
- hash["inputPipeline"],
983
- hash["outputPipeline"],
984
- hash["totalDrivers"],
985
- hash["queuedDrivers"],
986
- hash["queuedPartitionedDrivers"],
987
- hash["runningDrivers"],
988
- hash["runningPartitionedDrivers"],
989
- hash["completedDrivers"],
990
- hash["memoryReservation"],
991
- hash["systemMemoryReservation"],
992
- hash["queuedTime"] && DistributionSnapshot.decode(hash["queuedTime"]),
993
- hash["elapsedTime"] && DistributionSnapshot.decode(hash["elapsedTime"]),
994
- hash["totalScheduledTime"],
995
- hash["totalCpuTime"],
996
- hash["totalUserTime"],
997
- hash["totalBlockedTime"],
998
- hash["fullyBlocked"],
999
- hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1000
- hash["rawInputDataSize"],
1001
- hash["rawInputPositions"],
1002
- hash["processedInputDataSize"],
1003
- hash["processedInputPositions"],
1004
- hash["outputDataSize"],
1005
- hash["outputPositions"],
1006
- hash["operatorSummaries"] && hash["operatorSummaries"].map {|h| OperatorStats.decode(h) },
1007
- hash["drivers"] && hash["drivers"].map {|h| DriverStats.decode(h) },
1008
- )
1009
- obj
1010
- end
1011
- end
1012
-
1013
- class << PlanFragment =
1014
- Base.new(:id, :root, :symbols, :partitioning, :partitioned_sources, :partitioning_scheme)
1015
- def decode(hash)
1016
- unless hash.is_a?(Hash)
1017
- raise TypeError, "Can't convert #{hash.class} to Hash"
1018
- end
1019
- obj = allocate
1020
- obj.send(:initialize_struct,
1021
- hash["id"],
1022
- hash["root"] && PlanNode.decode(hash["root"]),
1023
- hash["symbols"],
1024
- hash["partitioning"] && PartitioningHandle.decode(hash["partitioning"]),
1025
- hash["partitionedSources"],
1026
- hash["partitioningScheme"] && PartitioningScheme.decode(hash["partitioningScheme"]),
1027
- )
1028
- obj
1029
- end
1030
- end
1031
-
1032
- class << ProjectNode =
1033
- Base.new(:id, :source, :assignments)
1034
- def decode(hash)
1035
- unless hash.is_a?(Hash)
1036
- raise TypeError, "Can't convert #{hash.class} to Hash"
1037
- end
1038
- obj = allocate
1039
- obj.send(:initialize_struct,
1040
- hash["id"],
1041
- hash["source"] && PlanNode.decode(hash["source"]),
1042
- hash["assignments"],
1043
- )
1044
- obj
1045
- end
1046
- end
1047
-
1048
- class << QueryError =
1049
- Base.new(:message, :sql_state, :error_code, :error_name, :error_type, :error_location, :failure_info)
1050
- def decode(hash)
1051
- unless hash.is_a?(Hash)
1052
- raise TypeError, "Can't convert #{hash.class} to Hash"
1053
- end
1054
- obj = allocate
1055
- obj.send(:initialize_struct,
1056
- hash["message"],
1057
- hash["sqlState"],
1058
- hash["errorCode"],
1059
- hash["errorName"],
1060
- hash["errorType"],
1061
- hash["errorLocation"] && ErrorLocation.decode(hash["errorLocation"]),
1062
- hash["failureInfo"] && FailureInfo.decode(hash["failureInfo"]),
1063
- )
1064
- obj
1065
- end
1066
- end
1067
-
1068
- class << QueryInfo =
1069
- 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)
1070
- def decode(hash)
1071
- unless hash.is_a?(Hash)
1072
- raise TypeError, "Can't convert #{hash.class} to Hash"
1073
- end
1074
- obj = allocate
1075
- obj.send(:initialize_struct,
1076
- hash["queryId"],
1077
- hash["session"] && SessionRepresentation.decode(hash["session"]),
1078
- hash["state"] && hash["state"].downcase.to_sym,
1079
- hash["memoryPool"],
1080
- hash["scheduled"],
1081
- hash["self"],
1082
- hash["fieldNames"],
1083
- hash["query"],
1084
- hash["queryStats"] && QueryStats.decode(hash["queryStats"]),
1085
- hash["setSessionProperties"],
1086
- hash["resetSessionProperties"],
1087
- hash["addedPreparedStatements"],
1088
- hash["deallocatedPreparedStatements"],
1089
- hash["startedTransactionId"],
1090
- hash["clearTransactionId"],
1091
- hash["updateType"],
1092
- hash["outputStage"] && StageInfo.decode(hash["outputStage"]),
1093
- hash["failureInfo"] && FailureInfo.decode(hash["failureInfo"]),
1094
- hash["errorCode"] && ErrorCode.decode(hash["errorCode"]),
1095
- hash["inputs"] && hash["inputs"].map {|h| Input.decode(h) },
1096
- )
1097
- obj
1098
- end
1099
- end
1100
-
1101
- class << QueryResults =
1102
- Base.new(:id, :info_uri, :partial_cancel_uri, :next_uri, :columns, :data, :stats, :error, :update_type, :update_count)
1103
- def decode(hash)
1104
- unless hash.is_a?(Hash)
1105
- raise TypeError, "Can't convert #{hash.class} to Hash"
1106
- end
1107
- obj = allocate
1108
- obj.send(:initialize_struct,
1109
- hash["id"],
1110
- hash["infoUri"],
1111
- hash["partialCancelUri"],
1112
- hash["nextUri"],
1113
- hash["columns"] && hash["columns"].map {|h| ClientColumn.decode(h) },
1114
- hash["data"],
1115
- hash["stats"] && StatementStats.decode(hash["stats"]),
1116
- hash["error"] && QueryError.decode(hash["error"]),
1117
- hash["updateType"],
1118
- hash["updateCount"],
1119
- )
1120
- obj
1121
- end
1122
- end
1123
-
1124
- class << QueryStats =
1125
- 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, :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, :output_data_size, :output_positions)
1126
- def decode(hash)
1127
- unless hash.is_a?(Hash)
1128
- raise TypeError, "Can't convert #{hash.class} to Hash"
1129
- end
1130
- obj = allocate
1131
- obj.send(:initialize_struct,
1132
- hash["createTime"],
1133
- hash["executionStartTime"],
1134
- hash["lastHeartbeat"],
1135
- hash["endTime"],
1136
- hash["elapsedTime"],
1137
- hash["queuedTime"],
1138
- hash["analysisTime"],
1139
- hash["distributedPlanningTime"],
1140
- hash["totalPlanningTime"],
1141
- hash["finishingTime"],
1142
- hash["totalTasks"],
1143
- hash["runningTasks"],
1144
- hash["completedTasks"],
1145
- hash["totalDrivers"],
1146
- hash["queuedDrivers"],
1147
- hash["runningDrivers"],
1148
- hash["completedDrivers"],
1149
- hash["cumulativeMemory"],
1150
- hash["totalMemoryReservation"],
1151
- hash["peakMemoryReservation"],
1152
- hash["totalScheduledTime"],
1153
- hash["totalCpuTime"],
1154
- hash["totalUserTime"],
1155
- hash["totalBlockedTime"],
1156
- hash["fullyBlocked"],
1157
- hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1158
- hash["rawInputDataSize"],
1159
- hash["rawInputPositions"],
1160
- hash["processedInputDataSize"],
1161
- hash["processedInputPositions"],
1162
- hash["outputDataSize"],
1163
- hash["outputPositions"],
1164
- )
1165
- obj
1166
- end
1167
- end
1168
-
1169
- class << RemoteSourceNode =
1170
- Base.new(:id, :source_fragment_ids, :outputs)
1171
- def decode(hash)
1172
- unless hash.is_a?(Hash)
1173
- raise TypeError, "Can't convert #{hash.class} to Hash"
1174
- end
1175
- obj = allocate
1176
- obj.send(:initialize_struct,
1177
- hash["id"],
1178
- hash["sourceFragmentIds"],
1179
- hash["outputs"],
1180
- )
1181
- obj
1182
- end
1183
- end
1184
-
1185
- class << RowNumberNode =
1186
- Base.new(:id, :source, :partition_by, :row_number_symbol, :max_row_count_per_partition, :hash_symbol)
1187
- def decode(hash)
1188
- unless hash.is_a?(Hash)
1189
- raise TypeError, "Can't convert #{hash.class} to Hash"
1190
- end
1191
- obj = allocate
1192
- obj.send(:initialize_struct,
1193
- hash["id"],
1194
- hash["source"] && PlanNode.decode(hash["source"]),
1195
- hash["partitionBy"],
1196
- hash["rowNumberSymbol"],
1197
- hash["maxRowCountPerPartition"],
1198
- hash["hashSymbol"],
1199
- )
1200
- obj
1201
- end
1202
- end
1203
-
1204
- class << SampleNode =
1205
- Base.new(:id, :source, :sample_ratio, :sample_type, :rescaled, :sample_weight_symbol)
1206
- def decode(hash)
1207
- unless hash.is_a?(Hash)
1208
- raise TypeError, "Can't convert #{hash.class} to Hash"
1209
- end
1210
- obj = allocate
1211
- obj.send(:initialize_struct,
1212
- hash["id"],
1213
- hash["source"] && PlanNode.decode(hash["source"]),
1214
- hash["sampleRatio"],
1215
- hash["sampleType"],
1216
- hash["rescaled"],
1217
- hash["sampleWeightSymbol"],
1218
- )
1219
- obj
1220
- end
1221
- end
1222
-
1223
- class << SemiJoinNode =
1224
- Base.new(:id, :source, :filtering_source, :source_join_symbol, :filtering_source_join_symbol, :semi_join_output, :source_hash_symbol, :filtering_source_hash_symbol)
1225
- def decode(hash)
1226
- unless hash.is_a?(Hash)
1227
- raise TypeError, "Can't convert #{hash.class} to Hash"
1228
- end
1229
- obj = allocate
1230
- obj.send(:initialize_struct,
1231
- hash["id"],
1232
- hash["source"] && PlanNode.decode(hash["source"]),
1233
- hash["filteringSource"] && PlanNode.decode(hash["filteringSource"]),
1234
- hash["sourceJoinSymbol"],
1235
- hash["filteringSourceJoinSymbol"],
1236
- hash["semiJoinOutput"],
1237
- hash["sourceHashSymbol"],
1238
- hash["filteringSourceHashSymbol"],
1239
- )
1240
- obj
1241
- end
1242
- end
1243
-
1244
- class << SessionRepresentation =
1245
- Base.new(:query_id, :transaction_id, :client_transaction_support, :user, :principal, :source, :catalog, :schema, :time_zone_key, :locale, :remote_user_address, :user_agent, :start_time, :system_properties, :catalog_properties, :prepared_statements)
1246
- def decode(hash)
1247
- unless hash.is_a?(Hash)
1248
- raise TypeError, "Can't convert #{hash.class} to Hash"
1249
- end
1250
- obj = allocate
1251
- obj.send(:initialize_struct,
1252
- hash["queryId"],
1253
- hash["transactionId"],
1254
- hash["clientTransactionSupport"],
1255
- hash["user"],
1256
- hash["principal"],
1257
- hash["source"],
1258
- hash["catalog"],
1259
- hash["schema"],
1260
- hash["timeZoneKey"],
1261
- hash["locale"],
1262
- hash["remoteUserAddress"],
1263
- hash["userAgent"],
1264
- hash["startTime"],
1265
- hash["systemProperties"],
1266
- hash["catalogProperties"],
1267
- hash["preparedStatements"],
1268
- )
1269
- obj
1270
- end
1271
- end
1272
-
1273
- class << Signature =
1274
- Base.new(:name, :kind, :type_variable_constraints, :long_variable_constraints, :return_type, :argument_types, :variable_arity)
1275
- def decode(hash)
1276
- unless hash.is_a?(Hash)
1277
- raise TypeError, "Can't convert #{hash.class} to Hash"
1278
- end
1279
- obj = allocate
1280
- obj.send(:initialize_struct,
1281
- hash["name"],
1282
- hash["kind"] && hash["kind"].downcase.to_sym,
1283
- hash["typeVariableConstraints"] && hash["typeVariableConstraints"].map {|h| TypeVariableConstraint.decode(h) },
1284
- hash["longVariableConstraints"] && hash["longVariableConstraints"].map {|h| LongVariableConstraint.decode(h) },
1285
- hash["returnType"],
1286
- hash["argumentTypes"],
1287
- hash["variableArity"],
1288
- )
1289
- obj
1290
- end
1291
- end
1292
-
1293
- class << SortNode =
1294
- Base.new(:id, :source, :order_by, :orderings)
1295
- def decode(hash)
1296
- unless hash.is_a?(Hash)
1297
- raise TypeError, "Can't convert #{hash.class} to Hash"
1298
- end
1299
- obj = allocate
1300
- obj.send(:initialize_struct,
1301
- hash["id"],
1302
- hash["source"] && PlanNode.decode(hash["source"]),
1303
- hash["orderBy"],
1304
- hash["orderings"] && Hash[hash["orderings"].to_a.map! {|k,v| [k, v.downcase.to_sym] }],
1305
- )
1306
- obj
1307
- end
1308
- end
1309
-
1310
- class << StageInfo =
1311
- Base.new(:stage_id, :state, :self, :plan, :types, :stage_stats, :tasks, :sub_stages, :failure_cause)
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["stageId"] && StageId.new(hash["stageId"]),
1319
- hash["state"] && hash["state"].downcase.to_sym,
1320
- hash["self"],
1321
- hash["plan"] && PlanFragment.decode(hash["plan"]),
1322
- hash["types"],
1323
- hash["stageStats"] && StageStats.decode(hash["stageStats"]),
1324
- hash["tasks"] && hash["tasks"].map {|h| TaskInfo.decode(h) },
1325
- hash["subStages"] && hash["subStages"].map {|h| StageInfo.decode(h) },
1326
- hash["failureCause"] && ExecutionFailureInfo.decode(hash["failureCause"]),
1327
- )
1328
- obj
1329
- end
1330
- end
1331
-
1332
- class << StageStats =
1333
- 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, :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, :output_data_size, :output_positions)
1334
- def decode(hash)
1335
- unless hash.is_a?(Hash)
1336
- raise TypeError, "Can't convert #{hash.class} to Hash"
1337
- end
1338
- obj = allocate
1339
- obj.send(:initialize_struct,
1340
- hash["schedulingComplete"],
1341
- hash["getSplitDistribution"] && DistributionSnapshot.decode(hash["getSplitDistribution"]),
1342
- hash["scheduleTaskDistribution"] && DistributionSnapshot.decode(hash["scheduleTaskDistribution"]),
1343
- hash["addSplitDistribution"] && DistributionSnapshot.decode(hash["addSplitDistribution"]),
1344
- hash["totalTasks"],
1345
- hash["runningTasks"],
1346
- hash["completedTasks"],
1347
- hash["totalDrivers"],
1348
- hash["queuedDrivers"],
1349
- hash["runningDrivers"],
1350
- hash["completedDrivers"],
1351
- hash["cumulativeMemory"],
1352
- hash["totalMemoryReservation"],
1353
- hash["peakMemoryReservation"],
1354
- hash["totalScheduledTime"],
1355
- hash["totalCpuTime"],
1356
- hash["totalUserTime"],
1357
- hash["totalBlockedTime"],
1358
- hash["fullyBlocked"],
1359
- hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1360
- hash["rawInputDataSize"],
1361
- hash["rawInputPositions"],
1362
- hash["processedInputDataSize"],
1363
- hash["processedInputPositions"],
1364
- hash["outputDataSize"],
1365
- hash["outputPositions"],
1366
- )
1367
- obj
1368
- end
1369
- end
1370
-
1371
- class << StatementStats =
1372
- 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)
1373
- def decode(hash)
1374
- unless hash.is_a?(Hash)
1375
- raise TypeError, "Can't convert #{hash.class} to Hash"
1376
- end
1377
- obj = allocate
1378
- obj.send(:initialize_struct,
1379
- hash["state"],
1380
- hash["queued"],
1381
- hash["scheduled"],
1382
- hash["nodes"],
1383
- hash["totalSplits"],
1384
- hash["queuedSplits"],
1385
- hash["runningSplits"],
1386
- hash["completedSplits"],
1387
- hash["userTimeMillis"],
1388
- hash["cpuTimeMillis"],
1389
- hash["wallTimeMillis"],
1390
- hash["processedRows"],
1391
- hash["processedBytes"],
1392
- hash["rootStage"] && ClientStageStats.decode(hash["rootStage"]),
1393
- )
1394
- obj
1395
- end
1396
- end
1397
-
1398
- class << TableFinishNode =
1399
- Base.new(:id, :source, :target, :outputs)
1400
- def decode(hash)
1401
- unless hash.is_a?(Hash)
1402
- raise TypeError, "Can't convert #{hash.class} to Hash"
1403
- end
1404
- obj = allocate
1405
- obj.send(:initialize_struct,
1406
- hash["id"],
1407
- hash["source"] && PlanNode.decode(hash["source"]),
1408
- hash["target"] && WriterTarget.decode(hash["target"]),
1409
- hash["outputs"],
1410
- )
1411
- obj
1412
- end
1413
- end
1414
-
1415
- class << TableHandle =
1416
- Base.new(:connector_id, :connector_handle)
1417
- def decode(hash)
1418
- unless hash.is_a?(Hash)
1419
- raise TypeError, "Can't convert #{hash.class} to Hash"
1420
- end
1421
- obj = allocate
1422
- obj.send(:initialize_struct,
1423
- hash["connectorId"],
1424
- hash["connectorHandle"],
1425
- )
1426
- obj
1427
- end
1428
- end
1429
-
1430
- class << TableLayoutHandle =
1431
- Base.new(:connector_id, :transaction_handle, :connector_handle)
1432
- def decode(hash)
1433
- unless hash.is_a?(Hash)
1434
- raise TypeError, "Can't convert #{hash.class} to Hash"
1435
- end
1436
- obj = allocate
1437
- obj.send(:initialize_struct,
1438
- hash["connectorId"],
1439
- hash["transactionHandle"],
1440
- hash["connectorHandle"],
1441
- )
1442
- obj
1443
- end
1444
- end
1445
-
1446
- class << TableScanNode =
1447
- Base.new(:id, :table, :output_symbols, :assignments, :layout, :current_constraint, :original_constraint)
1448
- def decode(hash)
1449
- unless hash.is_a?(Hash)
1450
- raise TypeError, "Can't convert #{hash.class} to Hash"
1451
- end
1452
- obj = allocate
1453
- obj.send(:initialize_struct,
1454
- hash["id"],
1455
- hash["table"] && TableHandle.decode(hash["table"]),
1456
- hash["outputSymbols"],
1457
- hash["assignments"],
1458
- hash["layout"] && TableLayoutHandle.decode(hash["layout"]),
1459
- hash["currentConstraint"],
1460
- hash["originalConstraint"],
1461
- )
1462
- obj
1463
- end
1464
- end
1465
-
1466
- class << TableWriterNode =
1467
- Base.new(:id, :source, :target, :columns, :column_names, :outputs, :sample_weight_symbol, :partitioning_scheme)
1468
- def decode(hash)
1469
- unless hash.is_a?(Hash)
1470
- raise TypeError, "Can't convert #{hash.class} to Hash"
1471
- end
1472
- obj = allocate
1473
- obj.send(:initialize_struct,
1474
- hash["id"],
1475
- hash["source"] && PlanNode.decode(hash["source"]),
1476
- hash["target"] && WriterTarget.decode(hash["target"]),
1477
- hash["columns"],
1478
- hash["columnNames"],
1479
- hash["outputs"],
1480
- hash["sampleWeightSymbol"],
1481
- hash["partitioningScheme"] && PartitioningScheme.decode(hash["partitioningScheme"]),
1482
- )
1483
- obj
1484
- end
1485
- end
1486
-
1487
- class << TaskInfo =
1488
- Base.new(:task_status, :last_heartbeat, :output_buffers, :no_more_splits, :stats, :needs_plan)
1489
- def decode(hash)
1490
- unless hash.is_a?(Hash)
1491
- raise TypeError, "Can't convert #{hash.class} to Hash"
1492
- end
1493
- obj = allocate
1494
- obj.send(:initialize_struct,
1495
- hash["taskStatus"] && TaskStatus.decode(hash["taskStatus"]),
1496
- hash["lastHeartbeat"],
1497
- hash["outputBuffers"] && OutputBufferInfo.decode(hash["outputBuffers"]),
1498
- hash["noMoreSplits"],
1499
- hash["stats"] && TaskStats.decode(hash["stats"]),
1500
- hash["needsPlan"],
1501
- )
1502
- obj
1503
- end
1504
- end
1505
-
1506
- class << TaskStats =
1507
- 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, :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)
1508
- def decode(hash)
1509
- unless hash.is_a?(Hash)
1510
- raise TypeError, "Can't convert #{hash.class} to Hash"
1511
- end
1512
- obj = allocate
1513
- obj.send(:initialize_struct,
1514
- hash["createTime"],
1515
- hash["firstStartTime"],
1516
- hash["lastStartTime"],
1517
- hash["lastEndTime"],
1518
- hash["endTime"],
1519
- hash["elapsedTime"],
1520
- hash["queuedTime"],
1521
- hash["totalDrivers"],
1522
- hash["queuedDrivers"],
1523
- hash["queuedPartitionedDrivers"],
1524
- hash["runningDrivers"],
1525
- hash["runningPartitionedDrivers"],
1526
- hash["completedDrivers"],
1527
- hash["cumulativeMemory"],
1528
- hash["memoryReservation"],
1529
- hash["systemMemoryReservation"],
1530
- hash["totalScheduledTime"],
1531
- hash["totalCpuTime"],
1532
- hash["totalUserTime"],
1533
- hash["totalBlockedTime"],
1534
- hash["fullyBlocked"],
1535
- hash["blockedReasons"] && hash["blockedReasons"].map {|h| h.downcase.to_sym },
1536
- hash["rawInputDataSize"],
1537
- hash["rawInputPositions"],
1538
- hash["processedInputDataSize"],
1539
- hash["processedInputPositions"],
1540
- hash["outputDataSize"],
1541
- hash["outputPositions"],
1542
- hash["pipelines"] && hash["pipelines"].map {|h| PipelineStats.decode(h) },
1543
- )
1544
- obj
1545
- end
1546
- end
1547
-
1548
- class << TaskStatus =
1549
- Base.new(:task_id, :task_instance_id, :version, :state, :self, :failures, :queued_partitioned_drivers, :running_partitioned_drivers, :memory_reservation)
1550
- def decode(hash)
1551
- unless hash.is_a?(Hash)
1552
- raise TypeError, "Can't convert #{hash.class} to Hash"
1553
- end
1554
- obj = allocate
1555
- obj.send(:initialize_struct,
1556
- hash["taskId"] && TaskId.new(hash["taskId"]),
1557
- hash["taskInstanceId"],
1558
- hash["version"],
1559
- hash["state"] && hash["state"].downcase.to_sym,
1560
- hash["self"],
1561
- hash["failures"] && hash["failures"].map {|h| ExecutionFailureInfo.decode(h) },
1562
- hash["queuedPartitionedDrivers"],
1563
- hash["runningPartitionedDrivers"],
1564
- hash["memoryReservation"],
1565
- )
1566
- obj
1567
- end
1568
- end
1569
-
1570
- class << TopNNode =
1571
- Base.new(:id, :source, :count, :order_by, :orderings, :partial)
1572
- def decode(hash)
1573
- unless hash.is_a?(Hash)
1574
- raise TypeError, "Can't convert #{hash.class} to Hash"
1575
- end
1576
- obj = allocate
1577
- obj.send(:initialize_struct,
1578
- hash["id"],
1579
- hash["source"] && PlanNode.decode(hash["source"]),
1580
- hash["count"],
1581
- hash["orderBy"],
1582
- hash["orderings"] && Hash[hash["orderings"].to_a.map! {|k,v| [k, v.downcase.to_sym] }],
1583
- hash["partial"],
1584
- )
1585
- obj
1586
- end
1587
- end
1588
-
1589
- class << TopNRowNumberNode =
1590
- Base.new(:id, :source, :partition_by, :order_by, :orderings, :row_number_symbol, :max_row_count_per_partition, :partial, :hash_symbol)
1591
- def decode(hash)
1592
- unless hash.is_a?(Hash)
1593
- raise TypeError, "Can't convert #{hash.class} to Hash"
1594
- end
1595
- obj = allocate
1596
- obj.send(:initialize_struct,
1597
- hash["id"],
1598
- hash["source"] && PlanNode.decode(hash["source"]),
1599
- hash["partitionBy"],
1600
- hash["orderBy"],
1601
- hash["orderings"] && Hash[hash["orderings"].to_a.map! {|k,v| [k, v.downcase.to_sym] }],
1602
- hash["rowNumberSymbol"],
1603
- hash["maxRowCountPerPartition"],
1604
- hash["partial"],
1605
- hash["hashSymbol"],
1606
- )
1607
- obj
1608
- end
1609
- end
1610
-
1611
- class << TypeVariableConstraint =
1612
- Base.new(:name, :comparable_required, :orderable_required, :variadic_bound)
1613
- def decode(hash)
1614
- unless hash.is_a?(Hash)
1615
- raise TypeError, "Can't convert #{hash.class} to Hash"
1616
- end
1617
- obj = allocate
1618
- obj.send(:initialize_struct,
1619
- hash["name"],
1620
- hash["comparableRequired"],
1621
- hash["orderableRequired"],
1622
- hash["variadicBound"],
1623
- )
1624
- obj
1625
- end
1626
- end
1627
-
1628
- class << UnionNode =
1629
- Base.new(:id, :sources, :output_to_inputs, :outputs)
1630
- def decode(hash)
1631
- unless hash.is_a?(Hash)
1632
- raise TypeError, "Can't convert #{hash.class} to Hash"
1633
- end
1634
- obj = allocate
1635
- obj.send(:initialize_struct,
1636
- hash["id"],
1637
- hash["sources"] && hash["sources"].map {|h| PlanNode.decode(h) },
1638
- hash["outputToInputs"],
1639
- hash["outputs"],
1640
- )
1641
- obj
1642
- end
1643
- end
1644
-
1645
- class << UnnestNode =
1646
- Base.new(:id, :source, :replicate_symbols, :unnest_symbols, :ordinality_symbol)
1647
- def decode(hash)
1648
- unless hash.is_a?(Hash)
1649
- raise TypeError, "Can't convert #{hash.class} to Hash"
1650
- end
1651
- obj = allocate
1652
- obj.send(:initialize_struct,
1653
- hash["id"],
1654
- hash["source"] && PlanNode.decode(hash["source"]),
1655
- hash["replicateSymbols"],
1656
- hash["unnestSymbols"],
1657
- hash["ordinalitySymbol"],
1658
- )
1659
- obj
1660
- end
1661
- end
1662
-
1663
- class << ValuesNode =
1664
- Base.new(:id, :output_symbols, :rows)
1665
- def decode(hash)
1666
- unless hash.is_a?(Hash)
1667
- raise TypeError, "Can't convert #{hash.class} to Hash"
1668
- end
1669
- obj = allocate
1670
- obj.send(:initialize_struct,
1671
- hash["id"],
1672
- hash["outputSymbols"],
1673
- hash["rows"],
1674
- )
1675
- obj
1676
- end
1677
- end
24
+ module ModelVersions
25
+ end
1678
26
 
1679
- class << WindowNode =
1680
- Base.new(:id, :source, :specification, :window_functions, :signatures, :hash_symbol, :pre_partitioned_inputs, :pre_sorted_order_prefix)
1681
- def decode(hash)
1682
- unless hash.is_a?(Hash)
1683
- raise TypeError, "Can't convert #{hash.class} to Hash"
1684
- end
1685
- obj = allocate
1686
- obj.send(:initialize_struct,
1687
- hash["id"],
1688
- hash["source"] && PlanNode.decode(hash["source"]),
1689
- hash["specification"] && Specification.decode(hash["specification"]),
1690
- hash["windowFunctions"],
1691
- hash["signatures"] && Hash[hash["signatures"].to_a.map! {|k,v| [k, Signature.decode(v)] }],
1692
- hash["hashSymbol"],
1693
- hash["prePartitionedInputs"],
1694
- hash["preSortedOrderPrefix"],
1695
- )
1696
- obj
1697
- end
1698
- end
27
+ require 'presto/client/model_versions/0.149.rb'
28
+ require 'presto/client/model_versions/0.153.rb'
1699
29
 
30
+ Models = ModelVersions::V0_153
1700
31
 
1701
- end
1702
32
  end