impala 0.1.6 → 0.2.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.
Files changed (84) hide show
  1. data/Rakefile +0 -2
  2. data/impala.gemspec +1 -2
  3. data/lib/impala.rb +1 -1
  4. data/lib/impala/cursor.rb +10 -4
  5. data/lib/impala/protocol/beeswax_constants.rb +2 -1
  6. data/lib/impala/protocol/beeswax_service.rb +46 -46
  7. data/lib/impala/protocol/beeswax_types.rb +31 -30
  8. data/lib/impala/protocol/cli_service_constants.rb +60 -0
  9. data/lib/impala/protocol/cli_service_types.rb +1452 -0
  10. data/lib/impala/protocol/facebook_service.rb +17 -17
  11. data/lib/impala/protocol/fb303_constants.rb +2 -1
  12. data/lib/impala/protocol/fb303_types.rb +3 -2
  13. data/lib/impala/protocol/hive_metastore_constants.rb +2 -1
  14. data/lib/impala/protocol/hive_metastore_types.rb +102 -101
  15. data/lib/impala/protocol/impala_hive_server2_service.rb +29 -0
  16. data/lib/impala/protocol/impala_service.rb +135 -18
  17. data/lib/impala/protocol/impala_service_constants.rb +2 -1
  18. data/lib/impala/protocol/impala_service_types.rb +54 -10
  19. data/lib/impala/protocol/status_constants.rb +2 -1
  20. data/lib/impala/protocol/status_types.rb +9 -7
  21. data/lib/impala/protocol/t_c_l_i_service.rb +948 -0
  22. data/lib/impala/protocol/thrift_hive_metastore.rb +507 -507
  23. data/lib/impala/version.rb +1 -1
  24. data/test/test_impala_connected.rb +93 -13
  25. data/thrift/ImpalaService.thrift +78 -6
  26. data/thrift/Status.thrift +2 -1
  27. data/thrift/beeswax.thrift +1 -1
  28. data/thrift/cli_service.thrift +1015 -0
  29. metadata +9 -75
  30. data/lib/impala/protocol/data_constants.rb +0 -12
  31. data/lib/impala/protocol/data_sinks_constants.rb +0 -12
  32. data/lib/impala/protocol/data_sinks_types.rb +0 -107
  33. data/lib/impala/protocol/data_types.rb +0 -77
  34. data/lib/impala/protocol/descriptors_constants.rb +0 -12
  35. data/lib/impala/protocol/descriptors_types.rb +0 -266
  36. data/lib/impala/protocol/exprs_constants.rb +0 -12
  37. data/lib/impala/protocol/exprs_types.rb +0 -345
  38. data/lib/impala/protocol/frontend_constants.rb +0 -12
  39. data/lib/impala/protocol/frontend_types.rb +0 -347
  40. data/lib/impala/protocol/impala_internal_service.rb +0 -244
  41. data/lib/impala/protocol/impala_internal_service_constants.rb +0 -12
  42. data/lib/impala/protocol/impala_internal_service_types.rb +0 -362
  43. data/lib/impala/protocol/impala_plan_service.rb +0 -310
  44. data/lib/impala/protocol/impala_plan_service_constants.rb +0 -12
  45. data/lib/impala/protocol/impala_plan_service_types.rb +0 -36
  46. data/lib/impala/protocol/java_constants_constants.rb +0 -42
  47. data/lib/impala/protocol/java_constants_types.rb +0 -14
  48. data/lib/impala/protocol/opcodes_constants.rb +0 -12
  49. data/lib/impala/protocol/opcodes_types.rb +0 -309
  50. data/lib/impala/protocol/partitions_constants.rb +0 -12
  51. data/lib/impala/protocol/partitions_types.rb +0 -44
  52. data/lib/impala/protocol/plan_nodes_constants.rb +0 -12
  53. data/lib/impala/protocol/plan_nodes_types.rb +0 -345
  54. data/lib/impala/protocol/planner_constants.rb +0 -12
  55. data/lib/impala/protocol/planner_types.rb +0 -78
  56. data/lib/impala/protocol/runtime_profile_constants.rb +0 -12
  57. data/lib/impala/protocol/runtime_profile_types.rb +0 -97
  58. data/lib/impala/protocol/state_store_service.rb +0 -244
  59. data/lib/impala/protocol/state_store_service_constants.rb +0 -12
  60. data/lib/impala/protocol/state_store_service_types.rb +0 -185
  61. data/lib/impala/protocol/state_store_subscriber_service.rb +0 -82
  62. data/lib/impala/protocol/state_store_subscriber_service_constants.rb +0 -12
  63. data/lib/impala/protocol/state_store_subscriber_service_types.rb +0 -67
  64. data/lib/impala/protocol/statestore_types_constants.rb +0 -12
  65. data/lib/impala/protocol/statestore_types_types.rb +0 -77
  66. data/lib/impala/protocol/types_constants.rb +0 -12
  67. data/lib/impala/protocol/types_types.rb +0 -86
  68. data/thrift/Data.thrift +0 -52
  69. data/thrift/DataSinks.thrift +0 -61
  70. data/thrift/Descriptors.thrift +0 -115
  71. data/thrift/Exprs.thrift +0 -134
  72. data/thrift/Frontend.thrift +0 -193
  73. data/thrift/ImpalaInternalService.thrift +0 -265
  74. data/thrift/ImpalaPlanService.thrift +0 -44
  75. data/thrift/JavaConstants.thrift +0 -60
  76. data/thrift/Opcodes.thrift +0 -317
  77. data/thrift/Partitions.thrift +0 -41
  78. data/thrift/PlanNodes.thrift +0 -184
  79. data/thrift/Planner.thrift +0 -72
  80. data/thrift/RuntimeProfile.thrift +0 -58
  81. data/thrift/StateStoreService.thrift +0 -121
  82. data/thrift/StateStoreSubscriberService.thrift +0 -64
  83. data/thrift/StatestoreTypes.thrift +0 -50
  84. data/thrift/Types.thrift +0 -71
