@Internal @Experimental public class BeamSqlEnv extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
executeDdl(java.lang.String sqlStatement) |
java.lang.String |
explain(java.lang.String sqlString) |
org.apache.calcite.jdbc.CalcitePrepare.Context |
getContext() |
java.util.Map<java.lang.String,java.lang.String> |
getPipelineOptions() |
static BeamSqlEnv |
inMemory(TableProvider... tableProviders) |
boolean |
isDdl(java.lang.String sqlStatement) |
void |
loadBeamBuiltinFunctions() |
void |
loadUdfUdafFromProvider()
Load all UDF/UDAF from
UdfUdafProvider . |
BeamRelNode |
parseQuery(java.lang.String query) |
static BeamSqlEnv |
readOnly(java.lang.String tableType,
java.util.Map<java.lang.String,BeamSqlTable> tables) |
void |
registerUdaf(java.lang.String functionName,
Combine.CombineFn combineFn)
Register a UDAF function which can be used in GROUP-BY expression.
|
void |
registerUdf(java.lang.String functionName,
java.lang.Class<?> clazz,
java.lang.String method)
Register a UDF function which can be used in SQL expression.
|
void |
registerUdf(java.lang.String functionName,
java.lang.Class<? extends BeamSqlUdf> clazz)
Register a UDF function which can be used in SQL expression.
|
void |
registerUdf(java.lang.String functionName,
SerializableFunction sfn)
Register
SerializableFunction as a UDF function which can be used in SQL expression. |
static BeamSqlEnv |
withTableProvider(TableProvider tableProvider) |
public static BeamSqlEnv readOnly(java.lang.String tableType, java.util.Map<java.lang.String,BeamSqlTable> tables)
public static BeamSqlEnv withTableProvider(TableProvider tableProvider)
public static BeamSqlEnv inMemory(TableProvider... tableProviders)
public void registerUdf(java.lang.String functionName, java.lang.Class<?> clazz, java.lang.String method)
public void registerUdf(java.lang.String functionName, java.lang.Class<? extends BeamSqlUdf> clazz)
public void registerUdf(java.lang.String functionName, SerializableFunction sfn)
SerializableFunction
as a UDF function which can be used in SQL expression.
Note, SerializableFunction
must have a constructor without arguments.public void registerUdaf(java.lang.String functionName, Combine.CombineFn combineFn)
Combine.CombineFn
on how to implement a UDAF.public void loadUdfUdafFromProvider()
UdfUdafProvider
.public void loadBeamBuiltinFunctions()
public BeamRelNode parseQuery(java.lang.String query) throws ParseException
ParseException
public boolean isDdl(java.lang.String sqlStatement) throws ParseException
ParseException
public void executeDdl(java.lang.String sqlStatement) throws ParseException
ParseException
public org.apache.calcite.jdbc.CalcitePrepare.Context getContext()
public java.util.Map<java.lang.String,java.lang.String> getPipelineOptions()
public java.lang.String explain(java.lang.String sqlString) throws ParseException
ParseException