public class SQLTransformer extends Object implements Transformer<SQLTransformer>, SQLTransformerParams<SQLTransformer>
Currently we only support SQL syntax like `SELECT ... FROM __THIS__ ...` where `__THIS__` represents the input table and cannot be modified.
The select clause specifies the fields, constants, and expressions to display in the output. Except the cases described in the note section below, it can be any select clause that Flink SQL supports. Users can also use Flink SQL built-in function and UDFs to operate on these selected columns.
For example, SQLTransformer supports statements like:
Note: This operator only generates append-only/insert-only table as its output. If the output table could possibly contain retract messages(e.g. perform `SELECT ... FROM __THIS__ GROUP BY ...` operation on a table in streaming mode), this operator would aggregate all changelogs and only output the final state.
SQLTransformerParams.SQLStatementValidator
STATEMENT
Constructor and Description |
---|
SQLTransformer() |
Modifier and Type | Method and Description |
---|---|
Map<Param<?>,Object> |
getParamMap()
Returns a map which should contain value for every parameter that meets one of the following
conditions.
|
static SQLTransformer |
load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv,
String path) |
void |
save(String path)
Saves the metadata and bounded data of this stage to the given path.
|
org.apache.flink.table.api.Table[] |
transform(org.apache.flink.table.api.Table... inputs)
Applies the AlgoOperator on the given input tables and returns the result tables.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, getParam, set
getStatement, setStatement
public org.apache.flink.table.api.Table[] transform(org.apache.flink.table.api.Table... inputs)
AlgoOperator
transform
in interface AlgoOperator<SQLTransformer>
inputs
- a list of tablespublic void save(String path) throws IOException
Stage
save
in interface Stage<SQLTransformer>
IOException
public static SQLTransformer load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv, String path) throws IOException
IOException
public Map<Param<?>,Object> getParamMap()
WithParams
1) set(...) has been called to set value for this parameter.
2) The parameter is a public final field of this WithParams instance. This includes fields inherited from its interfaces and super-classes.
The subclass which implements this interface could meet this requirement by returning a
member field of the given map type, after having initialized this member field using the
ParamUtils.initializeMapWithDefaultValues(Map, WithParams)
method.
getParamMap
in interface WithParams<SQLTransformer>
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.