data/Rakefile CHANGED
@@ -12,12 +12,10 @@ end
12
12
  THRIFT_FILES = FileList['./thrift/*.thrift']
13
13
  GENNED_FILES = FileList['./lib/impala/protocol/*']
14
14
 
15
- # eden only works on 1.8, unfortunately =(
16
15
  task :gen do
17
16
  THRIFT_FILES.each do |f|
18
17
  sh "thrift -out lib/impala/protocol --gen rb #{f}"
19
18
  end
20
- sh "eden rewrite lib/impala/protocol/*.rb"
21
19
  end
22
20
 
23
21
  task :clean do
@@ -12,10 +12,9 @@ Gem::Specification.new do |gem|
12
12
  gem.summary = %q{A ruby client for Cloudera's Impala}
13
13
  gem.homepage = "https://github.com/colinmarc/impala-ruby"
14
14
 
15
- gem.add_dependency('thrift', '~> 0.9')
15
+ gem.add_dependency('thrift', '~> 0.9.1')
16
16
 
17
17
  gem.add_development_dependency('rake')
18
- gem.add_development_dependency('eden')
19
18
  gem.add_development_dependency('pry')
20
19
 
21
20
  gem.add_development_dependency('minitest')
@@ -14,7 +14,7 @@ require 'impala/cursor'
14
14
  require 'impala/connection'
15
15
 
16
16
  module Impala
17
- KNOWN_COMMANDS = ['select', 'show', 'describe', 'use', 'explain']
17
+ KNOWN_COMMANDS = ['select', 'insert', 'show', 'describe', 'use', 'explain', 'create', 'drop']
18
18
  DEFAULT_HOST = 'localhost'
19
19
  DEFAULT_PORT = 21000
20
20
  class InvalidQueryError < StandardError; end
@@ -3,17 +3,19 @@ module Impala
3
3
  # into memory at once. This can be useful if you're dealing with lots of
4
4
  # rows. It implements Enumerable, so you can use each/select/map/etc.
5
5
  class Cursor
6
+ BUFFER_SIZE = 1024
6
7
  include Enumerable
7
8
 
8
- def initialize(handle, service, buffer_length=1024)
9
+ def initialize(handle, service)
9
10
  @handle = handle
10
11
  @service = service
11
12
 
12
- @buffer_length = buffer_length
13
- @row_buffer = []
14
13
 
14
+ @row_buffer = []
15
15
  @done = false
16
16
  @open = true
17
+
18
+ fetch_more
17
19
  end
18
20
 
19
21
  def inspect
@@ -75,10 +77,14 @@ module Impala
75
77
  end
76
78
 
77
79
  def fetch_more
80
+ fetch_batch until @done || @row_buffer.count >= BUFFER_SIZE
81
+ end
82
+
83
+ def fetch_batch
78
84
  return if @done
79
85
 
80
86
  begin
81
- res = @service.fetch(@handle, false, @buffer_length)
87
+ res = @service.fetch(@handle, false, BUFFER_SIZE)
82
88
  rescue Protocol::Beeswax::BeeswaxException => e
83
89
  @closed = true
84
90
  raise CursorError.new("Cursor has expired or been closed")
@@ -1,9 +1,10 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (0.8.0)
2
+ # Autogenerated by Thrift Compiler (0.9.1)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
6
6
 
7
+ require 'thrift'
7
8
  require 'beeswax_types'
8
9
 
9
10
  module Impala
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (0.8.0)
2
+ # Autogenerated by Thrift Compiler (0.9.1)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -212,7 +212,7 @@ module Impala
212
212
  result = Query_result.new()
213
213
  begin
214
214
  result.success = @handler.query(args.query)
215
- rescue Impala::Protocol::Beeswax::BeeswaxException => error
215
+ rescue ::Impala::Protocol::Beeswax::BeeswaxException => error
216
216
  result.error = error
217
217
  end
218
218
  write_result(result, oprot, 'query', seqid)
@@ -223,7 +223,7 @@ module Impala
223
223
  result = ExecuteAndWait_result.new()
224
224
  begin
225
225
  result.success = @handler.executeAndWait(args.query, args.clientCtx)
226
- rescue Impala::Protocol::Beeswax::BeeswaxException => error
226
+ rescue ::Impala::Protocol::Beeswax::BeeswaxException => error
227
227
  result.error = error
228
228
  end
229
229
  write_result(result, oprot, 'executeAndWait', seqid)
@@ -234,7 +234,7 @@ module Impala
234
234
  result = Explain_result.new()
235
235
  begin
236
236
  result.success = @handler.explain(args.query)
237
- rescue Impala::Protocol::Beeswax::BeeswaxException => error
237
+ rescue ::Impala::Protocol::Beeswax::BeeswaxException => error
238
238
  result.error = error
239
239
  end
240
240
  write_result(result, oprot, 'explain', seqid)
@@ -245,9 +245,9 @@ module Impala
245
245
  result = Fetch_result.new()
246
246
  begin
247
247
  result.success = @handler.fetch(args.query_id, args.start_over, args.fetch_size)
248
- rescue Impala::Protocol::Beeswax::QueryNotFoundException => error
248
+ rescue ::Impala::Protocol::Beeswax::QueryNotFoundException => error
249
249
  result.error = error
250
- rescue Impala::Protocol::Beeswax::BeeswaxException => error2
250
+ rescue ::Impala::Protocol::Beeswax::BeeswaxException => error2
251
251
  result.error2 = error2
252
252
  end
253
253
  write_result(result, oprot, 'fetch', seqid)
@@ -258,7 +258,7 @@ module Impala
258
258
  result = Get_state_result.new()
259
259
  begin
260
260
  result.success = @handler.get_state(args.handle)
261
- rescue Impala::Protocol::Beeswax::QueryNotFoundException => error
261
+ rescue ::Impala::Protocol::Beeswax::QueryNotFoundException => error
262
262
  result.error = error
263
263
  end
264
264
  write_result(result, oprot, 'get_state', seqid)
@@ -269,7 +269,7 @@ module Impala
269
269
  result = Get_results_metadata_result.new()
270
270
  begin
271
271
  result.success = @handler.get_results_metadata(args.handle)
272
- rescue Impala::Protocol::Beeswax::QueryNotFoundException => error
272
+ rescue ::Impala::Protocol::Beeswax::QueryNotFoundException => error
273
273
  result.error = error
274
274
  end
275
275
  write_result(result, oprot, 'get_results_metadata', seqid)
@@ -294,7 +294,7 @@ module Impala
294
294
  result = Get_log_result.new()
295
295
  begin
296
296
  result.success = @handler.get_log(args.context)
297
- rescue Impala::Protocol::Beeswax::QueryNotFoundException => error
297
+ rescue ::Impala::Protocol::Beeswax::QueryNotFoundException => error
298
298
  result.error = error
299
299
  end
300
300
  write_result(result, oprot, 'get_log', seqid)
@@ -312,9 +312,9 @@ module Impala
312
312
  result = Close_result.new()
313
313
  begin
314
314
  @handler.close(args.handle)
315
- rescue Impala::Protocol::Beeswax::QueryNotFoundException => error
315
+ rescue ::Impala::Protocol::Beeswax::QueryNotFoundException => error
316
316
  result.error = error
317
- rescue Impala::Protocol::Beeswax::BeeswaxException => error2
317
+ rescue ::Impala::Protocol::Beeswax::BeeswaxException => error2
318
318
  result.error2 = error2
319
319
  end
320
320
  write_result(result, oprot, 'close', seqid)
@@ -336,7 +336,7 @@ module Impala
336
336
  QUERY = 1
337
337
 
338
338
  FIELDS = {
339
- QUERY => { :type => ::Thrift::Types::STRUCT, :name => 'query', :class => Impala::Protocol::Beeswax::Query }
339
+ QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => ::Impala::Protocol::Beeswax::Query}
340
340
  }
