[SPARK-3966][SQL] Fix nullabilities of Cast related to DateType.