Cast BIGINT to INT/SMALLINT in ONE DATA

Hi everybody,
Does anyone know how to convert a BIGINT to INT / SMALLINT in a Query Processor in a WF?Background: I want to use the function ADD_DATE and it requires an INT / SMALLINT but my column is a BIGINT Solutions I have tried which did not work:

  • CAST( <Column> AS INT)
  • CAST( CAST(<Column> AS FLOAT) AS INT)
  • CAST( CAST(<Column> AS STRING) AS INT)

Thanks in advance :slight_smile:

What is the type of the data source? Is it Parquet or do you load data via Connection from Oracle?

Yes, Oracle Database and a Parquet file.

Yesterday CAST( AS SMALLINT) did not work - today it started working.

Solution:
CAST(<Column> AS SMALLINT)

2 Likes