spark-fast-tests icon indicating copy to clipboard operation
spark-fast-tests copied to clipboard

Question: Verification of Timestamp Values

Open KevinMellott91 opened this issue 3 years ago • 1 comments

I was considering bringing PowerMock together with spark-fast-tests to provide the ability to verify column transformations involving the system clock (ex: current_timestamp()). This seems like a pretty common use case though, so I figured I'd check in with the community first.

Has anybody had any luck testing functionality that deals with the system clock, which to my understanding is sealed within the Apache Spark framework?

KevinMellott91 avatar Jul 28 '21 15:07 KevinMellott91

I have had some success, but the comparison functions seem to want to convert Timestamps to local during comparison, so things can get odd. As far as spark is concerned, you can set the timezone that spark uses in the session, which helps with things like current_timestamp().

mikenac avatar May 17 '22 12:05 mikenac