Discovering Types (from Strings) with Cats and Shapeless
summary
Builds a schema discovery pipeline that takes one CSV column of strings and guesses concrete types using Cats and Shapeless rather than macros It implements parsers that return Option[T] for String Double Date etc and preserves those types by storing parsers in an HList of Parsers and invoking a Poly function to run them The pipeline also aggregates categorical counts by folding single entry maps with a Map monoid aggregation and demonstrates the approach works end to end in the provided REPL code
AI-written summary · about
chapters (16)
- 0:00Introduction
- 0:18The problem
- 1:00Data scientists love strings
- 2:19Heuristics
- 3:00Demo
- 3:15Explanation
- 3:28Parser
- 5:46Shapeless
- 7:06Pars
- 7:52Strings
- 12:23SemiGroups
- 13:09Combine
- 14:11MonoID
- 14:46Complete Code
- 15:04Implicit Parameters
- 15:44Questions
related talks
35mScalable data pipelines with shapeless and cats
33mTYPE CLASSES FROM THE GROUND UP
57mKittens: Shapeless Typeclass Derivation for Cats
20mType Classes for the Rest of Us
31mCool toolz in the Scalaz and Cats toolboxes
49mRoll Your Own Shapeless
36mKittens - datatype-generic functional programming with Scala
24mLet the Scala compiler work for you
