Class: Veritas::Optimizer::Algebra::Summarization::EmptyOperand
- Inherits:
-
Veritas::Optimizer::Algebra::Summarization
- Object
- Veritas::Optimizer
- Relation::Operation::Unary
- Veritas::Optimizer::Algebra::Summarization
- Veritas::Optimizer::Algebra::Summarization::EmptyOperand
- Defined in:
- lib/veritas/optimizer/algebra/summarization.rb
Overview
Optimize when the operand is Empty
Constant Summary
Constants inherited from Veritas::Optimizer
Instance Attribute Summary
Attributes inherited from Veritas::Optimizer::Algebra::Summarization
Attributes inherited from Relation::Operation::Unary
Attributes included from Function::Unary
Attributes inherited from Veritas::Optimizer
Class Method Summary collapse
-
.extension_default(function) ⇒ Object
private
Return the default value for a function.
Instance Method Summary collapse
-
#optimizable? ⇒ Boolean
private
Test if the operand is empty.
-
#optimize ⇒ Extension
private
Return an extended relation with the same headers.
Methods inherited from Veritas::Optimizer::Algebra::Summarization
Methods inherited from Relation::Operation::Unary
Methods included from Function::Unary
Methods inherited from Veritas::Optimizer
Constructor Details
This class inherits a constructor from Veritas::Optimizer::Algebra::Summarization
Class Method Details
.extension_default(function) ⇒ Object
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 the default value for a function
78 79 80 81 82 |
# File 'lib/veritas/optimizer/algebra/summarization.rb', line 78 def self.extension_default(function) if function.respond_to?(:default) function.finalize(function.default) end end |
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
89 90 91 |
# File 'lib/veritas/optimizer/algebra/summarization.rb', line 89 def optimizable? operand.kind_of?(Veritas::Relation::Empty) end |
#optimize ⇒ Extension
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 an extended relation with the same headers
98 99 100 101 102 103 104 |
# File 'lib/veritas/optimizer/algebra/summarization.rb', line 98 def optimize summarize_per.extend do |context| extensions.each do |extension| context.add(*extension) end end end |