Class: Gandiva::ExpressionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gandiva/expression-builder.rb,
lib/gandiva/expression-builder/if.rb,
lib/gandiva/expression-builder/add.rb,
lib/gandiva/expression-builder/elsif.rb,
lib/gandiva/expression-builder/equal.rb,
lib/gandiva/expression-builder/field.rb,
lib/gandiva/expression-builder/value.rb,
lib/gandiva/expression-builder/divide.rb,
lib/gandiva/expression-builder/record.rb,
lib/gandiva/expression-builder/context.rb,
lib/gandiva/expression-builder/literal.rb,
lib/gandiva/expression-builder/multiply.rb,
lib/gandiva/expression-builder/subtract.rb,
lib/gandiva/expression-builder/less-than.rb,
lib/gandiva/expression-builder/greater-than.rb,
lib/gandiva/expression-builder/binary-operation.rb

Defined Under Namespace

Classes: Add, BinaryOperation, Context, Divide, Elsif, Equal, Field, GreaterThan, If, LessThan, Literal, Multiply, Record, Subtract, Value

Instance Method Summary collapse

Constructor Details

#initialize(schema) ⇒ ExpressionBuilder

Returns a new instance of ExpressionBuilder.



20
21
22
# File 'lib/gandiva/expression-builder.rb', line 20

def initialize(schema)
  @schema = schema
end

Instance Method Details

#buildObject



24
25
26
27
28
29
# File 'lib/gandiva/expression-builder.rb', line 24

def build
  builder = yield(Record.new(@schema), Context.new)
  node = builder.build
  Expression.new(node,
                 Arrow::Field.new("result", node.return_type))
end