341
341
 
342
342
  def struct_fields; FIELDS; end
@@ -353,8 +353,8 @@ module Impala
353
353
  ERROR = 1
354
354
 
355
355
  FIELDS = {
356
- SUCCESS => { :type => ::Thrift::Types::STRUCT, :name => 'success', :class => Impala::Protocol::Beeswax::QueryHandle },
357
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::BeeswaxException }
356
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Impala::Protocol::Beeswax::QueryHandle},
357
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::BeeswaxException}
358
358
  }
359
359
 
360
360
  def struct_fields; FIELDS; end
@@ -371,8 +371,8 @@ module Impala
371
371
  CLIENTCTX = 2
372
372
 
373
373
  FIELDS = {
374
- QUERY => { :type => ::Thrift::Types::STRUCT, :name => 'query', :class => Impala::Protocol::Beeswax::Query },
375
- CLIENTCTX => { :type => ::Thrift::Types::STRING, :name => 'clientCtx' }
374
+ QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => ::Impala::Protocol::Beeswax::Query},
375
+ CLIENTCTX => {:type => ::Thrift::Types::STRING, :name => 'clientCtx'}
376
376
  }
377
377
 
378
378
  def struct_fields; FIELDS; end
@@ -389,8 +389,8 @@ module Impala
389
389
  ERROR = 1
