3 ms·
Even for data transformation logic, SQL isn’t the best choice. How would you handle the case when you need to apply the same transformations to few dozens or hu
by alexott 4y ago
Even for data transformation logic, SQL isn’t the best choice. How would you handle the case when you need to apply the same transformations to few dozens or hundreds columns?
- cced 4y agoI'm not sure I understand the question, you can create tables/views based on others that have the transformations applied to them, tools like dbt[1] make this easy. [1]: https://www.getdbt.com/ https://www.getdbt.com/
- thesz 4y agoSome SQL engines support generating and evaluating queries. I stumbled upon a function in MariaDB code base that is introduced and keps specifically for that use case (it returns properly quoted SQL value as a string, including "NULL" string for null values). It is aptly named QUOTE [1]. [1] https://mariadb.com/kb/en/quote/ https://mariadb.com/kb/en/quote/ You can then specify columns as a query, group_concat the result and evaluate resulting statement [2]. https://mariadb.com/kb/en/execute-immediate/ https://mariadb.com/kb/en/execute-immediate/ I hope that helps.