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.
| 构造器和说明 |
|---|
OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String[] outputColNames,
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] outputColTypes) |
OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String[] outputColNames,
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] outputColTypes,
String[] reservedColNames)
The constructor.
|
OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String outputColName,
org.apache.flink.api.common.typeinfo.TypeInformation<?> outputColType) |
OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String outputColName,
org.apache.flink.api.common.typeinfo.TypeInformation<?> outputColType,
String[] reservedColNames) |
| 限定符和类型 | 方法和说明 |
|---|---|
String[] |
getReservedColumns()
Get the reserved columns' names.
|
org.apache.flink.types.Row |
getResultRow(org.apache.flink.types.Row input,
org.apache.flink.types.Row output)
Merge the input row and the output row.
|
org.apache.flink.table.api.TableSchema |
getResultSchema()
Get the result table schema.
|
public OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String outputColName,
org.apache.flink.api.common.typeinfo.TypeInformation<?> outputColType)
public OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String outputColName,
org.apache.flink.api.common.typeinfo.TypeInformation<?> outputColType,
String[] reservedColNames)
public OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String[] outputColNames,
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] outputColTypes)
public OutputColsHelper(org.apache.flink.table.api.TableSchema inputSchema,
String[] outputColNames,
org.apache.flink.api.common.typeinfo.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 org.apache.flink.table.api.TableSchema getResultSchema()
public org.apache.flink.types.Row getResultRow(org.apache.flink.types.Row input,
org.apache.flink.types.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.