Testability - you use a general purpose language to execute SQL. Again, I don't know what you mean.
Composability - I suppose, but remember SQL is a language to retrieve data. I reuse fragments everywhere in a general purpose language.
I don't understand why anyone would prefer SQL to that for anything beyond a simple SQL query. And it's not just my opinion: industry at large uses Spark for production with complex queries. SQL is for analysts.
SQL is for analysts? Everyone uses SQL.
https://spark.apache.org/examples.html
SQL is just a DSL; there's nothing magical about it. If you ditch it you can get your type safety, composability, and testability back, like so:
https://boringml.com/docs/platforms/spark/testing-dataframes...
There is nothing magical about wrapping database objects in language classes. This has been happening forever.
https://docs.sqlalchemy.org/en/20/orm/quickstart.html#select...
Nothing magical about using a function call rather than raw SQL.
I don't understand your argument if you're comfortable with ORMs.
Furthermore any competent engineer knows SQL because ORMs are cumbersome and annoying for anything except basic use.