impala 0.4.2 → 0.4.3
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.
- data/.travis.yml +4 -0
- data/README.md +3 -1
- data/lib/impala/cursor.rb +2 -2
- data/lib/impala/version.rb +1 -1
- data/test/test_impala.rb +1 -1
- data/test/test_impala_connected.rb +6 -1
- metadata +3 -2
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# impala-ruby
|
2
2
|
|
3
|
+
 [](http://rubygems.org/gems/impala)
|
4
|
+
|
3
5
|
This is a ruby client for [Cloudera Impala][1]. You use it like this:
|
4
6
|
|
5
7
|
```ruby
|
@@ -25,4 +27,4 @@ end
|
|
25
27
|
conn.close
|
26
28
|
```
|
27
29
|
|
28
|
-
[1]: https://ccp.cloudera.com/display/IMPALA10BETADOC/Introducing+Cloudera+Impala
|
30
|
+
[1]: https://ccp.cloudera.com/display/IMPALA10BETADOC/Introducing+Cloudera+Impala
|
data/lib/impala/cursor.rb
CHANGED
@@ -87,7 +87,7 @@ module Impala
|
|
87
87
|
|
88
88
|
begin
|
89
89
|
res = @service.fetch(@handle, false, BUFFER_SIZE)
|
90
|
-
rescue Protocol::Beeswax::BeeswaxException
|
90
|
+
rescue Protocol::Beeswax::BeeswaxException
|
91
91
|
@open = false
|
92
92
|
raise CursorError.new("Cursor has expired or been closed")
|
93
93
|
end
|
@@ -129,7 +129,7 @@ module Impala
|
|
129
129
|
end
|
130
130
|
when 'tinyint', 'smallint', 'int', 'bigint'
|
131
131
|
value.to_i
|
132
|
-
when 'double', 'float'
|
132
|
+
when 'double', 'float', 'decimal'
|
133
133
|
value.to_f
|
134
134
|
when "timestamp"
|
135
135
|
Time.parse(value)
|
data/lib/impala/version.rb
CHANGED
data/test/test_impala.rb
CHANGED
@@ -55,7 +55,7 @@ describe 'connected tests' do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'can handle double values' do
|
58
|
-
ret = @connection.query('SELECT 1.23 AS foo')
|
58
|
+
ret = @connection.query('SELECT CAST(1.23 AS double) AS foo')
|
59
59
|
assert_equal([{:foo=>1.23}], ret, "the result should be a float")
|
60
60
|
end
|
61
61
|
|
@@ -69,6 +69,11 @@ describe 'connected tests' do
|
|
69
69
|
assert_instance_of(Float, ret.first[:foo], "the result should be a float")
|
70
70
|
end
|
71
71
|
|
72
|
+
it 'can handle decimal values' do
|
73
|
+
ret = @connection.query('SELECT CAST(1.5 AS decimal(9,4)) as foo')
|
74
|
+
assert_instance_of(Float, ret.first[:foo], "the result should be a float")
|
75
|
+
end
|
76
|
+
|
72
77
|
it 'can handle timestamp values' do
|
73
78
|
ret = @connection.query('SELECT NOW() AS foo')
|
74
79
|
assert_instance_of(Time, ret.first[:foo], "the result should be a timestamp")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: impala
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thrift
|
@@ -179,6 +179,7 @@ extensions: []
|
|
179
179
|
extra_rdoc_files: []
|
180
180
|
files:
|
181
181
|
- .gitignore
|
182
|
+
- .travis.yml
|
182
183
|
- Gemfile
|
183
184
|
- LICENSE.txt
|
184
185
|
- README.md
|