Module: RBHive
- Defined in:
- lib/rbhive/version.rb,
lib/rbhive/connection.rb,
lib/rbhive/result_set.rb,
lib/rbhive/table_schema.rb,
lib/rbhive/schema_definition.rb,
lib/rbhive/t_c_l_i_connection.rb,
lib/rbhive/t_c_l_i_result_set.rb,
lib/rbhive/t_c_l_i_schema_definition.rb
Defined Under Namespace
Classes: Connection, ResultSet, SchemaDefinition, StdOutLogger, TCLIConnection, TCLIResultSet, TCLISchemaDefinition, TableSchema
Constant Summary
collapse
- VERSION =
'0.5.1'
- HIVE_THRIFT_MAPPING =
{
10 => 0,
11 => 1,
12 => 2
}
Class Method Summary
collapse
Class Method Details
.connect(server, port = 10_000) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/rbhive/connection.rb', line 10
def connect(server, port=10_000)
connection = RBHive::Connection.new(server, port)
ret = nil
begin
connection.open
ret = yield(connection)
ensure
connection.close
ret
end
end
|
.tcli_connect(server, port = 10_000, options) ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/rbhive/t_c_l_i_connection.rb', line 40
def tcli_connect(server, port=10_000, options)
connection = RBHive::TCLIConnection.new(server, port, options)
ret = nil
begin
connection.open
connection.open_session
ret = yield(connection)
ensure
begin
connection.close_session if connection.session
connection.close
rescue IOError => e
end
end
return ret
end
|