390
390
 
391
391
  FIELDS = {
392
- SUCCESS => { :type => ::Thrift::Types::STRUCT, :name => 'success', :class => Impala::Protocol::Beeswax::QueryHandle },
393
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::BeeswaxException }
392
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Impala::Protocol::Beeswax::QueryHandle},
393
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::BeeswaxException}
394
394
  }
395
395
 
396
396
  def struct_fields; FIELDS; end
@@ -406,7 +406,7 @@ module Impala
406
406
  QUERY = 1
407
407
 
408
408
  FIELDS = {
409
- QUERY => { :type => ::Thrift::Types::STRUCT, :name => 'query', :class => Impala::Protocol::Beeswax::Query }
409
+ QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => ::Impala::Protocol::Beeswax::Query}
410
410
  }
411
411
 
412
412
  def struct_fields; FIELDS; end
@@ -423,8 +423,8 @@ module Impala
423
423
  ERROR = 1
424
424
 
425
425
  FIELDS = {
426
- SUCCESS => { :type => ::Thrift::Types::STRUCT, :name => 'success', :class => Impala::Protocol::Beeswax::QueryExplanation },
427
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::BeeswaxException }
426
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Impala::Protocol::Beeswax::QueryExplanation},
427
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::BeeswaxException}
428
428
  }
