4paradigm / 4paradigm/OpenMLDB

support function: current_timestamp, current_date, now

Open
#3,198 0 comments 0 reactions 1 assignee Claimed by @aceforeverd View on GitHub
enhancement execute-engine udf
Dominant language
C++
Stars
1.7k
Forks
331
Avg merge
12d 12h
Merged PRs (30d)
1

Description

same functions in Spark SQL.

1. There is `unix_timestamp("")` as a temp solution, not convenient though. unix_timestamp returns unix epouch time in seconds as int64, one must write `timestamp (unix_timestamp("") * 1000)` to archive current_timestamp.
2. all `current_*` function should executed at begining of one SQL, means all `current_*` functions calls in same SQL should guarantee return the same value, no matter where the `current_*` call is.

Contributor guide

Open the contributing guide

Research direction

Look for existing timestamp functions like `unix_timestamp` in the SQL function implementation. The new functions `current_timestamp`, `current_date`, and `now` need to be added, ensuring they return the same value for all calls within a single SQL statement. Check how query execution context is managed to guarantee consistency. Test by writing SQL queries that call these functions multiple times.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
backend, database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.