https://delta.io logo
s

sabari dass

02/06/2023, 11:07 AM
Hi All, Is there anyway to get next day timestamp value from current timestamp? For date field, I can do it by using sf.date_add() function but not sure about timestamp field. Can anyone please help me on this? Thanks!
c

Christopher Grant

02/06/2023, 6:30 PM
unsure about builtins for this, but if you can use expressions via selectExpr you can use the INTERVAL syntax e.g
Copy code
spark.sql("SELECT (CURRENT_TIMESTAMP() + INTERVAL '1 DAY') as tomorrow_ts").display()
👍 1
please post non-delta questions in #random next time
👍 1
or try stackoverflow, dataengineering reddit or apachespark reddit
6 Views