Class ProjectionColumn
- java.lang.Object
-
- org.apache.flink.cdc.runtime.operators.transform.ProjectionColumn
-
- All Implemented Interfaces:
Serializable
public class ProjectionColumn extends Object implements Serializable
The ProjectionColumn applies to describe the information of the transformation column. If it only has column info, it describes the data column. If it has column info and expression info, it describes the user-defined computed columns.A projection column contains:
- column: column information parsed from projection.
- expression: a string for column expression split from the user-defined projection.
- scriptExpression: a string for column script expression compiled from the column expression.
- originalColumnNames: a list for recording the name of all columns used by the column expression.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectionColumncopy()ColumngetColumn()StringgetColumnName()Map<String,String>getColumnNameMap()StringgetColumnNameMapAsString()DataTypegetDataType()StringgetExpression()List<String>getOriginalColumnNames()StringgetScriptExpression()booleanisValidTransformedProjectionColumn()static ProjectionColumnofAliased(Column column, String newName, String mappedColumnName)This projection is created with a simple $id$ AS $new_id$ expression.static ProjectionColumnofCalculated(String columnName, DataType dataType, String expression, String scriptExpression, List<String> originalColumnNames, Map<String,String> columnNameMap)This projection is created with a complex calculation expression.static ProjectionColumnofForwarded(Column column, String mappedColumnName)This projection is created with a plain column name.StringtoString()
-
-
-
Method Detail
-
copy
public ProjectionColumn copy()
-
getColumn
public Column getColumn()
-
getColumnName
public String getColumnName()
-
getDataType
public DataType getDataType()
-
getExpression
public String getExpression()
-
getScriptExpression
public String getScriptExpression()
-
getColumnNameMapAsString
public String getColumnNameMapAsString()
-
isValidTransformedProjectionColumn
public boolean isValidTransformedProjectionColumn()
-
ofForwarded
public static ProjectionColumn ofForwarded(Column column, String mappedColumnName)
This projection is created with a plain column name.
Just like columnidinid, name AS new_name, age + 1 AS new_age.
Comments and default expressions will be intact.
-
ofAliased
public static ProjectionColumn ofAliased(Column column, String newName, String mappedColumnName)
This projection is created with a simple $id$ AS $new_id$ expression.
Just like columnnew_nameinid, name AS new_name, age + 1 AS new_age.
Comments and default expressions will be intact.
-
ofCalculated
public static ProjectionColumn ofCalculated(String columnName, DataType dataType, String expression, String scriptExpression, List<String> originalColumnNames, Map<String,String> columnNameMap)
This projection is created with a complex calculation expression.
Just like columnnew_ageinid, name AS new_name, age + 1 AS new_age.
No comments nor default expressions will be kept.
-
-