activerecord-cassandra-adapter 0.1.0

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.
@@ -0,0 +1,69 @@
1
+ = activerecord-cassandra-adapter
2
+
3
+ Copyright (c) 2010 SUGAWARA Genki <sgwr_dts@yahoo.co.jp>
4
+
5
+ == Description
6
+
7
+ activerecord-cassandra-adapter is a Cassandra adapter for ActiveRecord.
8
+
9
+ activerecord-cassandra-adapter depend on Cassandra Ruby Driver.
10
+
11
+ see http://rubygems.org/gems/cassandra
12
+
13
+ == Homepage
14
+
15
+ http://github.com/winebarrel/activerecord-cassandra-adapter
16
+
17
+ == Install
18
+
19
+ gem install activerecord-cassandra-adapter
20
+
21
+ == Example
22
+ === database.yml
23
+
24
+ development:
25
+ adapter: cassandra
26
+ host: 127.0.0.1
27
+ port: 9160
28
+ keyspace: employees
29
+
30
+ === Model
31
+
32
+ class Employee < ActiveRecord::Base
33
+ include ActiveCassandra::CF
34
+
35
+ # identifier lambda { Time.now.tv_sec }
36
+ end
37
+
38
+ === ActiveRecord API
39
+
40
+ # see http://api.rubyonrails.org/classes/ActiveRecord/Base.html
41
+
42
+ emp = Emp.find(:first,
43
+ :conditions => ["job = ? and sal >= ?", "MANAGER", 2800],
44
+ :limit => 3, :offset => 1)
45
+
46
+ p emp.id #=> "a198f990-719d-11df-974a-37650c93e624"
47
+ emp.age = 30
48
+ emp.save
49
+
50
+ emp_list = Emp.find(:all, :conditions => {:empno => [7654, 7698, 7782]})
51
+
52
+ emp_list.each do |i|
53
+ i.destroy if i.sal < 2000
54
+ end
55
+
56
+ new_emp = Emp.new
57
+ new_emp.empno = 8000
58
+ new_emp.ename = 'YAMADA'
59
+ new_emp.age = 27
60
+ new_emp.save!
61
+
62
+ # not available: JOIN, ORDER, OR and etc...
63
+ # see http://github.com/winebarrel/activerecord-cassandra-adapter/blob/master/lib/active_cassandra/sqlparser.y
64
+
65
+ === Low layer API
66
+
67
+ Emp.cassandra_client do |client|
68
+ ...
69
+ end
@@ -0,0 +1,88 @@
1
+ module ActiveCassandra
2
+ module CF
3
+ def self.included(mod)
4
+ mod.instance_eval %{
5
+ primary_key = ActiveRecord::ConnectionAdapters::Column.new('id', nil)
6
+ primary_key.primary = true
7
+ @columns = [primary_key]
8
+
9
+ class_eval(<<-EOS)
10
+ @@__timestamp = false
11
+
12
+ alias :__respond_to? :respond_to?
13
+
14
+ def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys)
15
+ quoted = {}
16
+ connection = self.class.connection
17
+
18
+ __attributes = (attributes || {}).merge(@__attributes || {})
19
+ __attributes.delete('id')
20
+
21
+ if @@__timestamp == :on
22
+ %w(created_at updated_at).each {|i| __attributes.delete(i) }
23
+ elsif @@__timestamp
24
+ %w(created_on updated_on).each {|i| __attributes.delete(i) }
25
+ else
26
+ %w(created_on updated_on created_at updated_at).each do |i|
27
+ __attributes.delete(i)
28
+ end
29
+ end
30
+
31
+ __attributes.each do |name, value|
32
+ quoted[name] = connection.quote(value)
33
+ end
34
+
35
+ quoted
36
+ end
37
+
38
+ def respond_to?(name, priv = false); true; end
39
+
40
+ def method_missing(name, *args, &block)
41
+ @__attributes ||= {}
42
+ name = name.to_s
43
+
44
+ if __respond_to?(name)
45
+ super
46
+ elsif name =~ /\\\\A(.+)=\\\\Z/ and args.length == 1
47
+ @__attributes[$1] = args[0]
48
+ elsif name =~ /[^=]\\\\Z/ and args.length == 0
49
+ @__attributes[$1]
50
+ else
51
+ raise NoMethodError, "undefined method `\\\#{name}' for \#{name}"
52
+ super
53
+ end
54
+ end
55
+ EOS
56
+
57
+ def timestamp(value = true)
58
+ class_eval(<<-EOS)
59
+ @@__timestamp = \#{value}
60
+ EOS
61
+ end
62
+
63
+ def identifier(value)
64
+ unless value.kind_of?(Proc) and value.arity <= 0
65
+ raise ArgumentError, "Incorrect identifier: \#{value}"
66
+ end
67
+
68
+ @__identifier = value
69
+ end
70
+
71
+ def __identify
72
+ if @__identifier
73
+ @__identifier.call
74
+ else
75
+ SimpleUUID::UUID.new.to_guid
76
+ end
77
+ end
78
+ }
79
+
80
+ mod.instance_eval %{
81
+ def cassandra_client
82
+ client = self.connection.raw_connection
83
+ block_given? ? yield(client) : client
84
+ end
85
+ }
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,790 @@
1
+ #
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by Racc 1.4.6
4
+ # from Racc grammer file "".
5
+ #
6
+
7
+ require 'racc/parser.rb'
8
+
9
+
10
+ require 'strscan'
11
+
12
+ module ActiveCassandra
13
+
14
+ class SQLParser < Racc::Parser
15
+
16
+ module_eval(<<'...end sqlparser.y/module_eval...', 'sqlparser.y', 225)
17
+
18
+ KEYWORDS = %w(
19
+ AND
20
+ AS
21
+ ASC
22
+ BETWEEN
23
+ BY
24
+ COUNT
25
+ DELETE
26
+ DESC
27
+ DISTINCT
28
+ FROM
29
+ IN
30
+ INSERT
31
+ INTO
32
+ LIMIT
33
+ NOT
34
+ OFFSET
35
+ ORDER
36
+ REGEXP
37
+ SELECT
38
+ SET
39
+ UPDATE
40
+ VALUES
41
+ WHERE
42
+ )
43
+
44
+ KEYWORD_REGEXP = Regexp.compile("(?:#{KEYWORDS.join '|'})\\b", Regexp::IGNORECASE)
45
+
46
+ def initialize(obj)
47
+ src = obj.is_a?(IO) ? obj.read : obj.to_s
48
+ @ss = StringScanner.new(src)
49
+ end
50
+
51
+ def scan
52
+ piece = nil
53
+
54
+ until @ss.eos?
55
+ if (tok = @ss.scan /\s+/)
56
+ # nothing to do
57
+ elsif (tok = @ss.scan /(?:<>|!=|>=|<=|>|<|=)/)
58
+ yield tok, tok
59
+ elsif (tok = @ss.scan KEYWORD_REGEXP)
60
+ yield tok.upcase.to_sym, tok
61
+ elsif (tok = @ss.scan /NULL\b/i)
62
+ yield :NULL, nil
63
+ elsif (tok = @ss.scan /'(?:[^']|'')*'/) #'
64
+ yield :STRING, tok.slice(1...-1).gsub(/''/, "'")
65
+ elsif (tok = @ss.scan /-?(?:0|[1-9]\d*)(?:\.\d+)/)
66
+ yield :NUMBER, tok.to_f
67
+ elsif (tok = @ss.scan /-?(?:0|[1-9]\d*)/)
68
+ yield :NUMBER, tok.to_i
69
+ elsif (tok = @ss.scan /[,\(\)\*]/)
70
+ yield tok, tok
71
+ elsif (tok = @ss.scan /(?:[a-z_]\w+\.|[a-z]\.)*ID\b/i)
72
+ yield :ID, tok
73
+ elsif (tok = @ss.scan /(?:[a-z_]\w+\.|[a-z]\.)*(?:[a-z_]\w+|[a-z])/i)
74
+ yield :IDENTIFIER, tok
75
+ else
76
+ raise Racc::ParseError, ('parse error on value "%s"' % @ss.rest.inspect)
77
+ end
78
+ end
79
+
80
+ yield false, '$'
81
+ end
82
+ private :scan
83
+
84
+ def parse
85
+ yyparse self, :scan
86
+ end
87
+
88
+ ...end sqlparser.y/module_eval...
89
+ ##### State transition tables begin ###
90
+
91
+ racc_action_table = [
92
+ 3, 115, 101, 96, 21, 7, 117, 118, 126, 134,
93
+ 135, 85, 85, 128, 83, 12, 136, 137, 63, 85,
94
+ 65, 66, 65, 66, 5, 55, 55, 6, 68, 50,
95
+ 68, 127, 52, 55, 73, 76, 127, 12, 12, 127,
96
+ 127, 26, 50, 139, 29, 12, 55, 19, 20, 41,
97
+ 15, 80, 69, 70, 71, 72, 74, 75, 12, 73,
98
+ 76, 83, 77, 78, 65, 66, 127, 12, 12, 35,
99
+ 81, 82, 68, 130, 131, 27, 80, 69, 70, 71,
100
+ 72, 74, 75, 12, 45, 65, 66, 65, 66, 65,
101
+ 66, 65, 66, 68, 89, 68, 89, 68, 35, 68,
102
+ 65, 66, 65, 66, 65, 66, 65, 66, 68, 92,
103
+ 68, 93, 68, 94, 68, 65, 66, 62, 26, 12,
104
+ 99, 25, 35, 68, 12, 102, 23, 104, 106, 104,
105
+ 12, 109, 110, 12, 35, 30, 12, 47, 119, 12,
106
+ 119, 12, 31, 40, 12, 13, 12, 12, 35, 12,
107
+ 10, 12, 111 ]
108
+
109
+ racc_action_check = [
110
+ 0, 103, 84, 79, 8, 0, 104, 104, 113, 121,
111
+ 121, 83, 85, 114, 84, 19, 123, 124, 44, 52,
112
+ 103, 103, 79, 79, 0, 83, 85, 0, 103, 52,
113
+ 79, 113, 35, 52, 87, 87, 114, 83, 85, 123,
114
+ 124, 44, 35, 129, 20, 52, 35, 7, 7, 29,
115
+ 7, 87, 87, 87, 87, 87, 87, 87, 35, 49,
116
+ 49, 51, 49, 49, 109, 109, 129, 29, 7, 32,
117
+ 50, 50, 109, 119, 119, 18, 49, 49, 49, 49,
118
+ 49, 49, 49, 55, 32, 78, 78, 111, 111, 110,
119
+ 110, 115, 115, 78, 59, 111, 60, 110, 61, 115,
120
+ 127, 127, 81, 81, 99, 99, 96, 96, 127, 62,
121
+ 81, 63, 99, 77, 96, 47, 47, 42, 17, 40,
122
+ 82, 14, 39, 47, 13, 86, 11, 88, 89, 90,
123
+ 92, 93, 94, 10, 37, 21, 45, 33, 105, 106,
124
+ 107, 31, 22, 28, 27, 6, 26, 25, 24, 5,
125
+ 3, 23, 95 ]
126
+
127
+ racc_action_pointer = [
128
+ -2, nil, nil, 147, nil, 119, 137, 38, 4, nil,
129
+ 103, 99, nil, 94, 113, nil, nil, 90, 67, -15,
130
+ 40, 135, 138, 121, 135, 117, 116, 114, 135, 37,
131
+ nil, 111, 56, 122, nil, 28, nil, 121, nil, 109,
132
+ 89, nil, 112, nil, 13, 106, nil, 92, nil, 44,
133
+ 55, 44, 15, nil, nil, 53, nil, nil, nil, 74,
134
+ 76, 85, 98, 105, nil, nil, nil, nil, nil, nil,
135
+ nil, nil, nil, nil, nil, nil, nil, 97, 62, -1,
136
+ nil, 79, 116, 7, -3, 8, 120, 19, 105, 107,
137
+ 107, nil, 100, 127, 128, 135, 83, nil, nil, 81,
138
+ nil, nil, nil, -3, -17, 113, 109, 115, nil, 41,
139
+ 66, 64, nil, 3, 8, 68, nil, nil, nil, 50,
140
+ nil, -30, nil, 11, 12, nil, nil, 77, nil, 38,
141
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ]
142
+
143
+ racc_action_default = [
144
+ -68, -2, -3, -68, -4, -68, -68, -68, -68, -1,
145
+ -68, -68, -49, -68, -68, -13, -50, -14, -68, -68,
146
+ -68, -68, -68, -68, -15, -68, -68, -68, -68, -68,
147
+ 140, -68, -15, -68, -45, -68, -48, -15, -51, -15,
148
+ -68, -11, -68, -12, -68, -68, -44, -68, -16, -68,
149
+ -68, -17, -68, -18, -22, -68, -24, -30, -31, -34,
150
+ -34, -15, -9, -68, -46, -53, -52, -47, -54, -59,
151
+ -60, -61, -62, -65, -63, -64, -57, -68, -68, -68,
152
+ -58, -68, -68, -68, -68, -68, -68, -68, -38, -68,
153
+ -38, -7, -68, -68, -68, -68, -68, -26, -20, -68,
154
+ -23, -25, -19, -68, -68, -41, -68, -41, -10, -68,
155
+ -68, -68, -55, -68, -68, -68, -27, -39, -40, -68,
156
+ -8, -36, -6, -68, -68, -32, -28, -68, -21, -68,
157
+ -42, -43, -35, -37, -66, -67, -5, -33, -56, -29 ]
158
+
159
+ racc_goto_table = [
160
+ 11, 79, 16, 17, 105, 22, 107, 34, 24, 120,
161
+ 67, 122, 88, 90, 28, 36, 53, 2, 33, 4,
162
+ 37, 38, 39, 46, 43, 14, 16, 44, 59, 64,
163
+ 60, 42, 48, 86, 113, 61, 51, 114, 18, 103,
164
+ 33, 95, 97, 1, 98, 100, 9, 123, 124, 132,
165
+ 87, 133, 91, 129, 32, 8, nil, nil, nil, nil,
166
+ nil, nil, nil, nil, nil, nil, 116, nil, nil, nil,
167
+ nil, nil, nil, nil, 125, nil, nil, nil, nil, nil,
168
+ nil, nil, nil, nil, nil, nil, nil, 108, nil, nil,
169
+ 138, nil, nil, nil, nil, nil, nil, nil, nil, nil,
170
+ nil, 121 ]
171
+
172
+ racc_goto_check = [
173
+ 6, 22, 6, 7, 12, 6, 12, 28, 6, 13,
174
+ 19, 13, 11, 11, 6, 10, 18, 4, 6, 5,
175
+ 6, 6, 6, 10, 6, 14, 6, 7, 10, 28,
176
+ 10, 15, 16, 18, 8, 6, 17, 8, 9, 22,
177
+ 6, 19, 19, 3, 19, 20, 2, 8, 8, 25,
178
+ 6, 26, 10, 8, 27, 1, nil, nil, nil, nil,
179
+ nil, nil, nil, nil, nil, nil, 19, nil, nil, nil,
180
+ nil, nil, nil, nil, 19, nil, nil, nil, nil, nil,
181
+ nil, nil, nil, nil, nil, nil, nil, 6, nil, nil,
182
+ 19, nil, nil, nil, nil, nil, nil, nil, nil, nil,
183
+ nil, 6 ]
184
+
185
+ racc_goto_pointer = [
186
+ nil, 55, 46, 43, 17, 19, -5, -4, -62, 31,
187
+ -9, -47, -84, -96, 18, 2, -3, 1, -19, -37,
188
+ -38, nil, -48, nil, nil, -72, -70, 31, -16 ]
189
+
190
+ racc_goto_default = [
191
+ nil, nil, nil, nil, nil, nil, 49, nil, nil, nil,
192
+ nil, nil, nil, nil, nil, nil, nil, 84, nil, 112,
193
+ 54, 56, nil, 57, 58, nil, nil, nil, nil ]
194
+
195
+ racc_reduce_table = [
196
+ 0, 0, :racc_error,
197
+ 1, 42, :_reduce_none,
198
+ 1, 42, :_reduce_none,
199
+ 1, 42, :_reduce_none,
200
+ 1, 42, :_reduce_none,
201
+ 10, 43, :_reduce_5,
202
+ 8, 44, :_reduce_6,
203
+ 6, 44, :_reduce_7,
204
+ 8, 44, :_reduce_8,
205
+ 4, 55, :_reduce_9,
206
+ 6, 55, :_reduce_10,
207
+ 1, 56, :_reduce_none,
208
+ 1, 56, :_reduce_none,
209
+ 1, 50, :_reduce_13,
210
+ 1, 50, :_reduce_none,
211
+ 0, 51, :_reduce_15,
212
+ 2, 51, :_reduce_16,
213
+ 2, 51, :_reduce_17,
214
+ 1, 57, :_reduce_none,
215
+ 3, 57, :_reduce_19,
216
+ 3, 59, :_reduce_20,
217
+ 5, 59, :_reduce_21,
218
+ 1, 58, :_reduce_22,
219
+ 3, 58, :_reduce_23,
220
+ 1, 61, :_reduce_none,
221
+ 3, 61, :_reduce_25,
222
+ 3, 62, :_reduce_26,
223
+ 4, 62, :_reduce_27,
224
+ 5, 62, :_reduce_28,
225
+ 6, 62, :_reduce_29,
226
+ 1, 62, :_reduce_none,
227
+ 1, 62, :_reduce_none,
228
+ 5, 64, :_reduce_32,
229
+ 6, 65, :_reduce_33,
230
+ 0, 52, :_reduce_34,
231
+ 4, 52, :_reduce_35,
232
+ 0, 66, :_reduce_36,
233
+ 1, 66, :_reduce_none,
234
+ 0, 53, :_reduce_38,
235
+ 2, 53, :_reduce_39,
236
+ 2, 53, :_reduce_40,
237
+ 0, 54, :_reduce_41,
238
+ 2, 54, :_reduce_42,
239
+ 2, 54, :_reduce_43,
240
+ 5, 45, :_reduce_44,
241
+ 1, 68, :_reduce_none,
242
+ 3, 68, :_reduce_46,
243
+ 3, 69, :_reduce_47,
244
+ 4, 46, :_reduce_48,
245
+ 1, 47, :_reduce_none,
246
+ 1, 48, :_reduce_50,
247
+ 3, 48, :_reduce_51,
248
+ 1, 60, :_reduce_none,
249
+ 1, 60, :_reduce_none,
250
+ 1, 60, :_reduce_none,
251
+ 1, 49, :_reduce_55,
252
+ 3, 49, :_reduce_56,
253
+ 1, 63, :_reduce_57,
254
+ 1, 63, :_reduce_58,
255
+ 1, 63, :_reduce_59,
256
+ 1, 63, :_reduce_60,
257
+ 1, 63, :_reduce_61,
258
+ 1, 63, :_reduce_62,
259
+ 1, 63, :_reduce_63,
260
+ 1, 63, :_reduce_64,
261
+ 1, 63, :_reduce_65,
262
+ 1, 67, :_reduce_66,
263
+ 1, 67, :_reduce_67 ]
264
+
265
+ racc_reduce_n = 68
266
+
267
+ racc_shift_n = 140
268
+
269
+ racc_token_table = {
270
+ false => 0,
271
+ :error => 1,
272
+ :INSERT => 2,
273
+ :INTO => 3,
274
+ "(" => 4,
275
+ ")" => 5,
276
+ :VALUES => 6,
277
+ :SELECT => 7,
278
+ :FROM => 8,
279
+ :DISTINCT => 9,
280
+ :COUNT => 10,
281
+ :AS => 11,
282
+ "*" => 12,
283
+ :WHERE => 13,
284
+ :ID => 14,
285
+ "=" => 15,
286
+ :IN => 16,
287
+ :AND => 17,
288
+ :NOT => 18,
289
+ :BETWEEN => 19,
290
+ :ORDER => 20,
291
+ :BY => 21,
292
+ :LIMIT => 22,
293
+ :NUMBER => 23,
294
+ :STRING => 24,
295
+ :OFFSET => 25,
296
+ :UPDATE => 26,
297
+ :SET => 27,
298
+ "," => 28,
299
+ :DELETE => 29,
300
+ :IDENTIFIER => 30,
301
+ :NULL => 31,
302
+ :REGEXP => 32,
303
+ "<>" => 33,
304
+ "!=" => 34,
305
+ ">=" => 35,
306
+ "<=" => 36,
307
+ ">" => 37,
308
+ "<" => 38,
309
+ :ASC => 39,
310
+ :DESC => 40 }
311
+
312
+ racc_nt_base = 41
313
+
314
+ racc_use_result_var = false
315
+
316
+ Racc_arg = [
317
+ racc_action_table,
318
+ racc_action_check,
319
+ racc_action_default,
320
+ racc_action_pointer,
321
+ racc_goto_table,
322
+ racc_goto_check,
323
+ racc_goto_default,
324
+ racc_goto_pointer,
325
+ racc_nt_base,
326
+ racc_reduce_table,
327
+ racc_token_table,
328
+ racc_shift_n,
329
+ racc_reduce_n,
330
+ racc_use_result_var ]
331
+
332
+ Racc_token_to_s_table = [
333
+ "$end",
334
+ "error",
335
+ "INSERT",
336
+ "INTO",
337
+ "\"(\"",
338
+ "\")\"",
339
+ "VALUES",
340
+ "SELECT",
341
+ "FROM",
342
+ "DISTINCT",
343
+ "COUNT",
344
+ "AS",
345
+ "\"*\"",
346
+ "WHERE",
347
+ "ID",
348
+ "\"=\"",
349
+ "IN",
350
+ "AND",
351
+ "NOT",
352
+ "BETWEEN",
353
+ "ORDER",
354
+ "BY",
355
+ "LIMIT",
356
+ "NUMBER",
357
+ "STRING",
358
+ "OFFSET",
359
+ "UPDATE",
360
+ "SET",
361
+ "\",\"",
362
+ "DELETE",
363
+ "IDENTIFIER",
364
+ "NULL",
365
+ "REGEXP",
366
+ "\"<>\"",
367
+ "\"!=\"",
368
+ "\">=\"",
369
+ "\"<=\"",
370
+ "\">\"",
371
+ "\"<\"",
372
+ "ASC",
373
+ "DESC",
374
+ "$start",
375
+ "sql",
376
+ "create_statement",
377
+ "read_statemant",
378
+ "update_statemant",
379
+ "delete_statemant",
380
+ "id",
381
+ "id_list",
382
+ "value_list",
383
+ "select_list",
384
+ "where_clause",
385
+ "order_by_clause",
386
+ "limit_clause",
387
+ "offset_clause",
388
+ "count_clause",
389
+ "count_arg",
390
+ "id_search_condition",
391
+ "search_condition",
392
+ "id_predicate",
393
+ "value",
394
+ "boolean_primary",
395
+ "predicate",
396
+ "op",
397
+ "between_predicate",
398
+ "not_in_predicate",
399
+ "ordering_spec",
400
+ "order_spec",
401
+ "set_clause_list",
402
+ "set_clause" ]
403
+
404
+ Racc_debug_parser = false
405
+
406
+ ##### State transition tables end #####
407
+
408
+ # reduce 0 omitted
409
+
410
+ # reduce 1 omitted
411
+
412
+ # reduce 2 omitted
413
+
414
+ # reduce 3 omitted
415
+
416
+ # reduce 4 omitted
417
+
418
+ module_eval(<<'.,.,', 'sqlparser.y', 10)
419
+ def _reduce_5(val, _values)
420
+ {:command => :insert, :table => val[2], :column_list => val[4], :value_list => val[8]}
421
+
422
+ end
423
+ .,.,
424
+
425
+ module_eval(<<'.,.,', 'sqlparser.y', 15)
426
+ def _reduce_6(val, _values)
427
+ {:command => :select, :table => val[3], :select_list => val[1], :condition => val[4], :order => val[5], :limit => val[6], :offset => val[7]}
428
+
429
+ end
430
+ .,.,
431
+
432
+ module_eval(<<'.,.,', 'sqlparser.y', 19)
433
+ def _reduce_7(val, _values)
434
+ {:command => :select, :table => val[4], :select_list => val[2], :distinct => val[2], :condition => val[5]}
435
+
436
+ end
437
+ .,.,
438
+
439
+ module_eval(<<'.,.,', 'sqlparser.y', 23)
440
+ def _reduce_8(val, _values)
441
+ {:command => :select, :table => val[3], :count => val[1], :condition => val[4], :order => val[5], :limit => val[6], :offset => val[7]}
442
+
443
+ end
444
+ .,.,
445
+
446
+ module_eval(<<'.,.,', 'sqlparser.y', 28)
447
+ def _reduce_9(val, _values)
448
+ "count_all"
449
+
450
+ end
451
+ .,.,
452
+
453
+ module_eval(<<'.,.,', 'sqlparser.y', 32)
454
+ def _reduce_10(val, _values)
455
+ val[5]
456
+
457
+ end
458
+ .,.,
459
+
460
+ # reduce 11 omitted
461
+
462
+ # reduce 12 omitted
463
+
464
+ module_eval(<<'.,.,', 'sqlparser.y', 40)
465
+ def _reduce_13(val, _values)
466
+ []
467
+
468
+ end
469
+ .,.,
470
+
471
+ # reduce 14 omitted
472
+
473
+ module_eval(<<'.,.,', 'sqlparser.y', 46)
474
+ def _reduce_15(val, _values)
475
+ []
476
+
477
+ end
478
+ .,.,
479
+
480
+ module_eval(<<'.,.,', 'sqlparser.y', 50)
481
+ def _reduce_16(val, _values)
482
+ val[1]
483
+
484
+ end
485
+ .,.,
486
+
487
+ module_eval(<<'.,.,', 'sqlparser.y', 54)
488
+ def _reduce_17(val, _values)
489
+ val[1]
490
+
491
+ end
492
+ .,.,
493
+
494
+ # reduce 18 omitted
495
+
496
+ module_eval(<<'.,.,', 'sqlparser.y', 60)
497
+ def _reduce_19(val, _values)
498
+ val[1]
499
+
500
+ end
501
+ .,.,
502
+
503
+ module_eval(<<'.,.,', 'sqlparser.y', 65)
504
+ def _reduce_20(val, _values)
505
+ val[2]
506
+
507
+ end
508
+ .,.,
509
+
510
+ module_eval(<<'.,.,', 'sqlparser.y', 69)
511
+ def _reduce_21(val, _values)
512
+ val[3]
513
+
514
+ end
515
+ .,.,
516
+
517
+ module_eval(<<'.,.,', 'sqlparser.y', 74)
518
+ def _reduce_22(val, _values)
519
+ [val[0]].flatten
520
+
521
+ end
522
+ .,.,
523
+
524
+ module_eval(<<'.,.,', 'sqlparser.y', 78)
525
+ def _reduce_23(val, _values)
526
+ (val[0] << val[2]).flatten
527
+
528
+ end
529
+ .,.,
530
+
531
+ # reduce 24 omitted
532
+
533
+ module_eval(<<'.,.,', 'sqlparser.y', 84)
534
+ def _reduce_25(val, _values)
535
+ val[1]
536
+
537
+ end
538
+ .,.,
539
+
540
+ module_eval(<<'.,.,', 'sqlparser.y', 89)
541
+ def _reduce_26(val, _values)
542
+ {:name => val[0], :op => val[1], :expr => val[2]}
543
+
544
+ end
545
+ .,.,
546
+
547
+ module_eval(<<'.,.,', 'sqlparser.y', 93)
548
+ def _reduce_27(val, _values)
549
+ {:name => val[1], :op => val[2], :expr => val[3], :not => true}
550
+
551
+ end
552
+ .,.,
553
+
554
+ module_eval(<<'.,.,', 'sqlparser.y', 97)
555
+ def _reduce_28(val, _values)
556
+ {:name => val[0], :op => val[1], :expr => val[3]}
557
+
558
+ end
559
+ .,.,
560
+
561
+ module_eval(<<'.,.,', 'sqlparser.y', 101)
562
+ def _reduce_29(val, _values)
563
+ {:name => val[1], :op => val[2], :expr => val[4], :not => true}
564
+
565
+ end
566
+ .,.,
567
+
568
+ # reduce 30 omitted
569
+
570
+ # reduce 31 omitted
571
+
572
+ module_eval(<<'.,.,', 'sqlparser.y', 108)
573
+ def _reduce_32(val, _values)
574
+ {:name => val[0], :op => '$bt', :expr => [val[2], val[4]]}
575
+
576
+ end
577
+ .,.,
578
+
579
+ module_eval(<<'.,.,', 'sqlparser.y', 113)
580
+ def _reduce_33(val, _values)
581
+ {:name => val[0], :op => '$in', :expr => val[4], :not => true}
582
+
583
+ end
584
+ .,.,
585
+
586
+ module_eval(<<'.,.,', 'sqlparser.y', 118)
587
+ def _reduce_34(val, _values)
588
+ nil
589
+
590
+ end
591
+ .,.,
592
+
593
+ module_eval(<<'.,.,', 'sqlparser.y', 122)
594
+ def _reduce_35(val, _values)
595
+ {:name => val[2], :type => val[3]}
596
+
597
+ end
598
+ .,.,
599
+
600
+ module_eval(<<'.,.,', 'sqlparser.y', 127)
601
+ def _reduce_36(val, _values)
602
+ :asc
603
+
604
+ end
605
+ .,.,
606
+
607
+ # reduce 37 omitted
608
+
609
+ module_eval(<<'.,.,', 'sqlparser.y', 133)
610
+ def _reduce_38(val, _values)
611
+ nil
612
+
613
+ end
614
+ .,.,
615
+
616
+ module_eval(<<'.,.,', 'sqlparser.y', 137)
617
+ def _reduce_39(val, _values)
618
+ val[1].to_i
619
+
620
+ end
621
+ .,.,
622
+
623
+ module_eval(<<'.,.,', 'sqlparser.y', 141)
624
+ def _reduce_40(val, _values)
625
+ val[1]
626
+
627
+ end
628
+ .,.,
629
+
630
+ module_eval(<<'.,.,', 'sqlparser.y', 146)
631
+ def _reduce_41(val, _values)
632
+ nil
633
+
634
+ end
635
+ .,.,
636
+
637
+ module_eval(<<'.,.,', 'sqlparser.y', 150)
638
+ def _reduce_42(val, _values)
639
+ val[1].to_i
640
+
641
+ end
642
+ .,.,
643
+
644
+ module_eval(<<'.,.,', 'sqlparser.y', 154)
645
+ def _reduce_43(val, _values)
646
+ val[1]
647
+
648
+ end
649
+ .,.,
650
+
651
+ module_eval(<<'.,.,', 'sqlparser.y', 159)
652
+ def _reduce_44(val, _values)
653
+ {:command => :update, :table => val[1], :set_clause_list => val[3], :condition => val[4]}
654
+
655
+ end
656
+ .,.,
657
+
658
+ # reduce 45 omitted
659
+
660
+ module_eval(<<'.,.,', 'sqlparser.y', 165)
661
+ def _reduce_46(val, _values)
662
+ val[0].merge val[2]
663
+
664
+ end
665
+ .,.,
666
+
667
+ module_eval(<<'.,.,', 'sqlparser.y', 170)
668
+ def _reduce_47(val, _values)
669
+ {val[0] => val[2]}
670
+
671
+ end
672
+ .,.,
673
+
674
+ module_eval(<<'.,.,', 'sqlparser.y', 175)
675
+ def _reduce_48(val, _values)
676
+ {:command => :delete, :table => val[2], :condition => val[3]}
677
+
678
+ end
679
+ .,.,
680
+
681
+ # reduce 49 omitted
682
+
683
+ module_eval(<<'.,.,', 'sqlparser.y', 182)
684
+ def _reduce_50(val, _values)
685
+ [val[0]]
686
+
687
+ end
688
+ .,.,
689
+
690
+ module_eval(<<'.,.,', 'sqlparser.y', 186)
691
+ def _reduce_51(val, _values)
692
+ val[0] << val[2]
693
+
694
+ end
695
+ .,.,
696
+
697
+ # reduce 52 omitted
698
+
699
+ # reduce 53 omitted
700
+
701
+ # reduce 54 omitted
702
+
703
+ module_eval(<<'.,.,', 'sqlparser.y', 195)
704
+ def _reduce_55(val, _values)
705
+ [val[0]]
706
+
707
+ end
708
+ .,.,
709
+
710
+ module_eval(<<'.,.,', 'sqlparser.y', 199)
711
+ def _reduce_56(val, _values)
712
+ val[0] << val[2]
713
+
714
+ end
715
+ .,.,
716
+
717
+ module_eval(<<'.,.,', 'sqlparser.y', 202)
718
+ def _reduce_57(val, _values)
719
+ '$in'
720
+ end
721
+ .,.,
722
+
723
+ module_eval(<<'.,.,', 'sqlparser.y', 203)
724
+ def _reduce_58(val, _values)
725
+ '$regexp'
726
+ end
727
+ .,.,
728
+
729
+ module_eval(<<'.,.,', 'sqlparser.y', 204)
730
+ def _reduce_59(val, _values)
731
+ :'!='
732
+ end
733
+ .,.,
734
+
735
+ module_eval(<<'.,.,', 'sqlparser.y', 205)
736
+ def _reduce_60(val, _values)
737
+ :'!='
738
+ end
739
+ .,.,
740
+
741
+ module_eval(<<'.,.,', 'sqlparser.y', 206)
742
+ def _reduce_61(val, _values)
743
+ :'>='
744
+ end
745
+ .,.,
746
+
747
+ module_eval(<<'.,.,', 'sqlparser.y', 207)
748
+ def _reduce_62(val, _values)
749
+ :'<='
750
+ end
751
+ .,.,
752
+
753
+ module_eval(<<'.,.,', 'sqlparser.y', 208)
754
+ def _reduce_63(val, _values)
755
+ :'>'
756
+ end
757
+ .,.,
758
+
759
+ module_eval(<<'.,.,', 'sqlparser.y', 209)
760
+ def _reduce_64(val, _values)
761
+ :'<'
762
+ end
763
+ .,.,
764
+
765
+ module_eval(<<'.,.,', 'sqlparser.y', 210)
766
+ def _reduce_65(val, _values)
767
+ :'=='
768
+ end
769
+ .,.,
770
+
771
+ module_eval(<<'.,.,', 'sqlparser.y', 212)
772
+ def _reduce_66(val, _values)
773
+ :asc
774
+ end
775
+ .,.,
776
+
777
+ module_eval(<<'.,.,', 'sqlparser.y', 213)
778
+ def _reduce_67(val, _values)
779
+ :desc
780
+ end
781
+ .,.,
782
+
783
+ def _reduce_none(val, _values)
784
+ val[0]
785
+ end
786
+
787
+ end # class SQLParser
788
+
789
+
790
+ end # module ActiveCassandra