429
429
 
430
430
  def struct_fields; FIELDS; end
@@ -442,9 +442,9 @@ module Impala
442
442
  FETCH_SIZE = 3
443
443
 
444
444
  FIELDS = {
445
- QUERY_ID => { :type => ::Thrift::Types::STRUCT, :name => 'query_id', :class => Impala::Protocol::Beeswax::QueryHandle },
446
- START_OVER => { :type => ::Thrift::Types::BOOL, :name => 'start_over' },
447
- FETCH_SIZE => { :type => ::Thrift::Types::I32, :name => 'fetch_size', :default => -1 }
445
+ QUERY_ID => {:type => ::Thrift::Types::STRUCT, :name => 'query_id', :class => ::Impala::Protocol::Beeswax::QueryHandle},
446
+ START_OVER => {:type => ::Thrift::Types::BOOL, :name => 'start_over'},
447
+ FETCH_SIZE => {:type => ::Thrift::Types::I32, :name => 'fetch_size', :default => -1}
448
448
  }
449
449
 
450
450
  def struct_fields; FIELDS; end
@@ -462,9 +462,9 @@ module Impala
462
462
  ERROR2 = 2
463
463
 
464
464
  FIELDS = {
465
- SUCCESS => { :type => ::Thrift::Types::STRUCT, :name => 'success', :class => Impala::Protocol::Beeswax::Results },
466
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::QueryNotFoundException },
467
- ERROR2 => { :type => ::Thrift::Types::STRUCT, :name => 'error2', :class => Impala::Protocol::Beeswax::BeeswaxException }
465
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Impala::Protocol::Beeswax::Results},
466
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::QueryNotFoundException},
467
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::Impala::Protocol::Beeswax::BeeswaxException}
468
468
  }
469
469
 
470
470
  def struct_fields; FIELDS; end
@@ -480,7 +480,7 @@ module Impala
480
480
  HANDLE = 1
481
481
 
482
482
  FIELDS = {
483
- HANDLE => { :type => ::Thrift::Types::STRUCT, :name => 'handle', :class => Impala::Protocol::Beeswax::QueryHandle }
483
+ HANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'handle', :class => ::Impala::Protocol::Beeswax::QueryHandle}
484
484
  }
485
485
 
486
486
  def struct_fields; FIELDS; end
@@ -497,14 +497,14 @@ module Impala
497
497
  ERROR = 1
498
498
 
499
499
  FIELDS = {
500
- SUCCESS => { :type => ::Thrift::Types::I32, :name => 'success', :enum_class => Impala::Protocol::Beeswax::QueryState },
501
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::QueryNotFoundException }
500
+ SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success', :enum_class => ::Impala::Protocol::Beeswax::QueryState},
501
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::QueryNotFoundException}
502
502
  }
503
503
 
504
504
  def struct_fields; FIELDS; end
505
505
 
506
506
  def validate
507
- unless @success.nil? || Impala::Protocol::Beeswax::QueryState::VALID_VALUES.include?(@success)
507
+ unless @success.nil? || ::Impala::Protocol::Beeswax::QueryState::VALID_VALUES.include?(@success)
508
508
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field success!')
509
509
  end
510
510
  end
@@ -517,7 +517,7 @@ module Impala
517
517
  HANDLE = 1
518
518
 
519
519
  FIELDS = {
520
- HANDLE => { :type => ::Thrift::Types::STRUCT, :name => 'handle', :class => Impala::Protocol::Beeswax::QueryHandle }
520
+ HANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'handle', :class => ::Impala::Protocol::Beeswax::QueryHandle}
521
521
  }
522
522
 
523
523
  def struct_fields; FIELDS; end
@@ -534,8 +534,8 @@ module Impala
534
534
  ERROR = 1
535
535
 
536
536
  FIELDS = {
537
- SUCCESS => { :type => ::Thrift::Types::STRUCT, :name => 'success', :class => Impala::Protocol::Beeswax::ResultsMetadata },
538
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::QueryNotFoundException }
537
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Impala::Protocol::Beeswax::ResultsMetadata},
538
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::QueryNotFoundException}
539
539
  }
