public static class BeamSql.QueryTransform extends PTransform<PCollectionTuple,PCollection<BeamRecord>>
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(java.lang.String sqlQuery) |
Modifier and Type | Method and Description |
---|---|
PCollection<BeamRecord> |
expand(PCollectionTuple input)
Override this method to specify how this
PTransform should be expanded
on the given InputT . |
BeamSql.QueryTransform |
withUdaf(java.lang.String functionName,
Combine.CombineFn combineFn)
register a
Combine.CombineFn as UDAF function used in this query. |
BeamSql.QueryTransform |
withUdf(java.lang.String functionName,
java.lang.Class<? extends BeamSqlUdf> clazz)
register a UDF function used in this query.
|
BeamSql.QueryTransform |
withUdf(java.lang.String functionName,
SerializableFunction sfn)
register
SerializableFunction as a UDF function used in this query. |
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate
public BeamSql.QueryTransform withUdf(java.lang.String functionName, java.lang.Class<? extends BeamSqlUdf> clazz)
Refer to BeamSqlUdf
for more about how to implement a UDF in BeamSql.
public BeamSql.QueryTransform withUdf(java.lang.String functionName, SerializableFunction sfn)
SerializableFunction
as a UDF function used in this query.
Note, SerializableFunction
must have a constructor without arguments.public BeamSql.QueryTransform withUdaf(java.lang.String functionName, Combine.CombineFn combineFn)
Combine.CombineFn
as UDAF function used in this query.public PCollection<BeamRecord> expand(PCollectionTuple 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<PCollectionTuple,PCollection<BeamRecord>>