[SPARK-3407][SQL]Add Date type support

Using `.getTime` to do the comparison would be much more efficient. When caching a `DateType` column, this function is really a critical path.