Class: Gandiva::ExpressionBuilder::BinaryOperation

Inherits:
Value
  • Object
show all
Defined in:
lib/gandiva/expression-builder/binary-operation.rb

Direct Known Subclasses

Add, Divide, Equal, GreaterThan, LessThan, Multiply, Subtract

Instance Method Summary collapse

Methods inherited from Value

#*, #+, #-, #/, #<, #==, #>

Constructor Details

#initialize(operator, left, right) ⇒ BinaryOperation

Returns a new instance of BinaryOperation.



23
24
25
26
27
# File 'lib/gandiva/expression-builder/binary-operation.rb', line 23

def initialize(operator, left, right)
  @operator = operator
  @left = left
  @right = right
end

Instance Method Details

#buildObject



29
30
31
32
33
34
35
# File 'lib/gandiva/expression-builder/binary-operation.rb', line 29

def build
  left_node = @left.build
  right_node = @right.build
  FunctionNode.new(@operator,
                   [left_node, right_node],
                   return_type(left_node, right_node))
end