Relational Algebra in Scala3 - how is it possible?
summary
Claims that most relational algebra operations run at compile time by generating plain-tuple code and proves it with concrete implementations of projection, cross product (concatenation), join, column replace/rename and a small expression DSL. It uses Scala 3 inline, match types and constValue/constTuple plus type lambdas to derive schemas and per-row converters; the runtime representation is a flat tuple. A few pragmatic workarounds remain: some explicit casts and a manually passed appended schema due to current type-dependency limits, and no performance numbers yet.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 0:45Agenda
- 2:45Inline
- 4:04Match on types
- 4:50Type level computation
- 6:20Inline function
- 7:20Const value
- 10:07Type ontology
- 12:39New schema
- 13:59tuple
- 17:29operations
- 18:26relation
- 19:17projection
- 22:04cross
- 23:35concatenation
- 25:22cast
- 25:41apply to data
- 26:28speed up
- 26:47replace and rename
- 27:09calculate column
- 27:38dsl
- 28:38application
