impala 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,82 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.8.0)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'state_store_subscriber_service_types'
9
-
10
- module Impala
11
- module Protocol
12
- module StateStoreSubscriberService
13
- class Client
14
- include ::Thrift::Client
15
-
16
- def UpdateState(request)
17
- send_UpdateState(request)
18
- return recv_UpdateState()
19
- end
20
-
21
- def send_UpdateState(request)
22
- send_message('UpdateState', UpdateState_args, :request => request)
23
- end
24
-
25
- def recv_UpdateState()
26
- result = receive_message(UpdateState_result)
27
- return result.success unless result.success.nil?
28
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'UpdateState failed: unknown result')
29
- end
30
-
31
- end
32
-
33
- class Processor
34
- include ::Thrift::Processor
35
-
36
- def process_UpdateState(seqid, iprot, oprot)
37
- args = read_args(iprot, UpdateState_args)
38
- result = UpdateState_result.new()
39
- result.success = @handler.UpdateState(args.request)
40
- write_result(result, oprot, 'UpdateState', seqid)
41
- end
42
-
43
- end
44
-
45
- # HELPER FUNCTIONS AND STRUCTURES
46
-
47
- class UpdateState_args
48
- include ::Thrift::Struct, ::Thrift::Struct_Union
49
- REQUEST = 1
50
-
51
- FIELDS = {
52
- REQUEST => { :type => ::Thrift::Types::STRUCT, :name => 'request', :class => Impala::Protocol::TUpdateStateRequest }
53
- }
54
-
55
- def struct_fields; FIELDS; end
56
-
57
- def validate
58
- end
59
-
60
- ::Thrift::Struct.generate_accessors self
61
- end
62
-
63
- class UpdateState_result
64
- include ::Thrift::Struct, ::Thrift::Struct_Union
65
- SUCCESS = 0
66
-
67
- FIELDS = {
68
- SUCCESS => { :type => ::Thrift::Types::STRUCT, :name => 'success', :class => Impala::Protocol::TUpdateStateResponse }
69
- }
70
-
71
- def struct_fields; FIELDS; end
72
-
73
- def validate
74
- end
75
-
76
- ::Thrift::Struct.generate_accessors self
77
- end
78
-
79
- end
80
-
81
- end
82
- end
@@ -1,12 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.8.0)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'state_store_subscriber_service_types'
8
-
9
- module Impala
10
- module Protocol
11
- end
12
- end
@@ -1,67 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.8.0)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'statestore_types_types'
8
- require 'status_types'
9
- require 'types_types'
10
-
11
-
12
- module Impala
13
- module Protocol
14
- module StateStoreSubscriberServiceVersion
15
- V1 = 0
16
- VALUE_MAP = { 0 => "V1" }
17
- VALID_VALUES = Set.new([V1]).freeze
18
- end
19
-
20
- class TUpdateStateRequest
21
- include ::Thrift::Struct, ::Thrift::Struct_Union
22
- PROTOCOLVERSION = 1
23
- SERVICE_MEMBERSHIPS = 2
24
- UPDATED_OBJECTS = 3
25
- DELETED_OBJECT_KEYS = 4
26
-
27
- FIELDS = {
28
- PROTOCOLVERSION => { :type => ::Thrift::Types::I32, :name => 'protocolVersion', :default => 0, :enum_class => Impala::Protocol::StateStoreSubscriberServiceVersion },
29
- SERVICE_MEMBERSHIPS => { :type => ::Thrift::Types::LIST, :name => 'service_memberships', :element => { :type => ::Thrift::Types::STRUCT, :class => Impala::Protocol::TServiceMembership }, :optional => true },
30
- UPDATED_OBJECTS => { :type => ::Thrift::Types::LIST, :name => 'updated_objects', :element => { :type => ::Thrift::Types::STRUCT, :class => Impala::Protocol::TVersionedObject }, :optional => true },
31
- DELETED_OBJECT_KEYS => { :type => ::Thrift::Types::LIST, :name => 'deleted_object_keys', :element => { :type => ::Thrift::Types::STRING }, :optional => true }
32
- }
33
-
34
- def struct_fields; FIELDS; end
35
-
36
- def validate
37
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field protocolVersion is unset!') unless @protocolVersion
38
- unless @protocolVersion.nil? || Impala::Protocol::StateStoreSubscriberServiceVersion::VALID_VALUES.include?(@protocolVersion)
39
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field protocolVersion!')
40
- end
41
- end
42
-
43
- ::Thrift::Struct.generate_accessors self
44
- end
45
-
46
- class TUpdateStateResponse
47
- include ::Thrift::Struct, ::Thrift::Struct_Union
48
- STATUS = 1
49
- UPDATED_OBJECTS = 2
50
- DELETED_OBJECT_KEYS = 3
51
-
52
- FIELDS = {
53
- STATUS => { :type => ::Thrift::Types::STRUCT, :name => 'status', :class => Impala::Protocol::TStatus, :optional => true },
54
- UPDATED_OBJECTS => { :type => ::Thrift::Types::LIST, :name => 'updated_objects', :element => { :type => ::Thrift::Types::STRUCT, :class => Impala::Protocol::TVersionedObject }, :optional => true },
55
- DELETED_OBJECT_KEYS => { :type => ::Thrift::Types::LIST, :name => 'deleted_object_keys', :element => { :type => ::Thrift::Types::STRING }, :optional => true }
56
- }
57
-
58
- def struct_fields; FIELDS; end
59
-
60
- def validate
61
- end
62
-
63
- ::Thrift::Struct.generate_accessors self
64
- end
65
-
66
- end
67
- end
@@ -1,12 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.8.0)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'statestore_types_types'
8
-
9
- module Impala
10
- module Protocol
11
- end
12
- end
@@ -1,77 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.8.0)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'types_types'
8
-
9
-
10
- module Impala
11
- module Protocol
12
- class TVersionedObject
13
- include ::Thrift::Struct, ::Thrift::Struct_Union
14
- SERVICE_ID = 1
15
- KEY = 2
16
- TYPE = 3
17
- VERSION = 4
18
- VALUE = 5
19
-
20
- FIELDS = {
21
- SERVICE_ID => { :type => ::Thrift::Types::STRING, :name => 'service_id' },
22
- KEY => { :type => ::Thrift::Types::STRING, :name => 'key' },
23
- TYPE => { :type => ::Thrift::Types::STRING, :name => 'type' },
24
- VERSION => { :type => ::Thrift::Types::I64, :name => 'version' },
25
- VALUE => { :type => ::Thrift::Types::STRING, :name => 'value', :binary => true }
26
- }
27
-
28
- def struct_fields; FIELDS; end
29
-
30
- def validate
31
- end
32
-
33
- ::Thrift::Struct.generate_accessors self
34
- end
35
-
36
- class TServiceInstance
37
- include ::Thrift::Struct, ::Thrift::Struct_Union
38
- SUBSCRIBER_ID = 1
39
- HOST_PORT = 2
40
-
41
- FIELDS = {
42
- SUBSCRIBER_ID => { :type => ::Thrift::Types::I32, :name => 'subscriber_id' },
43
- HOST_PORT => { :type => ::Thrift::Types::STRUCT, :name => 'host_port', :class => Impala::Protocol::THostPort }
44
- }
45
-
46
- def struct_fields; FIELDS; end
47
-
48
- def validate
49
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field subscriber_id is unset!') unless @subscriber_id
50
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field host_port is unset!') unless @host_port
51
- end
52
-
53
- ::Thrift::Struct.generate_accessors self
54
- end
55
-
56
- class TServiceMembership
57
- include ::Thrift::Struct, ::Thrift::Struct_Union
58
- SERVICE_ID = 1
59
- SERVICE_INSTANCES = 2
60
-
61
- FIELDS = {
62
- SERVICE_ID => { :type => ::Thrift::Types::STRING, :name => 'service_id' },
63
- SERVICE_INSTANCES => { :type => ::Thrift::Types::LIST, :name => 'service_instances', :element => { :type => ::Thrift::Types::STRUCT, :class => Impala::Protocol::TServiceInstance } }
64
- }
65
-
66
- def struct_fields; FIELDS; end
67
-
68
- def validate
69
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field service_id is unset!') unless @service_id
70
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field service_instances is unset!') unless @service_instances
71
- end
72
-
73
- ::Thrift::Struct.generate_accessors self
74
- end
75
-
76
- end
77
- end
@@ -1,12 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.8.0)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'types_types'
8
-
9
- module Impala
10
- module Protocol
11
- end
12
- end
@@ -1,86 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.8.0)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
-
8
- module Impala
9
- module Protocol
10
- module TPrimitiveType
11
- INVALID_TYPE = 0
12
- BOOLEAN = 1
13
- TINYINT = 2
14
- SMALLINT = 3
15
- INT = 4
16
- BIGINT = 5
17
- FLOAT = 6
18
- DOUBLE = 7
19
- DATE = 8
20
- DATETIME = 9
21
- TIMESTAMP = 10
22
- STRING = 11
23
- VALUE_MAP = { 0 => "INVALID_TYPE", 1 => "BOOLEAN", 2 => "TINYINT", 3 => "SMALLINT", 4 => "INT", 5 => "BIGINT", 6 => "FLOAT", 7 => "DOUBLE", 8 => "DATE", 9 => "DATETIME", 10 => "TIMESTAMP", 11 => "STRING" }
24
- VALID_VALUES = Set.new([INVALID_TYPE, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, DATE, DATETIME, TIMESTAMP, STRING]).freeze
25
- end
26
-
27
- module TStmtType
28
- QUERY = 0
29
- DDL = 1
30
- DML = 2
31
- VALUE_MAP = { 0 => "QUERY", 1 => "DDL", 2 => "DML" }
32
- VALID_VALUES = Set.new([QUERY, DDL, DML]).freeze
33
- end
34
-
35
- module TExplainLevel
36
- NORMAL = 0
37
- VERBOSE = 1
38
- VALUE_MAP = { 0 => "NORMAL", 1 => "VERBOSE" }
39
- VALID_VALUES = Set.new([NORMAL, VERBOSE]).freeze
40
- end
41
-
42
- class THostPort
43
- include ::Thrift::Struct, ::Thrift::Struct_Union
44
- HOSTNAME = 1
45
- IPADDRESS = 2
46
- PORT = 3
47
-
48
- FIELDS = {
49
- HOSTNAME => { :type => ::Thrift::Types::STRING, :name => 'hostname' },
50
- IPADDRESS => { :type => ::Thrift::Types::STRING, :name => 'ipaddress' },
51
- PORT => { :type => ::Thrift::Types::I32, :name => 'port' }
52
- }
53
-
54
- def struct_fields; FIELDS; end
55
-
56
- def validate
57
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field hostname is unset!') unless @hostname
58
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ipaddress is unset!') unless @ipaddress
59
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field port is unset!') unless @port
60
- end
61
-
62
- ::Thrift::Struct.generate_accessors self
63
- end
64
-
65
- class TUniqueId
66
- include ::Thrift::Struct, ::Thrift::Struct_Union
67
- HI = 1
68
- LO = 2
69
-
70
- FIELDS = {
71
- HI => { :type => ::Thrift::Types::I64, :name => 'hi' },
72
- LO => { :type => ::Thrift::Types::I64, :name => 'lo' }
73
- }
74
-
75
- def struct_fields; FIELDS; end
76
-
77
- def validate
78
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field hi is unset!') unless @hi
79
- raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field lo is unset!') unless @lo
80
- end
81
-
82
- ::Thrift::Struct.generate_accessors self
83
- end
84
-
85
- end
86
- end
@@ -1,52 +0,0 @@
1
- // Copyright 2012 Cloudera Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- namespace cpp impala
16
- namespace java com.cloudera.impala.thrift
17
- namespace rb Impala.Protocol
18
- namespace rb Impala.Protocol
19
-
20
- include "Types.thrift"
21
-
22
- // Serialized, self-contained version of a RowBatch (in be/src/runtime/row-batch.h).
23
- struct TRowBatch {
24
- // total number of rows contained in this batch
25
- 1: required i32 num_rows
26
-
27
- // row composition
28
- 2: required list<Types.TTupleId> row_tuples
29
-
30
- // There are a total of num_rows * num_tuples_per_row offsets
31
- // pointing into tuple_data.
32
- // An offset of -1 records a NULL.
33
- 3: list<i32> tuple_offsets
34
-
35
- // binary tuple data, broken up into chunks
36
- // TODO: figure out how we can avoid copying the data during TRowBatch construction
37
- 4: list<string> tuple_data
38
- }
39
-
40
- // this is a union over all possible return types
41
- struct TColumnValue {
42
- // TODO: use <type>_val instead of camelcase
43
- 1: optional bool boolVal
44
- 2: optional i32 intVal
45
- 3: optional i64 longVal
46
- 4: optional double doubleVal
47
- 5: optional string stringVal
48
- }
49
-
50
- struct TResultRow {
51
- 1: list<TColumnValue> colVals
52
- }
@@ -1,61 +0,0 @@
1
- // Copyright 2012 Cloudera Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- namespace cpp impala
16
- namespace java com.cloudera.impala.thrift
17
- namespace rb Impala.Protocol
18
-
19
- include "Exprs.thrift"
20
- include "Types.thrift"
21
- include "Descriptors.thrift"
22
- include "Partitions.thrift"
23
-
24
- enum TDataSinkType {
25
- DATA_STREAM_SINK,
26
- TABLE_SINK
27
- }
28
-
29
- // Sink which forwards data to a remote plan fragment,
30
- // according to the given output partition specification
31
- // (ie, the m:1 part of an m:n data stream)
32
- struct TDataStreamSink {
33
- // destination node id
34
- 1: required Types.TPlanNodeId dest_node_id
35
-
36
- // Specification of how the output of a fragment is partitioned.
37
- // If the partitioning type is UNPARTITIONED, the output is broadcast
38
- // to each destination host.
39
- 2: required Partitions.TDataPartition output_partition
40
- }
41
-
42
- // Creates a new Hdfs files according to the evaluation of the partitionKeyExprs,
43
- // and materializes all its input RowBatches as a Hdfs file.
44
- struct THdfsTableSink {
45
- 1: required list<Exprs.TExpr> partition_key_exprs
46
- 2: required bool overwrite
47
- }
48
-
49
- // Union type of all table sinks.
50
- // Currently, only THdfsTableSink is supported, so we don't have a separate
51
- // TTableSinkType yet.
52
- struct TTableSink {
53
- 1: required Types.TTableId target_table_id
54
- 2: required THdfsTableSink hdfs_table_sink
55
- }
56
-
57
- struct TDataSink {
58
- 1: required TDataSinkType type
59
- 2: optional TDataStreamSink stream_sink
60
- 3: optional TTableSink table_sink
61
- }