sequel-hive-adapter 0.2.0 → 0.2.1
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/README.rdoc +9 -0
- data/VERSION +1 -1
- data/lib/sequel/adapters/hive.rb +3 -1
- data/sequel-hive-adapter.gemspec +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -13,6 +13,15 @@ A Hadoop Hive adapter for Sequel. Uses rbhive and thrift.
|
|
13
13
|
DB = Sequel.connect("hive://localhost")
|
14
14
|
DB[:table_name].where(:date => "2011-05-05").limit(1)
|
15
15
|
|
16
|
+
Also from the command-line:
|
17
|
+
|
18
|
+
$ sequel "hive://localhost"
|
19
|
+
Connecting to localhost on port 10000
|
20
|
+
Your database is stored in DB...
|
21
|
+
> DB.tables
|
22
|
+
Executing Hive Query: SHOW TABLES
|
23
|
+
=> [["table1","table2",...]]
|
24
|
+
|
16
25
|
== Contributing to sequel-hive-adapter
|
17
26
|
|
18
27
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/sequel/adapters/hive.rb
CHANGED
@@ -28,6 +28,7 @@ module Sequel
|
|
28
28
|
|
29
29
|
def schema(table, opts={})
|
30
30
|
hero = execute("DESCRIBE #{table}")
|
31
|
+
puts "test"
|
31
32
|
hero[2..-1].map do |h|
|
32
33
|
[h.first.strip.to_sym, {:db_type => h[1].strip.to_sym, :type => h[1].strip.to_sym}]
|
33
34
|
end.reject{|r| [:"", :col_name].include?(r.first) || r.first[/Partition Information/] }
|
@@ -47,7 +48,8 @@ module Sequel
|
|
47
48
|
class Dataset < Sequel::Dataset
|
48
49
|
SELECT_CLAUSE_METHODS = clause_methods(:select, %w'distinct columns from join where group having compounds order limit')
|
49
50
|
|
50
|
-
|
51
|
+
#TODO better type conversion
|
52
|
+
CONVERT_FROM = { :boolean => :to_s, :string => :to_s, :bigint => :to_i, :float => :to_f, :double => :to_f, :int => :to_i, :smallint => :to_i, :tinyint => :to_i }
|
51
53
|
|
52
54
|
def schema
|
53
55
|
@schema ||= @db.schema(@opts[:from].first)
|
data/sequel-hive-adapter.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sequel-hive-adapter}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["hrp"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-07}
|
13
13
|
s.description = %q{A Hadoop Hive adapter for Sequel. Uses RBHive and Thrift.}
|
14
14
|
s.email = %q{hrparmar@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: sequel-hive-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- hrp
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-07 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sequel
|
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
136
|
requirements:
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
hash:
|
139
|
+
hash: 3982659975307673289
|
140
140
|
segments:
|
141
141
|
- 0
|
142
142
|
version: "0"
|