How Do I Use Special Characters with TIMESTAMP and DATE?
Symptom
In open-source Spark 3.2.0 and later versions, TIMESTAMP(*) or DATE(*) is not supported. The asterisk (*) can be any of the following characters:
- epoch
- today
- yesterday
- tomorrow
- now
By default, only the timestamp '*' or data '*' format is supported for new Spark versions. If you use the syntax of early versions to insert data into a data table, you will get the NULL value.
Solution
Set set spark.sql.convert.special.datetime=true; to use the syntax of early versions.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot