DSAN 6000: Big Data and Cloud Computing
Fall 2026
Monday, September 28, 2026
DuckDB nice to know, but in this class mainly as intro to querying .parquet
(More advanced DuckDB queries = more advanced SQL; outside scope of class!)
Polars we’re learning for its own sake: augment Pandas w/lazy evaluation

"""HW4 Q3 Data loaded into Pandas DataFrame
HW4 Q3 Computation written as SQL expression:
…Then you shoved them together: result_df = con.execute(query).df()
DataFrame (Python object)polars library specifies which functions “activate” eager evaluationDuckDB is an in-process SQL OLAP DBMS. (Aubury 2024)
Database Management System (DBMS): An interface between the database and its users, allowing create, read, update, and delete (CRUD) operations on the DB
Online Analytical Processing (OLAP): A data processing paradigm focused on applying column-wise aggregation functions and joining large datasets together
(Contrasts with Online Transaction Processing (OLTP), where frequent writing of individual records (rows) is the dominant pattern of data interaction)
Structured Query Language (SQL): A declarative programming language used to store, manipulate, and query records in relational databases – DBs representing data as tables of rows and columns, with formal relationships defined across tables
In-process: DuckDB embeds within a process + its memory. Most DBMSs run separately (e.g., on a remote server); DuckDB eliminates connect/authenticate steps
Standalone operation (as its own process, independent of Python): DuckDB CLI
Python operation: Upon import duckdb, creates a default, in-memory DB
import duckdb)
Setting up a connection creates a new, con-specific in-memory DB:
Can persist to file on disk:
Please note duckdb.connect() is not how we connect to the on-disk data files, external S3 objects, or in-memory DataFrames that we want to run queries on!
DataFrame library in Rust for fast (query-optimized), distributed OLAP workflowspolars = DataFrame library in Python, “high-level” (Python-level) “wrapper” around underlying Polars codepandas!polars!pl.DataFrame vs. LazyFrameDataFrames… “Types” in quotes because, a LazyFrame doesn’t actually contain any data!LazyFrame is a plan (using expressions) for creating a pl.DataFramelf.show_graph() to show Polars’ optimized query plancollect() is what actually executes the plan, materializing the result as a pl.DataFrameJanssens and Nieuwdorp (2025) p. 98, Figure 5.1
LazyFrames = “Plans” = Strings of Expressionspl.col():
pl.col('*') is the expression «all columns»pl.col(pl.String) is the expression «all string columns»pl.col('Age') is the expression «the column named 'Age'»pl.col('Age') > 20 is the expression «the col named 'Age' is greater than 20»e via predicates:
pl.select(e) to keep only columns matching epl.filter(e) to keep only rows matching epl.with_columns(e) to create new columns based on epl.group_by(e).len() to group based on e (then aggregate, here by counting)DSAN 6000 Week 5: Polars