impala 0.1.5 → 0.1.6

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.
@@ -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']
17
+ KNOWN_COMMANDS = ['select', 'show', 'describe', 'use', 'explain']
18
18
  DEFAULT_HOST = 'localhost'
19
19
  DEFAULT_PORT = 21000
20
20
  class InvalidQueryError < StandardError; end
@@ -43,6 +43,12 @@ module Impala
43
43
  @connected
44
44
  end
45
45
 
46
+ # Refresh the metadata store
47
+ def refresh
48
+ raise ConnectionError.new("Connection closed") unless open?
49
+ @service.ResetCatalog
50
+ end
51
+
46
52
  # Perform a query and return all the results. This will
47
53
  # load the entire result set into memory, so if you're dealing with lots
48
54
  # of rows, {#execute} may work better.
@@ -108,4 +114,4 @@ module Impala
108
114
  @service.close(handle)
109
115
  end
110
116
  end
111
- end
117
+ end
@@ -1,3 +1,3 @@
1
1
  module Impala
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -52,6 +52,10 @@ describe 'connected tests' do
52
52
  assert_instance_of(Time, ret.first[:foo])
53
53
  end
54
54
 
55
+ it 'can successfully refresh the metadata store' do
56
+ ret = @connection.refresh
57
+ end
58
+
55
59
  # TODO: this test sucks because there's no way to get multiple records
56
60
  # with a literal select. perhaps there should be importable test data?
57
61
  it 'can get a cursor and fetch one row at a time' do
@@ -68,4 +72,4 @@ describe 'connected tests' do
68
72
  it 'can successfully run a "use" query' do
69
73
  @connection.query('USE foo')
70
74
  end
71
- end
75
+ end
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.1.5
4
+ version: 0.1.6
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: 2013-03-16 00:00:00.000000000 Z
12
+ date: 2013-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thrift