Class: Bud::BudCollExpr
- Inherits:
-
BudReadOnly
- Object
- BudCollection
- BudReadOnly
- Bud::BudCollExpr
- Defined in:
- lib/bud/collections.rb
Overview
:nodoc: all
Instance Attribute Summary
Attributes inherited from BudCollection
#accumulate_tick_deltas, #bud_instance, #cols, #delta, #invalidated, #is_source, #key_cols, #new_delta, #pending, #rescan, #scanner_cnt, #storage, #struct, #tabname, #tick_delta, #wired_by
Instance Method Summary (collapse)
- - (Object) each(&block)
- - (Object) each_raw(&block)
-
- (BudCollExpr) initialize(name, bud_instance, expr, given_schema = nil, defer_schema = false)
constructor
A new instance of BudCollExpr.
- - (Object) tick
Methods inherited from BudReadOnly
#invalidate_at_tick, #invalidate_cache, #merge
Methods inherited from BudCollection
#*, #<<, #<=, #[], #add_rescan_invalidate, #argagg, #argmax, #argmin, #bootstrap, #canonicalize_col, #close, #do_insert, #each_from_sym, #each_tick_delta, #each_with_index, #empty?, #exists?, #flat_map, #flush, #flush_deltas, #group, #has_key?, #include?, #init_schema, #insert, #inspect, #inspected, #invalidate_at_tick, #keys, #length, #merge, #non_temporal_predecessors, #notin, #null_tuple, #pending_merge, #positive_predecessors, #prep_aggpairs, #pro, #qualified_tabname, #reduce, #register_coll_expr, #rename, #schema, #sort, #tick_deltas, #tick_metrics, #to_push_elem, #uniquify_tabname, #val_cols, #values
Methods included from Enumerable
Constructor Details
- (BudCollExpr) initialize(name, bud_instance, expr, given_schema = nil, defer_schema = false)
A new instance of BudCollExpr
1361 1362 1363 1364 1365 |
# File 'lib/bud/collections.rb', line 1361 def initialize(name, bud_instance, expr, given_schema=nil, defer_schema=false) super(name, bud_instance, given_schema, defer_schema) @expr = expr @invalidated = true end |
Instance Method Details
- (Object) each(&block)
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 |
# File 'lib/bud/collections.rb', line 1372 def each(&block) v = @expr.call return if v.nil? or v == [nil] # XXX: Gross hack. We want to support RHS expressions that do not # necessarily return BudCollections (they might instead return lattice # values or hashes). Since it isn't easy to distinguish between these two # cases statically, instead we just always use CollExpr; at runtime, if # the value doesn't look like a traditional Bloom collection, we don't try # to break it up into tuples. if v.class <= Array || v.class <= BudCollection v.each(&block) else yield v end end |
- (Object) each_raw(&block)
1390 1391 1392 |
# File 'lib/bud/collections.rb', line 1390 def each_raw(&block) each(&block) end |
- (Object) tick
1367 1368 1369 |
# File 'lib/bud/collections.rb', line 1367 def tick @invalidated = true end |