Catch ’em All: Efficient Massive Tabular Data Handling with Tablecloth by Mey Beisaron

March 22, 2023

In the Catch ’em All: Efficient Massive Tabular Data Handling with Tablecloth presentation by Mey Beisaron, she discusses her experience handling massive tabular data efficiently using the Tablecloth library. Tablecloth is a performant and easy-to-use Clojure Library designed for table processing. Mey compares it to other methods in Clojure and demonstrates its capabilities using Pokemon datasets. The library’s features include handling empty values, filtering and joining datasets, and its high efficiency due to the use of basic types and Java interfaces. The speaker also shares a personal anecdote about reconnecting with Pokemon through her children.

Catch ’em All: Efficient Massive Tabular Data Handling with Tablecloth: A comprehensive overview

Introduction and Background

Mey Beisaron introduced herself as a software engineer with a rich background in multiple programming languages and a passion for Star Wars. She set the stage for the presentation by discussing the challenges of handling massive data — specifically, 100 billion events per day — using Clojure. While Clojure offers good performance, optimizing and profiling are necessary to manage such large volumes effectively.

 

Introduction to Tablecloth

Tablecloth is a Clojure library designed for efficient and consistent table processing. Mey explained that it wraps around the TecML dataset, a high-performance tabular data processing library. Tablecloth aims to simplify data manipulation tasks.

Mey showcased two Pokémon datasets to illustrate Tablecloth’s capabilities compared to traditional methods. The first dataset included information on all 802 Pokémon, while the second covered Pokémon battles and their outcomes.

 

Demonstrating Tablecloth’s efficiency

Mey demonstrated the ease of loading a CSV file and using it as a map with Tablecloth, highlighting the simplicity and intuitiveness of the process compared to Clojure. She provided an example of finding the shortest Pokémon using Tablecloth’s functions, emphasizing the straightforward syntax and efficient data handling.

In another example, Mey imported a Pokémon file into Tablecloth, selected specific columns, and ordered the data by height. She pointed out the elegant handling of empty values and the readable output. When attempting the same operation with Clojure, an error occurred due to empty strings, illustrating Tablecloth’s robustness.

Mey also demonstrated using Tablecloth to filter and join datasets based on specific criteria, such as height and weight. This process involved loading the Pokémon dataset, selecting columns, applying filters, and performing a left join to connect datasets. The result showcased the Pokémon with the most wins matching the given criteria, underscoring Tablecloth’s powerful data manipulation capabilities.

 

Understanding Tablecloth’s core structures

Delving deeper into Tablecloth, Mey introduced key concepts like datasets, rows, and columns. A dataset in Tablecloth is implemented around the TecML data type library and can be viewed as a map of columns, with each column being a named sequence of typed data. This structure allows for efficient data processing and manipulation.

Mey discussed the implementation of Java interfaces and the use of array buffers, which contribute to Tablecloth’s high efficiency. She demonstrated loading a large dataset with 100 million rows and performing computations on a small subset without the need for lazy or caching computations. This approach minimizes unnecessary memory usage, ensuring efficient data handling.

 

Rows as maps and fast structs

One of the unique features of Tablecloth is its ability to treat rows both as maps and as stored columns. Mey explained this concept using the TecML dataset, showing how rows are returned as maps with column names injected with row values. She introduced the Fast Struct, a special type of map that enables rows to be seen as maps while being stored in columns.

 

Conclusion and resources

Mey concluded the presentation by inviting viewers to join study groups and explore additional resources on Tablecloth and TecML. She provided links to previous talks and code examples, expressing gratitude to Daniel Slutsky for his assistance with the presentation.

 

Personal anecdote

Mey shared a personal story about reconnecting with Pokémon through her children, reflecting on how her knowledge of the first generation of Pokémon created a nostalgic bond with her kids. This anecdote added a personal touch to the technical presentation, making it relatable and engaging.

Mey Beisaron’s presentation offered a comprehensive overview of Tablecloth and its capabilities for efficient massive tabular data handling. For those dealing with large datasets, Tablecloth presents a powerful and user-friendly solution that simplifies complex data manipulation tasks.

For further learning, Mey recommended exploring additional resources and participating in study groups to deepen understanding and proficiency in using Tablecloth for massive data handling.

 

Additional resources

Check out more from the MeetUp Func Prog Sweden. Func Prog Sweden is the community for anyone interested in functional programming. At the MeetUps the community explore different functional languages like Erlang, Elixir, Haskell, Scala, Clojure, OCaml, F# and more.