Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
acvictor committed Apr 5, 2024
1 parent d3664f6 commit 719314a
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions velox/functions/sparksql/DateTimeFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,13 @@ template <typename T>
struct CurrentTimestampFunction {
VELOX_DEFINE_FUNCTION_TYPES(T);

FOLLY_ALWAYS_INLINE void initialize(
const std::vector<TypePtr>& /*inputTypes*/,
const core::QueryConfig& /*config*/) {
FOLLY_ALWAYS_INLINE void call(out_type<Timestamp>& result) {
auto now = std::chrono::system_clock::now();
auto epoch = std::chrono::duration_cast<std::chrono::microseconds>(
now.time_since_epoch())
.count();
currentTimestamp_ = Timestamp::fromMicros(epoch);
}

FOLLY_ALWAYS_INLINE void call(out_type<Timestamp>& result) {
result = currentTimestamp_;
result = Timestamp::fromMicros(epoch);
}

protected:
Timestamp currentTimestamp_;
};

template <typename T>
Expand Down

0 comments on commit 719314a

Please sign in to comment.