Materialize before reuse
cache marks a DataFrame for reuse. The first action computes and stores partitions; this example uses count, then show. Caching has overhead and is usually unnecessary for six rows. It is valuable when expensive intermediate data is reused. finally releases this example’s cache; the studio’s later validation collection may recompute the result.