Data connectivity & integrationPipeline Builder ExpressionsCast

Cast

Supported in: Batch, Streaming

Cast expression to given type.

Expression categories: Cast, Popular

Declared arguments

  • Expression - Expression to cast.
    Expression<AnyType>
  • Type - Type to cast to.
    Type<C>

Type variable bounds: C accepts AnyType

Output type: C

Examples

Example 1: Base case

Description: Casting string to long Argument values:

  • Expression: 1234
  • Type: Long

Output: 1234


Example 2: Base case

Description: Casting long to string Argument values:

  • Expression: 1234
  • Type: String

Output: 1234


Example 3: Base case

Argument values:

  • Expression: a
  • Type: Date
aOutput
2020-01-012020-01-01
nullnull

Example 4: Base case

Description: Casting string to decimal Argument values:

  • Expression: 1234
  • Type: Decimal(4, 0)

Output: 1234