540
540
 
541
541
  def struct_fields; FIELDS; end
@@ -551,7 +551,7 @@ module Impala
551
551
  S = 1
552
552
 
553
553
  FIELDS = {
554
- S => { :type => ::Thrift::Types::STRING, :name => 's' }
554
+ S => {:type => ::Thrift::Types::STRING, :name => 's'}
555
555
  }
556
556
 
557
557
  def struct_fields; FIELDS; end
@@ -567,7 +567,7 @@ module Impala
567
567
  SUCCESS = 0
568
568
 
569
569
  FIELDS = {
570
- SUCCESS => { :type => ::Thrift::Types::STRING, :name => 'success' }
570
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
571
571
  }
572
572
 
573
573
  def struct_fields; FIELDS; end
@@ -598,7 +598,7 @@ module Impala
598
598
  SUCCESS = 0
599
599
 
600
600
  FIELDS = {
601
- SUCCESS => { :type => ::Thrift::Types::STRING, :name => 'success' }
601
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
602
602
  }
603
603
 
604
604
  def struct_fields; FIELDS; end
@@ -614,7 +614,7 @@ module Impala
614
614
  CONTEXT = 1
615
615
 
616
616
  FIELDS = {
617
- CONTEXT => { :type => ::Thrift::Types::STRING, :name => 'context' }
617
+ CONTEXT => {:type => ::Thrift::Types::STRING, :name => 'context'}
618
618
  }
619
619
 
620
620
  def struct_fields; FIELDS; end
@@ -631,8 +631,8 @@ module Impala
631
631
  ERROR = 1
632
632
 
633
633
  FIELDS = {
634
- SUCCESS => { :type => ::Thrift::Types::STRING, :name => 'success' },
635
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::QueryNotFoundException }
634
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'},
635
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::QueryNotFoundException}
636
636
  }
637
637
 
638
638
  def struct_fields; FIELDS; end
@@ -648,7 +648,7 @@ module Impala
648
648
  INCLUDE_HADOOP = 1
649
649
 
650
650
  FIELDS = {
651
- INCLUDE_HADOOP => { :type => ::Thrift::Types::BOOL, :name => 'include_hadoop' }
651
+ INCLUDE_HADOOP => {:type => ::Thrift::Types::BOOL, :name => 'include_hadoop'}
652
652
  }
653
653
 
654
654
  def struct_fields; FIELDS; end
@@ -664,7 +664,7 @@ module Impala
664
664
  SUCCESS = 0
665
665
 
666
666
  FIELDS = {
667
- SUCCESS => { :type => ::Thrift::Types::LIST, :name => 'success', :element => { :type => ::Thrift::Types::STRUCT, :class => Impala::Protocol::Beeswax::ConfigVariable } }
667
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Impala::Protocol::Beeswax::ConfigVariable}}
668
668
  }
669
669
 
670
670
  def struct_fields; FIELDS; end
@@ -680,7 +680,7 @@ module Impala
680
680
  HANDLE = 1
681
681
 
682
682
  FIELDS = {
683
- HANDLE => { :type => ::Thrift::Types::STRUCT, :name => 'handle', :class => Impala::Protocol::Beeswax::QueryHandle }
683
+ HANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'handle', :class => ::Impala::Protocol::Beeswax::QueryHandle}
684
684
  }
685
685
 
686
686
  def struct_fields; FIELDS; end
@@ -697,8 +697,8 @@ module Impala
697
697
  ERROR2 = 2
698
698
 
699
699
  FIELDS = {
700
- ERROR => { :type => ::Thrift::Types::STRUCT, :name => 'error', :class => Impala::Protocol::Beeswax::QueryNotFoundException },
701
- ERROR2 => { :type => ::Thrift::Types::STRUCT, :name => 'error2', :class => Impala::Protocol::Beeswax::BeeswaxException }
700
+ ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'error', :class => ::Impala::Protocol::Beeswax::QueryNotFoundException},
701
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::Impala::Protocol::Beeswax::BeeswaxException}
702
702
  }
703
703
 
704
704
  def struct_fields; FIELDS; end
