Spark: Fix regression from Scan refactor (#5143)