hipster_sql_to_hbase 0.1.8 → 0.1.85

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1583e88aaf6c60a66733fe927e0b23cbc1212131
4
- data.tar.gz: b12dc40939b1f1ba3946f6f34fd6b81298510907
3
+ metadata.gz: 2b82a138f6e35c5a4072920ba7a5f5b6c07538e1
4
+ data.tar.gz: cab50297a9a0e006e2034bb99e803cbfb0239625
5
5
  SHA512:
6
- metadata.gz: 8a7f6babe8a3b23b6d732a61a349dc2c4e63cae89d836b122e2d58a2a9bcc744e0b1f381dbd5c3e425710183691038adf46b4dacba220e311dbd0abf1eed4875
7
- data.tar.gz: 3f24fa78d1124120133e8524fe038750933553120b181f2dd7b4c97fe7e223c7ea02b020042c9155500b3e26e171749618f51233db3a8910282613d949699c46
6
+ metadata.gz: 721c219f83f84770cc61b7e87ff3f345536168d2a7d2d962d42112ae96d1f1120e766a5fef5865c20db11a4a79ad7779d1bd1f1a4d54b14445d63f06dd70356c
7
+ data.tar.gz: d58b5d6e8d55ac34abd20e9ce71bd33dd46b38da13818365dd2aa8cd9648962e6de6169201b3cec7b2e8773ad4004474542eca7473000981c92e65d877e14553
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.85
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "hipster_sql_to_hbase"
5
- s.version = "0.1.8"
5
+ s.version = "0.1.85"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jean Lescure"]
@@ -94,6 +94,31 @@ module HipsterSqlToHbase
94
94
  HipsterSqlToHbase::SyntaxParser.new.parse(string.squish)
95
95
  end
96
96
 
97
+ # Generate a Hash from a valid, SQL string.
98
+ #
99
+ # === example:
100
+ # HipsterSqlToHbase.parse_hash "SELECT user,password FROM users WHERE id=1"
101
+ #
102
+ # === outputs:
103
+ # {
104
+ # :query_type=>:select,
105
+ # :query_hash=>{
106
+ # :select=>["user", "password"],
107
+ # :from=>"users",
108
+ # :where=>[{:column=>"id", :condition=>:"=", :value=>1}],
109
+ # :limit=>nil,
110
+ # :order_by=>nil
111
+ # }
112
+ # }
113
+ def parse_hash(string)
114
+ syntax_tree = parse_syntax(string)
115
+ return nil if syntax_tree.nil?
116
+ {
117
+ :query_type => syntax_tree.query_type,
118
+ :query_hash => syntax_tree.tree
119
+ }
120
+ end
121
+
97
122
  # Generate a <b>HipsterSqlToHbase</b>::<b>ResultTree</b> from a valid, SQL string.
98
123
  #
99
124
  # === example:
@@ -110,10 +135,10 @@ module HipsterSqlToHbase
110
135
  # :order_by=>nil
111
136
  # }
112
137
  # }
138
+ #
139
+ # === Note: the main difference between **parse_tree** and **parse_hash** is that a **ResultTree** can be further converted to Thrift calls while a **Hash** cannot.
113
140
  def parse_tree(string)
114
- syntax_tree = parse_syntax(string)
115
- return nil if syntax_tree.nil?
116
- HipsterSqlToHbase::ResultTree.new({:query_type => syntax_tree.query_type, :query_hash => syntax_tree.tree})
141
+ HipsterSqlToHbase::ResultTree.new(parse_hash(string))
117
142
  end
118
143
 
119
144
  # Generate a <b>HipsterSqlToHbase</b>::<b>ThriftCallGroup</b> from a valid, SQL string.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hipster_sql_to_hbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.85
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Lescure