The Power of SQL Lambda Functions
Maximilian Emanuel Schüle, Dimitri Vorona, Linnea Passing, Lang, Harald, Alfons Kemper, Stephan Günnemann, Thomas Neumann · Zenodo (CERN European Organization for Nuclear Research) · 2019
This work demonstrates a wide range of applications that use lambda expressions in SQL. Such injected code snippets form a useful technique required by data mining algorithms to overcome the inflexibility of the SQL language, as the language is limited to predefined aggregations only. Following the ’move computation to the data’ paradigm, we extend SQL lambda functions - also known from common programming languages - for machine- learning tasks. As machine-learning relies mostly on gradient descent and tensor data types, we use lambda expressions for clustering and graph-mining algorithms as well as to formulate loss functions and label data. To underline the flexibility gained in SQL, this work demonstrates a main memory database system with integrated lambda expressions accessible through table functions in SQL. By reusing SQL and performing data mining and machine- learning tasks faster than can dedicated tools, this demonstration aims at convincing data scientists of the capabilities of database systems for computational tasks.