public abstract class QueryTransform extends PTransform<PInput,PCollection<Row>>
PTransform
representing an execution plan for a SQL query.
The table names in the input PCollectionTuple
are only valid during the current
query.
name
Constructor and Description |
---|
QueryTransform() |
Modifier and Type | Method and Description |
---|---|
PCollection<Row> |
expand(PInput input)
Override this method to specify how this
PTransform should be expanded
on the given InputT . |
QueryTransform |
registerUdaf(java.lang.String functionName,
Combine.CombineFn combineFn)
register a
Combine.CombineFn as UDAF function used in this query. |
QueryTransform |
registerUdf(java.lang.String functionName,
java.lang.Class<? extends BeamSqlUdf> clazz)
register a UDF function used in this query.
|
QueryTransform |
registerUdf(java.lang.String functionName,
SerializableFunction sfn)
Register
SerializableFunction as a UDF function used in this query. |
static QueryTransform |
withQueryString(java.lang.String queryString)
Creates a
QueryTransform with SQL queryString . |
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
public PCollection<Row> expand(PInput input)
PTransform
PTransform
should be expanded
on the given InputT
.
NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to the InputT
using the apply
method.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
expand
in class PTransform<PInput,PCollection<Row>>
public static QueryTransform withQueryString(java.lang.String queryString)
QueryTransform
with SQL queryString
.public QueryTransform registerUdf(java.lang.String functionName, java.lang.Class<? extends BeamSqlUdf> clazz)
Refer to BeamSqlUdf
for more about how to implement a UDF in BeamSql.
public QueryTransform registerUdf(java.lang.String functionName, SerializableFunction sfn)
SerializableFunction
as a UDF function used in this query.
Note, SerializableFunction
must have a constructor without arguments.public QueryTransform registerUdaf(java.lang.String functionName, Combine.CombineFn combineFn)
Combine.CombineFn
as UDAF function used in this query.