A complete consider periods and Timestamps in Apache Spark 3.0