shiftleft | teradatamlspk | pyspark2teradataml - shiftleft - Teradata Package for Python

Teradata® pyspark2teradataml User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
March 2024
Language
English (United States)
Last Update
2024-04-11
dita:mapPath
oeg1710443196055.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
oeg1710443196055
Product Category
Teradata Vantage

Function shiftleft supports only integer values.

If you are using float values, you need to convert the value.

See how it works differently in PySpark and in teradatamlspk.

PySpark

df.withColumn("new_column", shiftleft(df.col, 2)).show()

teradatamlspk

df1 = df.withColumn("col", floor(df.col))
df1.withColumn("new_column", shiftleft(df1.col.cast(IntegerType()), 2)).show()