Sha256: 8fc178d7619c80d16c76cbf5b2bc6d749c39200ea86e1cdaa763a3f9c8082c17

Contents?: true

Size: 847 Bytes

Versions: 5

Compression:

Stored size: 847 Bytes

Contents

module Alf
  module Sql
    class Processor
      module JoinSupport

        def on_main_exp(sexpr)
          joined = apply_join_strategy(sexpr.select_exp, right.select_exp)
          merge_with_exps(sexpr, right, joined)
        end
        alias :on_with_exp   :on_main_exp
        alias :on_select_exp :on_main_exp

      private

        def join_predicate(left, right, commons = left.to_attr_list & right.to_attr_list)
          commons = left.to_attr_list & right.to_attr_list
          left_d, right_d = left.desaliaser, right.desaliaser
          commons.to_a.inject(tautology){|cond, attr|
            left_attr, right_attr = left_d[attr], right_d[attr]
            cond &= Predicate::Factory.eq(left_attr, right_attr)
          }
        end

      end # class JoinSupport
    end # class Processor
  end # module Sql
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-sql-0.16.3 lib/alf/sql/processor/join_support.rb
alf-sql-0.16.2 lib/alf/sql/processor/join_support.rb
alf-sql-0.16.1 lib/alf/sql/processor/join_support.rb
alf-sql-0.16.0 lib/alf/sql/processor/join_support.rb
alf-sql-0.15.0 lib/alf/sql/processor/join_support.rb