@Experimental(value=SCHEMAS) public class Convert extends java.lang.Object
Constructor and Description |
---|
Convert() |
Modifier and Type | Method and Description |
---|---|
static <OutputT> PTransform<PCollection<Row>,PCollection<OutputT>> |
fromRows(java.lang.Class<OutputT> clazz)
Convert a
PCollection <Row> into a PCollection <OutputT>. |
static <OutputT> PTransform<PCollection<Row>,PCollection<OutputT>> |
fromRows(TypeDescriptor<OutputT> typeDescriptor)
Convert a
PCollection <Row> into a PCollection <Row>. |
static <InputT,OutputT> |
to(java.lang.Class<OutputT> clazz)
Convert a
PCollection <InputT> to a PCollection <OutputT>. |
static <InputT,OutputT> |
to(TypeDescriptor<OutputT> typeDescriptor)
Convert a
PCollection <InputT> to a PCollection <OutputT>. |
static <InputT> PTransform<PCollection<InputT>,PCollection<Row>> |
toRows()
Convert a
PCollection <InputT> into a PCollection <Row>. |
public static <InputT> PTransform<PCollection<InputT>,PCollection<Row>> toRows()
PCollection
<InputT> into a PCollection
<Row>.
The input PCollection
must have a schema attached. The output collection will have
the same schema as the input.
public static <OutputT> PTransform<PCollection<Row>,PCollection<OutputT>> fromRows(java.lang.Class<OutputT> clazz)
PCollection
<Row> into a PCollection
<OutputT>.
The output schema will be inferred using the schema registry. A schema must be registered for this type, or the conversion will fail.
public static <OutputT> PTransform<PCollection<Row>,PCollection<OutputT>> fromRows(TypeDescriptor<OutputT> typeDescriptor)
PCollection
<Row> into a PCollection
<Row>.
The output schema will be inferred using the schema registry. A schema must be registered for this type, or the conversion will fail.
public static <InputT,OutputT> PTransform<PCollection<InputT>,PCollection<OutputT>> to(java.lang.Class<OutputT> clazz)
PCollection
<InputT> to a PCollection
<OutputT>.
This function allows converting between two types as long as the two types have compatible schemas. Two schemas are said to be compatible if they recursively have fields with the same names, but possibly different orders. If the source schema can be unboxed to match the target schema (i.e. the source schema contains a single field that is compatible with the target schema), then conversion also succeeds.
public static <InputT,OutputT> PTransform<PCollection<InputT>,PCollection<OutputT>> to(TypeDescriptor<OutputT> typeDescriptor)
PCollection
<InputT> to a PCollection
<OutputT>.
This function allows converting between two types as long as the two types have compatible schemas. Two schemas are said to be compatible if they recursively have fields with the same names, but possibly different orders. If the source schema can be unboxed to match the target schema (i.e. the source schema contains a single field that is compatible with the target schema), then conversion also succeeds.