In Spark SQL I could not find a function that adds days to a timestamp and receive a timestamp back, and I can use a calculated value to do so.
This works, but static
SELECT col1 + interval 2 days FROM
VALUES make_timestamp(2021, 12, 28, 6, 30, 45.887)
I need one that I can calculate. This doesn't work (I cannot fill it with column value either):
SELECT col1 + interval (5-3) days
FROM VALUES make_timestamp(2021, 12, 28, 6, 30, 45.887)
This is not good either (as it gives a date back):
SELECT date_add(col1,1) FROM
VALUES make_timestamp(2021, 12, 28, 6, 30, 45.887)