Skip to main content
Version: v1.13 print this page

CastColumnType

This node creates a new DataFrame by casting input columns with a new data type

Input

This type of node takes in a DataFrame and transforms it to another DataFrame

Output

This node casts the data type of columns as specified

Type

transform

Fields

NameTitleDescription
inputColsColumnsColumns to be cast to new data type
outputColTypeNew Data TypeNew data type(INTEGER, DOUBLE, STRING, LONG, SHORT)
replaceExistingColsReplace Existing ColsWhether to replace existing columns or create new ones

Examples

Input

nameageheight
StringTypeStringTypeStringType
Alice580
Alice580
Alice1080

Parameters1 ----------

NameValue
Columnsage,height
New Data TypeDOUBLE
Replace Existing Colstrue

Output1

nameageheight
DoubleTypeDoubleTypeDoubleType
Alice5.080.0
Alice5.080.0
Alice10.080.0

Parameters2 ----------

NameValue
Columnsage,height
New Data TypeDOUBLE
Replace Existing Colsfalse

Output2

nameageheightage-newheight-new
DoubleTypeStringTypeStringTypeDoubleTypeDoubleType
Alice5805.080.0
Alice5805.080.0
Alice108010.080.0