Class JaninoCompiler
- java.lang.Object
-
- org.apache.flink.cdc.runtime.parser.JaninoCompiler
-
public class JaninoCompiler extends Object
Use Janino compiler to compiler the statement of flink cdc pipeline transform into the executable code of Janino. For example, compiler 'string1 || string2' into 'concat(string1, string2)'. The core logic is to traverse SqlNode tree and transform to Atom tree. Janino documents: https://www.janino.net/index.html#properties
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJaninoCompiler.ContextContextual information forJaninoCompiler.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_AI_MODEL_CLIENTSstatic StringDEFAULT_EPOCH_TIMEstatic StringDEFAULT_TIME_ZONEstatic StringLOAD_MODULES_EXPRESSION
-
Constructor Summary
Constructors Constructor Description JaninoCompiler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.codehaus.janino.ExpressionEvaluatorcompileExpression(String expression, List<String> argumentNames, List<Class<?>> argumentClasses, Class<?> returnClass)static StringloadSystemFunction(String expression)static StringtranslateSqlNodeToJaninoExpression(JaninoCompiler.Context context, org.apache.calcite.sql.SqlNode transform)static org.codehaus.janino.Java.RvaluetranslateSqlNodeToJaninoRvalue(JaninoCompiler.Context context, org.apache.calcite.sql.SqlNode transform)
-
-
-
Field Detail
-
DEFAULT_EPOCH_TIME
public static final String DEFAULT_EPOCH_TIME
- See Also:
- Constant Field Values
-
DEFAULT_TIME_ZONE
public static final String DEFAULT_TIME_ZONE
- See Also:
- Constant Field Values
-
DEFAULT_AI_MODEL_CLIENTS
public static final String DEFAULT_AI_MODEL_CLIENTS
- See Also:
- Constant Field Values
-
LOAD_MODULES_EXPRESSION
@VisibleForTesting public static final String LOAD_MODULES_EXPRESSION
-
-
Method Detail
-
compileExpression
public static org.codehaus.janino.ExpressionEvaluator compileExpression(String expression, List<String> argumentNames, List<Class<?>> argumentClasses, Class<?> returnClass)
-
translateSqlNodeToJaninoExpression
public static String translateSqlNodeToJaninoExpression(JaninoCompiler.Context context, org.apache.calcite.sql.SqlNode transform)
-
translateSqlNodeToJaninoRvalue
public static org.codehaus.janino.Java.Rvalue translateSqlNodeToJaninoRvalue(JaninoCompiler.Context context, org.apache.calcite.sql.SqlNode transform)
-
-