In the end I solved this by using a Shell Script, I looked all around in the docs, and for StarRocks there is not such a thing as making UDF's or Procedures to ALTER TABLES, also no cursor/recursive functions.