-
Notifications
You must be signed in to change notification settings - Fork 342
/
thrift_hive_metastore-remote.go
executable file
·4429 lines (4418 loc) · 146 KB
/
thrift_hive_metastore-remote.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT.
package main
import (
"context"
"flag"
"fmt"
"math"
"net"
"net/url"
"os"
"strconv"
"strings"
"github.com/apache/thrift/lib/go/thrift"
"github.com/treeverse/lakefs/pkg/metastore/hive/gen-go/hive_metastore"
)
var _ = hive_metastore.GoUnusedProtection__
func Usage() {
fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:")
flag.PrintDefaults()
fmt.Fprintln(os.Stderr, "\nFunctions:")
fmt.Fprintln(os.Stderr, " string getMetaConf(string key)")
fmt.Fprintln(os.Stderr, " void setMetaConf(string key, string value)")
fmt.Fprintln(os.Stderr, " void create_database(Database database)")
fmt.Fprintln(os.Stderr, " Database get_database(string name)")
fmt.Fprintln(os.Stderr, " void drop_database(string name, bool deleteData, bool cascade)")
fmt.Fprintln(os.Stderr, " get_databases(string pattern)")
fmt.Fprintln(os.Stderr, " get_all_databases()")
fmt.Fprintln(os.Stderr, " void alter_database(string dbname, Database db)")
fmt.Fprintln(os.Stderr, " Type get_type(string name)")
fmt.Fprintln(os.Stderr, " bool create_type(Type type)")
fmt.Fprintln(os.Stderr, " bool drop_type(string type)")
fmt.Fprintln(os.Stderr, " get_type_all(string name)")
fmt.Fprintln(os.Stderr, " get_fields(string db_name, string table_name)")
fmt.Fprintln(os.Stderr, " get_fields_with_environment_context(string db_name, string table_name, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " get_schema(string db_name, string table_name)")
fmt.Fprintln(os.Stderr, " get_schema_with_environment_context(string db_name, string table_name, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " void create_table(Table tbl)")
fmt.Fprintln(os.Stderr, " void create_table_with_environment_context(Table tbl, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " void create_table_with_constraints(Table tbl, primaryKeys, foreignKeys, uniqueConstraints, notNullConstraints)")
fmt.Fprintln(os.Stderr, " void drop_constraint(DropConstraintRequest req)")
fmt.Fprintln(os.Stderr, " void add_primary_key(AddPrimaryKeyRequest req)")
fmt.Fprintln(os.Stderr, " void add_foreign_key(AddForeignKeyRequest req)")
fmt.Fprintln(os.Stderr, " void add_unique_constraint(AddUniqueConstraintRequest req)")
fmt.Fprintln(os.Stderr, " void add_not_null_constraint(AddNotNullConstraintRequest req)")
fmt.Fprintln(os.Stderr, " void drop_table(string dbname, string name, bool deleteData)")
fmt.Fprintln(os.Stderr, " void drop_table_with_environment_context(string dbname, string name, bool deleteData, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " void truncate_table(string dbName, string tableName, partNames)")
fmt.Fprintln(os.Stderr, " get_tables(string db_name, string pattern)")
fmt.Fprintln(os.Stderr, " get_tables_by_type(string db_name, string pattern, string tableType)")
fmt.Fprintln(os.Stderr, " get_table_meta(string db_patterns, string tbl_patterns, tbl_types)")
fmt.Fprintln(os.Stderr, " get_all_tables(string db_name)")
fmt.Fprintln(os.Stderr, " Table get_table(string dbname, string tbl_name)")
fmt.Fprintln(os.Stderr, " get_table_objects_by_name(string dbname, tbl_names)")
fmt.Fprintln(os.Stderr, " GetTableResult get_table_req(GetTableRequest req)")
fmt.Fprintln(os.Stderr, " GetTablesResult get_table_objects_by_name_req(GetTablesRequest req)")
fmt.Fprintln(os.Stderr, " get_table_names_by_filter(string dbname, string filter, i16 max_tables)")
fmt.Fprintln(os.Stderr, " void alter_table(string dbname, string tbl_name, Table new_tbl)")
fmt.Fprintln(os.Stderr, " void alter_table_with_environment_context(string dbname, string tbl_name, Table new_tbl, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " void alter_table_with_cascade(string dbname, string tbl_name, Table new_tbl, bool cascade)")
fmt.Fprintln(os.Stderr, " Partition add_partition(Partition new_part)")
fmt.Fprintln(os.Stderr, " Partition add_partition_with_environment_context(Partition new_part, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " i32 add_partitions( new_parts)")
fmt.Fprintln(os.Stderr, " i32 add_partitions_pspec( new_parts)")
fmt.Fprintln(os.Stderr, " Partition append_partition(string db_name, string tbl_name, part_vals)")
fmt.Fprintln(os.Stderr, " AddPartitionsResult add_partitions_req(AddPartitionsRequest request)")
fmt.Fprintln(os.Stderr, " Partition append_partition_with_environment_context(string db_name, string tbl_name, part_vals, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " Partition append_partition_by_name(string db_name, string tbl_name, string part_name)")
fmt.Fprintln(os.Stderr, " Partition append_partition_by_name_with_environment_context(string db_name, string tbl_name, string part_name, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " bool drop_partition(string db_name, string tbl_name, part_vals, bool deleteData)")
fmt.Fprintln(os.Stderr, " bool drop_partition_with_environment_context(string db_name, string tbl_name, part_vals, bool deleteData, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " bool drop_partition_by_name(string db_name, string tbl_name, string part_name, bool deleteData)")
fmt.Fprintln(os.Stderr, " bool drop_partition_by_name_with_environment_context(string db_name, string tbl_name, string part_name, bool deleteData, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " DropPartitionsResult drop_partitions_req(DropPartitionsRequest req)")
fmt.Fprintln(os.Stderr, " Partition get_partition(string db_name, string tbl_name, part_vals)")
fmt.Fprintln(os.Stderr, " Partition exchange_partition( partitionSpecs, string source_db, string source_table_name, string dest_db, string dest_table_name)")
fmt.Fprintln(os.Stderr, " exchange_partitions( partitionSpecs, string source_db, string source_table_name, string dest_db, string dest_table_name)")
fmt.Fprintln(os.Stderr, " Partition get_partition_with_auth(string db_name, string tbl_name, part_vals, string user_name, group_names)")
fmt.Fprintln(os.Stderr, " Partition get_partition_by_name(string db_name, string tbl_name, string part_name)")
fmt.Fprintln(os.Stderr, " get_partitions(string db_name, string tbl_name, i16 max_parts)")
fmt.Fprintln(os.Stderr, " get_partitions_with_auth(string db_name, string tbl_name, i16 max_parts, string user_name, group_names)")
fmt.Fprintln(os.Stderr, " get_partitions_pspec(string db_name, string tbl_name, i32 max_parts)")
fmt.Fprintln(os.Stderr, " get_partition_names(string db_name, string tbl_name, i16 max_parts)")
fmt.Fprintln(os.Stderr, " PartitionValuesResponse get_partition_values(PartitionValuesRequest request)")
fmt.Fprintln(os.Stderr, " get_partitions_ps(string db_name, string tbl_name, part_vals, i16 max_parts)")
fmt.Fprintln(os.Stderr, " get_partitions_ps_with_auth(string db_name, string tbl_name, part_vals, i16 max_parts, string user_name, group_names)")
fmt.Fprintln(os.Stderr, " get_partition_names_ps(string db_name, string tbl_name, part_vals, i16 max_parts)")
fmt.Fprintln(os.Stderr, " get_partitions_by_filter(string db_name, string tbl_name, string filter, i16 max_parts)")
fmt.Fprintln(os.Stderr, " get_part_specs_by_filter(string db_name, string tbl_name, string filter, i32 max_parts)")
fmt.Fprintln(os.Stderr, " PartitionsByExprResult get_partitions_by_expr(PartitionsByExprRequest req)")
fmt.Fprintln(os.Stderr, " i32 get_num_partitions_by_filter(string db_name, string tbl_name, string filter)")
fmt.Fprintln(os.Stderr, " get_partitions_by_names(string db_name, string tbl_name, names)")
fmt.Fprintln(os.Stderr, " void alter_partition(string db_name, string tbl_name, Partition new_part)")
fmt.Fprintln(os.Stderr, " void alter_partitions(string db_name, string tbl_name, new_parts)")
fmt.Fprintln(os.Stderr, " void alter_partitions_with_environment_context(string db_name, string tbl_name, new_parts, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " void alter_partition_with_environment_context(string db_name, string tbl_name, Partition new_part, EnvironmentContext environment_context)")
fmt.Fprintln(os.Stderr, " void rename_partition(string db_name, string tbl_name, part_vals, Partition new_part)")
fmt.Fprintln(os.Stderr, " bool partition_name_has_valid_characters( part_vals, bool throw_exception)")
fmt.Fprintln(os.Stderr, " string get_config_value(string name, string defaultValue)")
fmt.Fprintln(os.Stderr, " partition_name_to_vals(string part_name)")
fmt.Fprintln(os.Stderr, " partition_name_to_spec(string part_name)")
fmt.Fprintln(os.Stderr, " void markPartitionForEvent(string db_name, string tbl_name, part_vals, PartitionEventType eventType)")
fmt.Fprintln(os.Stderr, " bool isPartitionMarkedForEvent(string db_name, string tbl_name, part_vals, PartitionEventType eventType)")
fmt.Fprintln(os.Stderr, " Index add_index(Index new_index, Table index_table)")
fmt.Fprintln(os.Stderr, " void alter_index(string dbname, string base_tbl_name, string idx_name, Index new_idx)")
fmt.Fprintln(os.Stderr, " bool drop_index_by_name(string db_name, string tbl_name, string index_name, bool deleteData)")
fmt.Fprintln(os.Stderr, " Index get_index_by_name(string db_name, string tbl_name, string index_name)")
fmt.Fprintln(os.Stderr, " get_indexes(string db_name, string tbl_name, i16 max_indexes)")
fmt.Fprintln(os.Stderr, " get_index_names(string db_name, string tbl_name, i16 max_indexes)")
fmt.Fprintln(os.Stderr, " PrimaryKeysResponse get_primary_keys(PrimaryKeysRequest request)")
fmt.Fprintln(os.Stderr, " ForeignKeysResponse get_foreign_keys(ForeignKeysRequest request)")
fmt.Fprintln(os.Stderr, " UniqueConstraintsResponse get_unique_constraints(UniqueConstraintsRequest request)")
fmt.Fprintln(os.Stderr, " NotNullConstraintsResponse get_not_null_constraints(NotNullConstraintsRequest request)")
fmt.Fprintln(os.Stderr, " bool update_table_column_statistics(ColumnStatistics stats_obj)")
fmt.Fprintln(os.Stderr, " bool update_partition_column_statistics(ColumnStatistics stats_obj)")
fmt.Fprintln(os.Stderr, " ColumnStatistics get_table_column_statistics(string db_name, string tbl_name, string col_name)")
fmt.Fprintln(os.Stderr, " ColumnStatistics get_partition_column_statistics(string db_name, string tbl_name, string part_name, string col_name)")
fmt.Fprintln(os.Stderr, " TableStatsResult get_table_statistics_req(TableStatsRequest request)")
fmt.Fprintln(os.Stderr, " PartitionsStatsResult get_partitions_statistics_req(PartitionsStatsRequest request)")
fmt.Fprintln(os.Stderr, " AggrStats get_aggr_stats_for(PartitionsStatsRequest request)")
fmt.Fprintln(os.Stderr, " bool set_aggr_stats_for(SetPartitionsStatsRequest request)")
fmt.Fprintln(os.Stderr, " bool delete_partition_column_statistics(string db_name, string tbl_name, string part_name, string col_name)")
fmt.Fprintln(os.Stderr, " bool delete_table_column_statistics(string db_name, string tbl_name, string col_name)")
fmt.Fprintln(os.Stderr, " void create_function(Function func)")
fmt.Fprintln(os.Stderr, " void drop_function(string dbName, string funcName)")
fmt.Fprintln(os.Stderr, " void alter_function(string dbName, string funcName, Function newFunc)")
fmt.Fprintln(os.Stderr, " get_functions(string dbName, string pattern)")
fmt.Fprintln(os.Stderr, " Function get_function(string dbName, string funcName)")
fmt.Fprintln(os.Stderr, " GetAllFunctionsResponse get_all_functions()")
fmt.Fprintln(os.Stderr, " bool create_role(Role role)")
fmt.Fprintln(os.Stderr, " bool drop_role(string role_name)")
fmt.Fprintln(os.Stderr, " get_role_names()")
fmt.Fprintln(os.Stderr, " bool grant_role(string role_name, string principal_name, PrincipalType principal_type, string grantor, PrincipalType grantorType, bool grant_option)")
fmt.Fprintln(os.Stderr, " bool revoke_role(string role_name, string principal_name, PrincipalType principal_type)")
fmt.Fprintln(os.Stderr, " list_roles(string principal_name, PrincipalType principal_type)")
fmt.Fprintln(os.Stderr, " GrantRevokeRoleResponse grant_revoke_role(GrantRevokeRoleRequest request)")
fmt.Fprintln(os.Stderr, " GetPrincipalsInRoleResponse get_principals_in_role(GetPrincipalsInRoleRequest request)")
fmt.Fprintln(os.Stderr, " GetRoleGrantsForPrincipalResponse get_role_grants_for_principal(GetRoleGrantsForPrincipalRequest request)")
fmt.Fprintln(os.Stderr, " PrincipalPrivilegeSet get_privilege_set(HiveObjectRef hiveObject, string user_name, group_names)")
fmt.Fprintln(os.Stderr, " list_privileges(string principal_name, PrincipalType principal_type, HiveObjectRef hiveObject)")
fmt.Fprintln(os.Stderr, " bool grant_privileges(PrivilegeBag privileges)")
fmt.Fprintln(os.Stderr, " bool revoke_privileges(PrivilegeBag privileges)")
fmt.Fprintln(os.Stderr, " GrantRevokePrivilegeResponse grant_revoke_privileges(GrantRevokePrivilegeRequest request)")
fmt.Fprintln(os.Stderr, " set_ugi(string user_name, group_names)")
fmt.Fprintln(os.Stderr, " string get_delegation_token(string token_owner, string renewer_kerberos_principal_name)")
fmt.Fprintln(os.Stderr, " i64 renew_delegation_token(string token_str_form)")
fmt.Fprintln(os.Stderr, " void cancel_delegation_token(string token_str_form)")
fmt.Fprintln(os.Stderr, " bool add_token(string token_identifier, string delegation_token)")
fmt.Fprintln(os.Stderr, " bool remove_token(string token_identifier)")
fmt.Fprintln(os.Stderr, " string get_token(string token_identifier)")
fmt.Fprintln(os.Stderr, " get_all_token_identifiers()")
fmt.Fprintln(os.Stderr, " i32 add_master_key(string key)")
fmt.Fprintln(os.Stderr, " void update_master_key(i32 seq_number, string key)")
fmt.Fprintln(os.Stderr, " bool remove_master_key(i32 key_seq)")
fmt.Fprintln(os.Stderr, " get_master_keys()")
fmt.Fprintln(os.Stderr, " GetOpenTxnsResponse get_open_txns()")
fmt.Fprintln(os.Stderr, " GetOpenTxnsInfoResponse get_open_txns_info()")
fmt.Fprintln(os.Stderr, " OpenTxnsResponse open_txns(OpenTxnRequest rqst)")
fmt.Fprintln(os.Stderr, " void abort_txn(AbortTxnRequest rqst)")
fmt.Fprintln(os.Stderr, " void abort_txns(AbortTxnsRequest rqst)")
fmt.Fprintln(os.Stderr, " void commit_txn(CommitTxnRequest rqst)")
fmt.Fprintln(os.Stderr, " LockResponse lock(LockRequest rqst)")
fmt.Fprintln(os.Stderr, " LockResponse check_lock(CheckLockRequest rqst)")
fmt.Fprintln(os.Stderr, " void unlock(UnlockRequest rqst)")
fmt.Fprintln(os.Stderr, " ShowLocksResponse show_locks(ShowLocksRequest rqst)")
fmt.Fprintln(os.Stderr, " void heartbeat(HeartbeatRequest ids)")
fmt.Fprintln(os.Stderr, " HeartbeatTxnRangeResponse heartbeat_txn_range(HeartbeatTxnRangeRequest txns)")
fmt.Fprintln(os.Stderr, " void compact(CompactionRequest rqst)")
fmt.Fprintln(os.Stderr, " CompactionResponse compact2(CompactionRequest rqst)")
fmt.Fprintln(os.Stderr, " ShowCompactResponse show_compact(ShowCompactRequest rqst)")
fmt.Fprintln(os.Stderr, " void add_dynamic_partitions(AddDynamicPartitions rqst)")
fmt.Fprintln(os.Stderr, " NotificationEventResponse get_next_notification(NotificationEventRequest rqst)")
fmt.Fprintln(os.Stderr, " CurrentNotificationEventId get_current_notificationEventId()")
fmt.Fprintln(os.Stderr, " NotificationEventsCountResponse get_notification_events_count(NotificationEventsCountRequest rqst)")
fmt.Fprintln(os.Stderr, " FireEventResponse fire_listener_event(FireEventRequest rqst)")
fmt.Fprintln(os.Stderr, " void flushCache()")
fmt.Fprintln(os.Stderr, " CmRecycleResponse cm_recycle(CmRecycleRequest request)")
fmt.Fprintln(os.Stderr, " GetFileMetadataByExprResult get_file_metadata_by_expr(GetFileMetadataByExprRequest req)")
fmt.Fprintln(os.Stderr, " GetFileMetadataResult get_file_metadata(GetFileMetadataRequest req)")
fmt.Fprintln(os.Stderr, " PutFileMetadataResult put_file_metadata(PutFileMetadataRequest req)")
fmt.Fprintln(os.Stderr, " ClearFileMetadataResult clear_file_metadata(ClearFileMetadataRequest req)")
fmt.Fprintln(os.Stderr, " CacheFileMetadataResult cache_file_metadata(CacheFileMetadataRequest req)")
fmt.Fprintln(os.Stderr, " string get_metastore_db_uuid()")
fmt.Fprintln(os.Stderr, " WMCreateResourcePlanResponse create_resource_plan(WMCreateResourcePlanRequest request)")
fmt.Fprintln(os.Stderr, " WMGetResourcePlanResponse get_resource_plan(WMGetResourcePlanRequest request)")
fmt.Fprintln(os.Stderr, " WMGetActiveResourcePlanResponse get_active_resource_plan(WMGetActiveResourcePlanRequest request)")
fmt.Fprintln(os.Stderr, " WMGetAllResourcePlanResponse get_all_resource_plans(WMGetAllResourcePlanRequest request)")
fmt.Fprintln(os.Stderr, " WMAlterResourcePlanResponse alter_resource_plan(WMAlterResourcePlanRequest request)")
fmt.Fprintln(os.Stderr, " WMValidateResourcePlanResponse validate_resource_plan(WMValidateResourcePlanRequest request)")
fmt.Fprintln(os.Stderr, " WMDropResourcePlanResponse drop_resource_plan(WMDropResourcePlanRequest request)")
fmt.Fprintln(os.Stderr, " WMCreateTriggerResponse create_wm_trigger(WMCreateTriggerRequest request)")
fmt.Fprintln(os.Stderr, " WMAlterTriggerResponse alter_wm_trigger(WMAlterTriggerRequest request)")
fmt.Fprintln(os.Stderr, " WMDropTriggerResponse drop_wm_trigger(WMDropTriggerRequest request)")
fmt.Fprintln(os.Stderr, " WMGetTriggersForResourePlanResponse get_triggers_for_resourceplan(WMGetTriggersForResourePlanRequest request)")
fmt.Fprintln(os.Stderr)
os.Exit(0)
}
type httpHeaders map[string]string
func (h httpHeaders) String() string {
var m map[string]string = h
return fmt.Sprintf("%s", m)
}
func (h httpHeaders) Set(value string) error {
parts := strings.Split(value, ": ")
if len(parts) != 2 {
return fmt.Errorf("header should be of format 'Key: Value'")
}
h[parts[0]] = parts[1]
return nil
}
func main() {
flag.Usage = Usage
var host string
var port int
var protocol string
var urlString string
var framed bool
var useHttp bool
headers := make(httpHeaders)
var parsedUrl *url.URL
var trans thrift.TTransport
_ = strconv.Atoi
_ = math.Abs
flag.Usage = Usage
flag.StringVar(&host, "h", "localhost", "Specify host and port")
flag.IntVar(&port, "p", 9090, "Specify port")
flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
flag.StringVar(&urlString, "u", "", "Specify the url")
flag.BoolVar(&framed, "framed", false, "Use framed transport")
flag.BoolVar(&useHttp, "http", false, "Use http")
flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")")
flag.Parse()
if len(urlString) > 0 {
var err error
parsedUrl, err = url.Parse(urlString)
if err != nil {
fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
flag.Usage()
}
host = parsedUrl.Host
useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https"
} else if useHttp {
_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
if err != nil {
fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
flag.Usage()
}
}
cmd := flag.Arg(0)
var err error
if useHttp {
trans, err = thrift.NewTHttpClient(parsedUrl.String())
if len(headers) > 0 {
httptrans := trans.(*thrift.THttpClient)
for key, value := range headers {
httptrans.SetHeader(key, value)
}
}
} else {
portStr := fmt.Sprint(port)
if strings.Contains(host, ":") {
host, portStr, err = net.SplitHostPort(host)
if err != nil {
fmt.Fprintln(os.Stderr, "error with host:", err)
os.Exit(1)
}
}
trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
if err != nil {
fmt.Fprintln(os.Stderr, "error resolving address:", err)
os.Exit(1)
}
if framed {
trans = thrift.NewTFramedTransport(trans)
}
}
if err != nil {
fmt.Fprintln(os.Stderr, "Error creating transport", err)
os.Exit(1)
}
defer trans.Close()
var protocolFactory thrift.TProtocolFactory
switch protocol {
case "compact":
protocolFactory = thrift.NewTCompactProtocolFactory()
break
case "simplejson":
protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
break
case "json":
protocolFactory = thrift.NewTJSONProtocolFactory()
break
case "binary", "":
protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
break
default:
fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
Usage()
os.Exit(1)
}
iprot := protocolFactory.GetProtocol(trans)
oprot := protocolFactory.GetProtocol(trans)
client := hive_metastore.NewThriftHiveMetastoreClient(thrift.NewTStandardClient(iprot, oprot))
if err := trans.Open(); err != nil {
fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
os.Exit(1)
}
switch cmd {
case "getMetaConf":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "GetMetaConf requires 1 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
fmt.Print(client.GetMetaConf(context.Background(), value0))
fmt.Print("\n")
break
case "setMetaConf":
if flag.NArg() - 1 != 2 {
fmt.Fprintln(os.Stderr, "SetMetaConf requires 2 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
fmt.Print(client.SetMetaConf(context.Background(), value0, value1))
fmt.Print("\n")
break
case "create_database":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "CreateDatabase requires 1 args")
flag.Usage()
}
arg627 := flag.Arg(1)
mbTrans628 := thrift.NewTMemoryBufferLen(len(arg627))
defer mbTrans628.Close()
_, err629 := mbTrans628.WriteString(arg627)
if err629 != nil {
Usage()
return
}
factory630 := thrift.NewTJSONProtocolFactory()
jsProt631 := factory630.GetProtocol(mbTrans628)
argvalue0 := hive_metastore.NewDatabase()
err632 := argvalue0.Read(context.Background(), jsProt631)
if err632 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.CreateDatabase(context.Background(), value0))
fmt.Print("\n")
break
case "get_database":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "GetDatabase requires 1 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
fmt.Print(client.GetDatabase(context.Background(), value0))
fmt.Print("\n")
break
case "drop_database":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "DropDatabase requires 3 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2) == "true"
value1 := argvalue1
argvalue2 := flag.Arg(3) == "true"
value2 := argvalue2
fmt.Print(client.DropDatabase(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "get_databases":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "GetDatabases requires 1 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
fmt.Print(client.GetDatabases(context.Background(), value0))
fmt.Print("\n")
break
case "get_all_databases":
if flag.NArg() - 1 != 0 {
fmt.Fprintln(os.Stderr, "GetAllDatabases requires 0 args")
flag.Usage()
}
fmt.Print(client.GetAllDatabases(context.Background()))
fmt.Print("\n")
break
case "alter_database":
if flag.NArg() - 1 != 2 {
fmt.Fprintln(os.Stderr, "AlterDatabase requires 2 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
arg639 := flag.Arg(2)
mbTrans640 := thrift.NewTMemoryBufferLen(len(arg639))
defer mbTrans640.Close()
_, err641 := mbTrans640.WriteString(arg639)
if err641 != nil {
Usage()
return
}
factory642 := thrift.NewTJSONProtocolFactory()
jsProt643 := factory642.GetProtocol(mbTrans640)
argvalue1 := hive_metastore.NewDatabase()
err644 := argvalue1.Read(context.Background(), jsProt643)
if err644 != nil {
Usage()
return
}
value1 := argvalue1
fmt.Print(client.AlterDatabase(context.Background(), value0, value1))
fmt.Print("\n")
break
case "get_type":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "GetType requires 1 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
fmt.Print(client.GetType(context.Background(), value0))
fmt.Print("\n")
break
case "create_type":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "CreateType requires 1 args")
flag.Usage()
}
arg646 := flag.Arg(1)
mbTrans647 := thrift.NewTMemoryBufferLen(len(arg646))
defer mbTrans647.Close()
_, err648 := mbTrans647.WriteString(arg646)
if err648 != nil {
Usage()
return
}
factory649 := thrift.NewTJSONProtocolFactory()
jsProt650 := factory649.GetProtocol(mbTrans647)
argvalue0 := hive_metastore.NewType()
err651 := argvalue0.Read(context.Background(), jsProt650)
if err651 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.CreateType(context.Background(), value0))
fmt.Print("\n")
break
case "drop_type":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "DropType requires 1 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
fmt.Print(client.DropType(context.Background(), value0))
fmt.Print("\n")
break
case "get_type_all":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "GetTypeAll requires 1 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
fmt.Print(client.GetTypeAll(context.Background(), value0))
fmt.Print("\n")
break
case "get_fields":
if flag.NArg() - 1 != 2 {
fmt.Fprintln(os.Stderr, "GetFields requires 2 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
fmt.Print(client.GetFields(context.Background(), value0, value1))
fmt.Print("\n")
break
case "get_fields_with_environment_context":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "GetFieldsWithEnvironmentContext requires 3 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
arg658 := flag.Arg(3)
mbTrans659 := thrift.NewTMemoryBufferLen(len(arg658))
defer mbTrans659.Close()
_, err660 := mbTrans659.WriteString(arg658)
if err660 != nil {
Usage()
return
}
factory661 := thrift.NewTJSONProtocolFactory()
jsProt662 := factory661.GetProtocol(mbTrans659)
argvalue2 := hive_metastore.NewEnvironmentContext()
err663 := argvalue2.Read(context.Background(), jsProt662)
if err663 != nil {
Usage()
return
}
value2 := argvalue2
fmt.Print(client.GetFieldsWithEnvironmentContext(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "get_schema":
if flag.NArg() - 1 != 2 {
fmt.Fprintln(os.Stderr, "GetSchema requires 2 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
fmt.Print(client.GetSchema(context.Background(), value0, value1))
fmt.Print("\n")
break
case "get_schema_with_environment_context":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "GetSchemaWithEnvironmentContext requires 3 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
arg668 := flag.Arg(3)
mbTrans669 := thrift.NewTMemoryBufferLen(len(arg668))
defer mbTrans669.Close()
_, err670 := mbTrans669.WriteString(arg668)
if err670 != nil {
Usage()
return
}
factory671 := thrift.NewTJSONProtocolFactory()
jsProt672 := factory671.GetProtocol(mbTrans669)
argvalue2 := hive_metastore.NewEnvironmentContext()
err673 := argvalue2.Read(context.Background(), jsProt672)
if err673 != nil {
Usage()
return
}
value2 := argvalue2
fmt.Print(client.GetSchemaWithEnvironmentContext(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "create_table":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "CreateTable requires 1 args")
flag.Usage()
}
arg674 := flag.Arg(1)
mbTrans675 := thrift.NewTMemoryBufferLen(len(arg674))
defer mbTrans675.Close()
_, err676 := mbTrans675.WriteString(arg674)
if err676 != nil {
Usage()
return
}
factory677 := thrift.NewTJSONProtocolFactory()
jsProt678 := factory677.GetProtocol(mbTrans675)
argvalue0 := hive_metastore.NewTable()
err679 := argvalue0.Read(context.Background(), jsProt678)
if err679 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.CreateTable(context.Background(), value0))
fmt.Print("\n")
break
case "create_table_with_environment_context":
if flag.NArg() - 1 != 2 {
fmt.Fprintln(os.Stderr, "CreateTableWithEnvironmentContext requires 2 args")
flag.Usage()
}
arg680 := flag.Arg(1)
mbTrans681 := thrift.NewTMemoryBufferLen(len(arg680))
defer mbTrans681.Close()
_, err682 := mbTrans681.WriteString(arg680)
if err682 != nil {
Usage()
return
}
factory683 := thrift.NewTJSONProtocolFactory()
jsProt684 := factory683.GetProtocol(mbTrans681)
argvalue0 := hive_metastore.NewTable()
err685 := argvalue0.Read(context.Background(), jsProt684)
if err685 != nil {
Usage()
return
}
value0 := argvalue0
arg686 := flag.Arg(2)
mbTrans687 := thrift.NewTMemoryBufferLen(len(arg686))
defer mbTrans687.Close()
_, err688 := mbTrans687.WriteString(arg686)
if err688 != nil {
Usage()
return
}
factory689 := thrift.NewTJSONProtocolFactory()
jsProt690 := factory689.GetProtocol(mbTrans687)
argvalue1 := hive_metastore.NewEnvironmentContext()
err691 := argvalue1.Read(context.Background(), jsProt690)
if err691 != nil {
Usage()
return
}
value1 := argvalue1
fmt.Print(client.CreateTableWithEnvironmentContext(context.Background(), value0, value1))
fmt.Print("\n")
break
case "create_table_with_constraints":
if flag.NArg() - 1 != 5 {
fmt.Fprintln(os.Stderr, "CreateTableWithConstraints requires 5 args")
flag.Usage()
}
arg692 := flag.Arg(1)
mbTrans693 := thrift.NewTMemoryBufferLen(len(arg692))
defer mbTrans693.Close()
_, err694 := mbTrans693.WriteString(arg692)
if err694 != nil {
Usage()
return
}
factory695 := thrift.NewTJSONProtocolFactory()
jsProt696 := factory695.GetProtocol(mbTrans693)
argvalue0 := hive_metastore.NewTable()
err697 := argvalue0.Read(context.Background(), jsProt696)
if err697 != nil {
Usage()
return
}
value0 := argvalue0
arg698 := flag.Arg(2)
mbTrans699 := thrift.NewTMemoryBufferLen(len(arg698))
defer mbTrans699.Close()
_, err700 := mbTrans699.WriteString(arg698)
if err700 != nil {
Usage()
return
}
factory701 := thrift.NewTJSONProtocolFactory()
jsProt702 := factory701.GetProtocol(mbTrans699)
containerStruct1 := hive_metastore.NewThriftHiveMetastoreCreateTableWithConstraintsArgs()
err703 := containerStruct1.ReadField2(context.Background(), jsProt702)
if err703 != nil {
Usage()
return
}
argvalue1 := containerStruct1.PrimaryKeys
value1 := argvalue1
arg704 := flag.Arg(3)
mbTrans705 := thrift.NewTMemoryBufferLen(len(arg704))
defer mbTrans705.Close()
_, err706 := mbTrans705.WriteString(arg704)
if err706 != nil {
Usage()
return
}
factory707 := thrift.NewTJSONProtocolFactory()
jsProt708 := factory707.GetProtocol(mbTrans705)
containerStruct2 := hive_metastore.NewThriftHiveMetastoreCreateTableWithConstraintsArgs()
err709 := containerStruct2.ReadField3(context.Background(), jsProt708)
if err709 != nil {
Usage()
return
}
argvalue2 := containerStruct2.ForeignKeys
value2 := argvalue2
arg710 := flag.Arg(4)
mbTrans711 := thrift.NewTMemoryBufferLen(len(arg710))
defer mbTrans711.Close()
_, err712 := mbTrans711.WriteString(arg710)
if err712 != nil {
Usage()
return
}
factory713 := thrift.NewTJSONProtocolFactory()
jsProt714 := factory713.GetProtocol(mbTrans711)
containerStruct3 := hive_metastore.NewThriftHiveMetastoreCreateTableWithConstraintsArgs()
err715 := containerStruct3.ReadField4(context.Background(), jsProt714)
if err715 != nil {
Usage()
return
}
argvalue3 := containerStruct3.UniqueConstraints
value3 := argvalue3
arg716 := flag.Arg(5)
mbTrans717 := thrift.NewTMemoryBufferLen(len(arg716))
defer mbTrans717.Close()
_, err718 := mbTrans717.WriteString(arg716)
if err718 != nil {
Usage()
return
}
factory719 := thrift.NewTJSONProtocolFactory()
jsProt720 := factory719.GetProtocol(mbTrans717)
containerStruct4 := hive_metastore.NewThriftHiveMetastoreCreateTableWithConstraintsArgs()
err721 := containerStruct4.ReadField5(context.Background(), jsProt720)
if err721 != nil {
Usage()
return
}
argvalue4 := containerStruct4.NotNullConstraints
value4 := argvalue4
fmt.Print(client.CreateTableWithConstraints(context.Background(), value0, value1, value2, value3, value4))
fmt.Print("\n")
break
case "drop_constraint":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "DropConstraint requires 1 args")
flag.Usage()
}
arg722 := flag.Arg(1)
mbTrans723 := thrift.NewTMemoryBufferLen(len(arg722))
defer mbTrans723.Close()
_, err724 := mbTrans723.WriteString(arg722)
if err724 != nil {
Usage()
return
}
factory725 := thrift.NewTJSONProtocolFactory()
jsProt726 := factory725.GetProtocol(mbTrans723)
argvalue0 := hive_metastore.NewDropConstraintRequest()
err727 := argvalue0.Read(context.Background(), jsProt726)
if err727 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.DropConstraint(context.Background(), value0))
fmt.Print("\n")
break
case "add_primary_key":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "AddPrimaryKey requires 1 args")
flag.Usage()
}
arg728 := flag.Arg(1)
mbTrans729 := thrift.NewTMemoryBufferLen(len(arg728))
defer mbTrans729.Close()
_, err730 := mbTrans729.WriteString(arg728)
if err730 != nil {
Usage()
return
}
factory731 := thrift.NewTJSONProtocolFactory()
jsProt732 := factory731.GetProtocol(mbTrans729)
argvalue0 := hive_metastore.NewAddPrimaryKeyRequest()
err733 := argvalue0.Read(context.Background(), jsProt732)
if err733 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.AddPrimaryKey(context.Background(), value0))
fmt.Print("\n")
break
case "add_foreign_key":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "AddForeignKey requires 1 args")
flag.Usage()
}
arg734 := flag.Arg(1)
mbTrans735 := thrift.NewTMemoryBufferLen(len(arg734))
defer mbTrans735.Close()
_, err736 := mbTrans735.WriteString(arg734)
if err736 != nil {
Usage()
return
}
factory737 := thrift.NewTJSONProtocolFactory()
jsProt738 := factory737.GetProtocol(mbTrans735)
argvalue0 := hive_metastore.NewAddForeignKeyRequest()
err739 := argvalue0.Read(context.Background(), jsProt738)
if err739 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.AddForeignKey(context.Background(), value0))
fmt.Print("\n")
break
case "add_unique_constraint":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "AddUniqueConstraint requires 1 args")
flag.Usage()
}
arg740 := flag.Arg(1)
mbTrans741 := thrift.NewTMemoryBufferLen(len(arg740))
defer mbTrans741.Close()
_, err742 := mbTrans741.WriteString(arg740)
if err742 != nil {
Usage()
return
}
factory743 := thrift.NewTJSONProtocolFactory()
jsProt744 := factory743.GetProtocol(mbTrans741)
argvalue0 := hive_metastore.NewAddUniqueConstraintRequest()
err745 := argvalue0.Read(context.Background(), jsProt744)
if err745 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.AddUniqueConstraint(context.Background(), value0))
fmt.Print("\n")
break
case "add_not_null_constraint":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "AddNotNullConstraint requires 1 args")
flag.Usage()
}
arg746 := flag.Arg(1)
mbTrans747 := thrift.NewTMemoryBufferLen(len(arg746))
defer mbTrans747.Close()
_, err748 := mbTrans747.WriteString(arg746)
if err748 != nil {
Usage()
return
}
factory749 := thrift.NewTJSONProtocolFactory()
jsProt750 := factory749.GetProtocol(mbTrans747)
argvalue0 := hive_metastore.NewAddNotNullConstraintRequest()
err751 := argvalue0.Read(context.Background(), jsProt750)
if err751 != nil {
Usage()
return
}
value0 := argvalue0
fmt.Print(client.AddNotNullConstraint(context.Background(), value0))
fmt.Print("\n")
break
case "drop_table":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "DropTable requires 3 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
argvalue2 := flag.Arg(3) == "true"
value2 := argvalue2
fmt.Print(client.DropTable(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "drop_table_with_environment_context":
if flag.NArg() - 1 != 4 {
fmt.Fprintln(os.Stderr, "DropTableWithEnvironmentContext requires 4 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
argvalue2 := flag.Arg(3) == "true"
value2 := argvalue2
arg758 := flag.Arg(4)
mbTrans759 := thrift.NewTMemoryBufferLen(len(arg758))
defer mbTrans759.Close()
_, err760 := mbTrans759.WriteString(arg758)
if err760 != nil {
Usage()
return
}
factory761 := thrift.NewTJSONProtocolFactory()
jsProt762 := factory761.GetProtocol(mbTrans759)
argvalue3 := hive_metastore.NewEnvironmentContext()
err763 := argvalue3.Read(context.Background(), jsProt762)
if err763 != nil {
Usage()
return
}
value3 := argvalue3
fmt.Print(client.DropTableWithEnvironmentContext(context.Background(), value0, value1, value2, value3))
fmt.Print("\n")
break
case "truncate_table":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "TruncateTable requires 3 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
arg766 := flag.Arg(3)
mbTrans767 := thrift.NewTMemoryBufferLen(len(arg766))
defer mbTrans767.Close()
_, err768 := mbTrans767.WriteString(arg766)
if err768 != nil {
Usage()
return
}
factory769 := thrift.NewTJSONProtocolFactory()
jsProt770 := factory769.GetProtocol(mbTrans767)
containerStruct2 := hive_metastore.NewThriftHiveMetastoreTruncateTableArgs()
err771 := containerStruct2.ReadField3(context.Background(), jsProt770)
if err771 != nil {
Usage()
return
}
argvalue2 := containerStruct2.PartNames
value2 := argvalue2
fmt.Print(client.TruncateTable(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "get_tables":
if flag.NArg() - 1 != 2 {
fmt.Fprintln(os.Stderr, "GetTables requires 2 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
fmt.Print(client.GetTables(context.Background(), value0, value1))
fmt.Print("\n")
break
case "get_tables_by_type":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "GetTablesByType requires 3 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
argvalue2 := flag.Arg(3)
value2 := argvalue2
fmt.Print(client.GetTablesByType(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "get_table_meta":
if flag.NArg() - 1 != 3 {
fmt.Fprintln(os.Stderr, "GetTableMeta requires 3 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
argvalue1 := flag.Arg(2)
value1 := argvalue1
arg779 := flag.Arg(3)
mbTrans780 := thrift.NewTMemoryBufferLen(len(arg779))
defer mbTrans780.Close()
_, err781 := mbTrans780.WriteString(arg779)
if err781 != nil {
Usage()
return
}
factory782 := thrift.NewTJSONProtocolFactory()
jsProt783 := factory782.GetProtocol(mbTrans780)
containerStruct2 := hive_metastore.NewThriftHiveMetastoreGetTableMetaArgs()
err784 := containerStruct2.ReadField3(context.Background(), jsProt783)
if err784 != nil {
Usage()
return
}
argvalue2 := containerStruct2.TblTypes
value2 := argvalue2
fmt.Print(client.GetTableMeta(context.Background(), value0, value1, value2))
fmt.Print("\n")
break
case "get_all_tables":
if flag.NArg() - 1 != 1 {
fmt.Fprintln(os.Stderr, "GetAllTables requires 1 args")
flag.Usage()
}
argvalue0 := flag.Arg(1)
value0 := argvalue0
fmt.Print(client.GetAllTables(context.Background(), value0))
fmt.Print("\n")