Went step further to ask ChatGPT to translate Teradata Query with UDF to Spark SQL API and Hive SQL. Asked it to optimize further. Then create code to run on Spark cluster. Save back results on Teradata database. It did that. Insane!