Using SQLAlchemy ClauseElement and Expression in DataFrame.assign() | teradataml - Using Basic SQLAlchemy ClauseElement and Expression in DataFrame.assign() - Teradata VantageCloud Lake

Lake - Analyze Your Data with ClearScape Analytics™

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2026-02-20
dita:mapPath
tcl1683670667798.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
tcl1683670667798

With the help of SQLAlchemy, in teradataml, user not only can run SQL functions, but also can run some other features that Vantage offers. Basically, user can use SQLAlchemy ClauseElements, representing select_expression clauses in query.

teradataml can use SQLAlchemy ClauseElements to do following:

  • Build a CASE expression on teradataml DataFrame column and select the using DataFrame.assign().
  • Cast a teradataml DataFrame column.
  • Select distinct values from a teradataml DataFrame Column.
  • Extract values from teradataml column, using EXTRACT function.

Refer to example notebook pkg_install_location\teradataml\data\notebooks\sqlalchemy\teradataml assign() - Using Generic SQLAlchemy ClauseElements (Case, Cast, Extract, Distinct).ipynb to learn about these.