Try it · 2 minutes · no account

Fix one line. Press Submit.

A real exercise from Open Table Formats, chapter 1. It runs on Python 3.12.15 · deltalake 1.6.6 · duckdb 2.0.0 · matplotlib 3.11.2 · pyarrow 26.0.1 · pyiceberg 0.12.0, the versions the book was tested on.

  1. ReadThe task says what the code should do, and the section it's from says why.
  2. Change one lineLine 43 is the one to change.
  3. SubmitWe run it on the versions the book was tested on and tell you if it's right.
Exercise 1.4

Add the views instead of counting rows

Line 43 counts the rows instead of adding up their views. Fix it so the total is every view in the scan.

            print_rows(top, keep_order=True)            # One row with one column: the sum.            # A second route to the same total, summed in Python from the scan's own rows.            pyiceberg_total = sum(arrow["views"].to_pylist())            print(f"total views in DuckDB: {duckdb_total}")
Runs on Python 3.12.15 · deltalake 1.6.6 · duckdb 2.0.0 · matplotlib 3.11.2 · pyarrow 26.0.1 · pyiceberg 0.12.0

No account needed for this one.

That's every exercise in the books, with Labs.

The books stay free to read.

Start Labs

The books stay free to read.

See pricing