Class: Bmg::Operator::Image
- Inherits:
-
Object
- Object
- Bmg::Operator::Image
- Includes:
- Binary
- Defined in:
- lib/bmg/operator/image.rb
Overview
Image operator.
Extends each tuple with its image in right.
Constant Summary collapse
- DEFAULT_OPTIONS =
{ # Whether we need to convert each image as an Array, # instead of keeping a Relation instance array: false, # The strategy to use for actual image algorithm. Default is # :refilter_right. Possible values are: # # - :index_right : builds a memory index with tuples from right, then # passes left tuples and joins them with the index values. # # - :refilter_right : the left operand is materialized and all # distinct values collected. The right operand is lately restricted # to only those matching values. :index_right is then applied on # resulting operabds. This option only applies when (optimized) `on` # contains one attribute only. ; it fallbacks on :index_right # otherwise. strategy: :refilter_right, # Whether the attributes on which the join is made should be kept # in the result or not preserve: false }
Instance Attribute Summary
Attributes included from Bmg::Operator
Instance Method Summary collapse
- #_count ⇒ Object
- #each(*args, &bl) ⇒ Object
-
#initialize(type, left, right, as, on, options = {}) ⇒ Image
constructor
A new instance of Image.
- #inspect ⇒ Object
- #to_ast ⇒ Object
- #to_s ⇒ Object
Methods included from Binary
Methods included from Relation
#bind, #count, #debug, #delete, empty, #empty?, #insert, new, #one, #one_or_nil, #to_csv, #to_json, #to_xlsx, #type, #update, #visit, #with_type, #with_type_attrlist, #with_typecheck, #without_typecheck, #y_by_x, #ys_by_x
Methods included from Algebra
#allbut, #autosummarize, #autowrap, #constants, #extend, #group, #image, #join, #left_join, #matching, #materialize, #minus, #not_matching, #page, #project, #rename, #restrict, #spied, #summarize, #transform, #ungroup, #union, #unspied, #unwrap
Methods included from Algebra::Shortcuts
#cross_product, #exclude, #image, #images, #join, #left_join, #matching, #not_matching, #prefix, #rxmatch, #suffix, #ungroup, #unwrap, #where
Constructor Details
#initialize(type, left, right, as, on, options = {}) ⇒ Image
Returns a new instance of Image.
37 38 39 40 41 42 43 44 |
# File 'lib/bmg/operator/image.rb', line 37 def initialize(type, left, right, as, on, = {}) @type = type @left = left @right = right @as = as @on = on @options = DEFAULT_OPTIONS.merge() end |
Instance Method Details
#_count ⇒ Object
166 167 168 |
# File 'lib/bmg/operator/image.rb', line 166 def _count left._count end |
#each(*args, &bl) ⇒ Object
52 53 54 55 |
# File 'lib/bmg/operator/image.rb', line 52 def each(*args, &bl) return to_enum unless block_given? ([:jit_optimized] ? self : jit_optimize)._each(*args, &bl) end |
#inspect ⇒ Object
282 283 284 |
# File 'lib/bmg/operator/image.rb', line 282 def inspect [:jit_optimized] ? super : jit_optimize.inspect end |
#to_ast ⇒ Object
57 58 59 |
# File 'lib/bmg/operator/image.rb', line 57 def to_ast [ :image, left.to_ast, right.to_ast, as, on, .dup ] end |
#to_s ⇒ Object
278 279 280 |
# File 'lib/bmg/operator/image.rb', line 278 def to_s [:jit_optimized] ? super : jit_optimize.to_s end |