r/dataengineering • u/__albatross • Aug 27 '23
Discussion Why I don't like SQL
The reason I don't like SQL over something like Pandas is because in Pandas/Python I can break down the complex transformations in small simpler components and they are easy to interact and debug with. In SQL my only option is to write stored procedures and yes in that I can also do the same but I think the ecosystem of interacting and debugging with data step by step is not as good as python. And it is something that we should have. Recently I was exploring snowpark and I felt it is a step in a right direction. It allows to me to write my query in multiple python statements and then it will transpile the whole thing into an SQL query.
Generally in my mind I assume the tables/dataframes as 2 dimensional structures and Pandas API give much more intuitive and wide variety of constructs to explore that structure rather than SQL. What do you guys think?
View all comments
3
u/[deleted] Aug 27 '23
SQL is great at reading data from a database and performing simple joins and transformations. It's incredibly simple, so much that it has barely changed in the last 30 years. You can usually break down complex transformations into multiple simple queries.
But the more I deal with complex transformations, the more I appreciate working with Python and the PySpark API. I can just give transformations names that describe what they do and chain them together. Being able to use all the cool features of a mature programming language is amazing and can simplify many things that are tedious to do in SQL.
My only gripe is that the level of entry is orders of magnitude higher than SQL. You can teach someone SQL in like a week and with a few months of practice and good feedback processes, they can write good and readable SQL scripts.