Class NestedBlockBuilderImpl
java.lang.Object
org.apache.calcite.adapter.enumerable.NestedBlockBuilderImpl
- All Implemented Interfaces:
NestedBlockBuilder
- Direct Known Subclasses:
AggResetContextImpl
Allows to build nested code blocks with tracking of current context.
-
Constructor Summary
ConstructorDescriptionConstructs nested block builders starting of a given code block. -
Method Summary
Modifier and TypeMethodDescriptionfinal BlockBuilder
Returns the current code block.final void
Leaves the current code block.final BlockBuilder
Starts nested code block.final void
nestBlock
(BlockBuilder block) Uses given block as the new code context.
-
Constructor Details
-
NestedBlockBuilderImpl
Constructs nested block builders starting of a given code block.- Parameters:
block
- root code block
-
-
Method Details
-
nestBlock
Starts nested code block. The resulting block can optimize expressions and reuse already calculated values from the parent blocks.- Specified by:
nestBlock
in interfaceNestedBlockBuilder
- Returns:
- new code block that can optimize expressions and reuse already calculated values from the parent blocks.
-
nestBlock
Uses given block as the new code context. The current block will be restored afterexitBlock()
call.- Specified by:
nestBlock
in interfaceNestedBlockBuilder
- Parameters:
block
- new code block- See Also:
-
currentBlock
Returns the current code block.- Specified by:
currentBlock
in interfaceNestedBlockBuilder
-
exitBlock
public final void exitBlock()Leaves the current code block.- Specified by:
exitBlock
in interfaceNestedBlockBuilder
- See Also:
-