public class OutputColsHelper extends Object implements Serializable
Input: 1) Schema of input data being predicted or transformed. 2) Output column names of the prediction/transformation operator. 3) Output column types of the prediction/transformation operator. 4) Reserved column names, which is a subset of input data's column names that we want to preserve.
Output: 1)The result data schema. The result data is a combination of the preserved columns and the operator's output columns.
Several rules are followed:
For example, if we have input data schema of ["id":INT, "f1":FLOAT, "f2":DOUBLE], and the operator outputs a column "label" with type STRING, and we want to preserve the column "id", then we get the result schema of ["id":INT, "label":STRING].
end user should not directly interact with this helper class. instead it will be indirectly used via concrete algorithms.
Constructor and Description |
---|
OutputColsHelper(TableSchema inputSchema,
String[] outputColNames,
TypeInformation<?>[] outputColTypes) |
OutputColsHelper(TableSchema inputSchema,
String[] outputColNames,
TypeInformation<?>[] outputColTypes,
String[] reservedColNames)
The constructor.
|
OutputColsHelper(TableSchema inputSchema,
String outputColName,
TypeInformation<?> outputColType) |
OutputColsHelper(TableSchema inputSchema,
String outputColName,
TypeInformation<?> outputColType,
String[] reservedColNames) |
Modifier and Type | Method and Description |
---|---|
String[] |
getReservedColumns()
Get the reserved columns' names.
|
Row |
getResultRow(Row input,
Row output)
Merge the input row and the output row.
|
TableSchema |
getResultSchema()
Get the result table schema.
|
public OutputColsHelper(TableSchema inputSchema, String outputColName, TypeInformation<?> outputColType)
public OutputColsHelper(TableSchema inputSchema, String outputColName, TypeInformation<?> outputColType, String[] reservedColNames)
public OutputColsHelper(TableSchema inputSchema, String[] outputColNames, TypeInformation<?>[] outputColTypes)
public OutputColsHelper(TableSchema inputSchema, String[] outputColNames, TypeInformation<?>[] outputColTypes, String[] reservedColNames)
inputSchema
- Schema of input data being predicted or transformed.outputColNames
- Output column names of the prediction/transformation operator.outputColTypes
- Output column types of the prediction/transformation operator.reservedColNames
- Reserved column names, which is a subset of input data's column names
that we want to preserve.public String[] getReservedColumns()
public TableSchema getResultSchema()
public Row getResultRow(Row input, Row output)
input
- The input row being predicted or transformed.output
- The output row of the prediction/transformation operator.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.