I have developed a regular expression to split each row in the PySpark dataframe into three columns based on the comma delimiter. Here is the regular expression:

r'(\d+),([\w ]+),(\d+)'

This regular expression matches any row that contains a sequence of digits followed by a comma, followed by a sequence of one or more word characters (including whitespace) followed by a comma, and ending with a sequence of digits.

To use this regular expression in PySpark, you can create a UDF that takes a string as input and returns a tuple of three strings as output. Here's an example of how you can define this UDF:

import re

def split_row(row):
    split_values = re.match(r'(\d+),([\w ]+),(\d+)', row).groups()
    return (split_values[0], split_values[1], split_values[2])
    
split_row_udf = udf(split_row, StructType([
    StructField('id', StringType(), True),
    StructField('country', StringType(), True),
    StructField('total', StringType(), True),
]))
You can then use this UDF to split each row in the dataframe into three columns:

from pyspark.sql.functions import col

df = df.select(split_row_udf(col('column_name')).alias('new_columns'))
df = df.selectExpr('new_columns.id', 'new_columns.country', 'new_columns.total')

I hope this solution helps you accomplish your objective.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence