Class: Veritas::Optimizer::Relation::Materialized::EmptyOperand

Inherits:
Veritas::Optimizer::Relation::Materialized show all
Defined in:
lib/veritas/optimizer/relation/materialized.rb

Overview

Optimize when the operand is Empty

Constant Summary

Constants inherited from Veritas::Optimizer

Noop, VERSION

Instance Attribute Summary

Attributes inherited from Veritas::Optimizer

#operation

Instance Method Summary collapse

Methods inherited from Veritas::Optimizer

chain, #initialize

Constructor Details

This class inherits a constructor from Veritas::Optimizer

Instance Method Details

#optimizable?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if the operand is empty

Returns:

  • (Boolean)


18
19
20
# File 'lib/veritas/optimizer/relation/materialized.rb', line 18

def optimizable?
  operation.empty?
end

#optimizeEmpty

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return a new Empty relation with the operation’s headers

Returns:

  • (Empty)


27
28
29
30
# File 'lib/veritas/optimizer/relation/materialized.rb', line 27

def optimize
  operation = self.operation
  Veritas::Relation::Empty.new(operation.header, operation)
end