Catalyst Optimizer Pushdown Encounter
I ended up learning about how the spark catalyst optimizer performs a so called predicate pushdown, running into this weird issue, simplifying my example below. The behavior was encountered when a df has “left_id”, “free_form” and, where df_ref contains “right_id”, “location” and the column “free_form” contains yyyyMMdd dates only when “location” is “12345” and so thats why a join is performed, start_date = '2024-01-01' end_date = '2025-12-31' (df.join(df_ref, df.left_id = df_ref.right_id, "left") .filter(f.col("location" ) == "12345").withColumn ( "foo_date", f.to date("free_form", "ууууMMdd") ) .where(f.col("foo_date").between(start_date, end_date)) .display()) But mysteriously this crashes when the final start_date, end_date filter is done with ...
