Class NestedBlockBuilderImpl

java.lang.Object
org.apache.calcite.adapter.enumerable.NestedBlockBuilderImpl
All Implemented Interfaces:
NestedBlockBuilder
Direct Known Subclasses:
AggResetContextImpl

public class NestedBlockBuilderImpl extends Object implements NestedBlockBuilder
Allows to build nested code blocks with tracking of current context.
See Also:
  • Constructor Details

    • NestedBlockBuilderImpl

      public NestedBlockBuilderImpl(BlockBuilder block)
      Constructs nested block builders starting of a given code block.
      Parameters:
      block - root code block
  • Method Details

    • nestBlock

      public final BlockBuilder nestBlock()
      Starts nested code block. The resulting block can optimize expressions and reuse already calculated values from the parent blocks.
      Specified by:
      nestBlock in interface NestedBlockBuilder
      Returns:
      new code block that can optimize expressions and reuse already calculated values from the parent blocks.
    • nestBlock

      public final void nestBlock(BlockBuilder block)
      Uses given block as the new code context. The current block will be restored after exitBlock() call.
      Specified by:
      nestBlock in interface NestedBlockBuilder
      Parameters:
      block - new code block
      See Also:
    • currentBlock

      public final BlockBuilder currentBlock()
      Returns the current code block.
      Specified by:
      currentBlock in interface NestedBlockBuilder
    • exitBlock

      public final void exitBlock()
      Leaves the current code block.
      Specified by:
      exitBlock in interface NestedBlockBuilder
      See Also: