colRegex | teradatamlspk | pyspark2teradataml - colRegex - 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

For the colRegex function, PySpark returns result based on Scala or Java regex; teradatamlspk returns based on Python RegEx.

The following two examples show that the return are different in PySpark and teradatamlspk.

PySpark

df.select(df.colRegex("`(Col.)`")).show()
+----+----+
|Col1|Col2|
+----+----+
|   a|   1|
|   b|   2|
|   c|   3|
+----+----+

teradatamlspk

>>> df.select(df.colRegex("(Col.)")).show()
+----+----+
|Col1|Col2|
+----+----+
|   c|   3|
|   b|   2|
|   a|   1|
+----+----+