I have got a lot of custom Dataframe transformations in my code. First group is simple casting:
dframe = dframe.withColumn("account_number", col("account").cast("decimal(38,0)"));
The second group is UDF-Transformations:
(UDF1<Timestamp, Integer>) s -> s.toLocalDateTime().extractMonth()
dframe = dframe.withColumn("month", callUDF(("monthExtractor"), dframe.col("trans_date_t")));
They are all working so the code is testing. But my final goal is to create ML Pipeline out of the code so I'd able to reuse . So is there a way to convert the code above into various Transformers?