org.apache.storm.sql.compiler

## Class RexNodeToJavaCodeCompiler

- java.lang.Object
- - org.apache.storm.sql.compiler.RexNodeToJavaCodeCompiler

-     public class RexNodeToJavaCodeCompiler
      extends Object

  Compiles a scalar expression (`RexNode`) to Java source code String.

  This code is inspired by JaninoRexCompiler in Calcite, but while it is returning `Scalar` which is executable, we need to pass the source code to compile and serialize instance so that it can be executed on worker efficiently.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RexNodeToJavaCodeCompiler(org.apache.calcite.rex.RexBuilder rexBuilder)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `compile(List<org.apache.calcite.rex.RexNode> nodes, org.apache.calcite.rel.type.RelDataType inputRowType, String className)`
    `String` | `compile(org.apache.calcite.rex.RexProgram program, String className)`
    `org.apache.calcite.linq4j.tree.BlockStatement` | `compileToBlock(List<org.apache.calcite.rex.RexNode> nodes, org.apache.calcite.rel.type.RelDataType inputRowType)`
    `org.apache.calcite.linq4j.tree.BlockStatement` | `compileToBlock(org.apache.calcite.rex.RexProgram program)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RexNodeToJavaCodeCompiler

          public RexNodeToJavaCodeCompiler(org.apache.calcite.rex.RexBuilder rexBuilder)

  - ### Method Detail

    - #### compileToBlock

          public org.apache.calcite.linq4j.tree.BlockStatement compileToBlock(List<org.apache.calcite.rex.RexNode> nodes,
                                                                              org.apache.calcite.rel.type.RelDataType inputRowType)

    - #### compileToBlock

          public org.apache.calcite.linq4j.tree.BlockStatement compileToBlock(org.apache.calcite.rex.RexProgram program)

    - #### compile

          public String compile(List<org.apache.calcite.rex.RexNode> nodes,
                                org.apache.calcite.rel.type.RelDataType inputRowType,
                                String className)

    - #### compile

          public String compile(org.apache.calcite.rex.RexProgram program,
                                String className)

Copyright © 2019 The Apache Software Foundation. All rights reserved.