@@ -714,7 +714,7 @@ module Impala
714
714
  LOG_CONTEXT = 1
715
715
 
716
716
  FIELDS = {
717
- LOG_CONTEXT => { :type => ::Thrift::Types::STRING, :name => 'log_context' }
717
+ LOG_CONTEXT => {:type => ::Thrift::Types::STRING, :name => 'log_context'}
718
718
  }
719
719
 
720
720
  def struct_fields; FIELDS; end
@@ -1,9 +1,10 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (0.8.0)
2
+ # Autogenerated by Thrift Compiler (0.9.1)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
6
6
 
7
+ require 'thrift'
7
8
  require 'hive_metastore_types'
8
9
 
9
10
 
@@ -17,7 +18,7 @@ module Impala
17
18
  RUNNING = 3
18
19
  FINISHED = 4
19
20
  EXCEPTION = 5
20
- VALUE_MAP = { 0 => "CREATED", 1 => "INITIALIZED", 2 => "COMPILED", 3 => "RUNNING", 4 => "FINISHED", 5 => "EXCEPTION" }
21
+ VALUE_MAP = {0 => "CREATED", 1 => "INITIALIZED", 2 => "COMPILED", 3 => "RUNNING", 4 => "FINISHED", 5 => "EXCEPTION"}
21
22
  VALID_VALUES = Set.new([CREATED, INITIALIZED, COMPILED, RUNNING, FINISHED, EXCEPTION]).freeze
22
23
  end
23
24
 
@@ -28,9 +29,9 @@ module Impala
28
29
  HADOOP_USER = 4
29
30
 
30
31
  FIELDS = {
31
- QUERY => { :type => ::Thrift::Types::STRING, :name => 'query' },
32
- CONFIGURATION => { :type => ::Thrift::Types::LIST, :name => 'configuration', :element => { :type => ::Thrift::Types::STRING } },
33
- HADOOP_USER => { :type => ::Thrift::Types::STRING, :name => 'hadoop_user' }
32
+ QUERY => {:type => ::Thrift::Types::STRING, :name => 'query'},
33
+ CONFIGURATION => {:type => ::Thrift::Types::LIST, :name => 'configuration', :element => {:type => ::Thrift::Types::STRING}},
34
+ HADOOP_USER => {:type => ::Thrift::Types::STRING, :name => 'hadoop_user'}
34
35
  }
35
36
 
36
37
  def struct_fields; FIELDS; end
@@ -47,8 +48,8 @@ module Impala
47
48
  LOG_CONTEXT = 2
48
49
 
49
50
  FIELDS = {
50
- ID => { :type => ::Thrift::Types::STRING, :name => 'id' },
51
- LOG_CONTEXT => { :type => ::Thrift::Types::STRING, :name => 'log_context' }
51
+ ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
52
+ LOG_CONTEXT => {:type => ::Thrift::Types::STRING, :name => 'log_context'}
52
53
  }
53
54
 
54
55
  def struct_fields; FIELDS; end
@@ -64,7 +65,7 @@ module Impala
64
65
  TEXTUAL = 1
65
66
 
66
67
  FIELDS = {
67
- TEXTUAL => { :type => ::Thrift::Types::STRING, :name => 'textual' }
68
+ TEXTUAL => {:type => ::Thrift::Types::STRING, :name => 'textual'}
68
69
  }
69
70
 
70
71
  def struct_fields; FIELDS; end
@@ -84,11 +85,11 @@ module Impala
84
85
  HAS_MORE = 5
85
86
 
86
87
  FIELDS = {
87
- READY => { :type => ::Thrift::Types::BOOL, :name => 'ready' },
88
- COLUMNS => { :type => ::Thrift::Types::LIST, :name => 'columns', :element => { :type => ::Thrift::Types::STRING } },
89
- DATA => { :type => ::Thrift::Types::LIST, :name => 'data', :element => { :type => ::Thrift::Types::STRING } },
90
- START_ROW => { :type => ::Thrift::Types::I64, :name => 'start_row' },
91
- HAS_MORE => { :type => ::Thrift::Types::BOOL, :name => 'has_more' }
88
+ READY => {:type => ::Thrift::Types::BOOL, :name => 'ready'},
89
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRING}},
90
+ DATA => {:type => ::Thrift::Types::LIST, :name => 'data', :element => {:type => ::Thrift::Types::STRING}},
91
+ START_ROW => {:type => ::Thrift::Types::I64, :name => 'start_row'},
92
+ HAS_MORE => {:type => ::Thrift::Types::BOOL, :name => 'has_more'}
92
93
  }
93
94
 
94
95
  def struct_fields; FIELDS; end
@@ -100,7 +101,7 @@ module Impala
100
101
  end
101
102
 
102
103
  # Metadata information about the results.
103
- # Applicable only for SELECT.
104
+ # Applicable only for SELECT.
104
105
  class ResultsMetadata
105
106
  include ::Thrift::Struct, ::Thrift::Struct_Union
106
107
  SCHEMA = 1
@@ -109,14 +110,14 @@ module Impala
109
110
  DELIM = 4
110
111
 
111
112
  FIELDS = {
112
- # The schema of the results
113
- SCHEMA => { :type => ::Thrift::Types::STRUCT, :name => 'schema', :class => Impala::Protocol::HiveMetastore::Schema },
114
- # The directory containing the results. Not applicable for partition table.
115
- TABLE_DIR => { :type => ::Thrift::Types::STRING, :name => 'table_dir' },
116
- # If the results are straight from an existing table, the table name.
117
- IN_TABLENAME => { :type => ::Thrift::Types::STRING, :name => 'in_tablename' },
118
- # Field delimiter
119
- DELIM => { :type => ::Thrift::Types::STRING, :name => 'delim' }
113
+ # The schema of the results
114
+ SCHEMA => {:type => ::Thrift::Types::STRUCT, :name => 'schema', :class => ::Impala::Protocol::HiveMetastore::Schema},
115
+ # The directory containing the results. Not applicable for partition table.
116
+ TABLE_DIR => {:type => ::Thrift::Types::STRING, :name => 'table_dir'},
117
+ # If the results are straight from an existing table, the table name.
118
+ IN_TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'in_tablename'},
119
+ # Field delimiter
120
+ DELIM => {:type => ::Thrift::Types::STRING, :name => 'delim'}
120
121
  }
121
122
 
122
123
  def struct_fields; FIELDS; end
@@ -136,11 +137,11 @@ module Impala
136
137
  SQLSTATE = 5
137
138
 
138
139
  FIELDS = {
139
- MESSAGE => { :type => ::Thrift::Types::STRING, :name => 'message' },
140
- LOG_CONTEXT => { :type => ::Thrift::Types::STRING, :name => 'log_context' },
141
- HANDLE => { :type => ::Thrift::Types::STRUCT, :name => 'handle', :class => Impala::Protocol::Beeswax::QueryHandle },
142
- ERRORCODE => { :type => ::Thrift::Types::I32, :name => 'errorCode', :default => 0, :optional => true },
143
- SQLSTATE => { :type => ::Thrift::Types::STRING, :name => 'SQLState', :default => %q" ", :optional => true }
140
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'},
141
+ LOG_CONTEXT => {:type => ::Thrift::Types::STRING, :name => 'log_context'},
142
+ HANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'handle', :class => ::Impala::Protocol::Beeswax::QueryHandle},
143
+ ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :default => 0, :optional => true},
144
+ SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'SQLState', :default => %q" ", :optional => true}
144
145
  }
145
146
 
146
147
  def struct_fields; FIELDS; end
@@ -174,9 +175,9 @@ module Impala
174
175
  DESCRIPTION = 3
175
176
 
176
177
  FIELDS = {
177
- KEY => { :type => ::Thrift::Types::STRING, :name => 'key' },
178
- VALUE => { :type => ::Thrift::Types::STRING, :name => 'value' },
179
- DESCRIPTION => { :type => ::Thrift::Types::STRING, :name => 'description' }
178
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
179
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'},
180
+ DESCRIPTION => {:type => ::Thrift::Types::STRING, :name => 'description'}
180
181
  }
181
182
 
182
183
  def struct_fields; FIELDS; end