4paradigm / 4paradigm/OpenMLDB

built-in-function: Support string parameter for data/time functions like `dayofyear()`, `monthofyear()`, etc

Aperta
#865 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
C++
Stelle
1.7k
Fork
331
Merge medio
12g 12h
PR unite (30g)
1

Descrizione

**Is your feature request related to a problem? Please describe.**

OpenMLDB provides some built-in date and time functions. Most of those functions only support using a `bigint` or a `timestamp` or a `date` type parameter. For instance, then function `dayofmonth()` supports parameter types like `bigint`(`int64`), `timestamp` and `date`.
However, most of the popular DB (e.g, MySQL, PostgresSQL, Oracle, TSQL) support using a date/time string as parameter.

In this issue, we are going to support using a date/time string as the parameter for most of the built-in date/time functions:
- year()
- month()
- day(), dayofmonth()
- dayofweek()
- weekofyear()
- hour()
- minute()
- second()

**Describe the solution you'd like**

- [ ] implement related C++ function for string parameter
- [ ] register into default library

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue is about extending date/time functions in OpenMLDB to accept string parameters. Look for the built-in function implementations in C++ (likely in a directory like src/udf or src/engine). Find the existing functions like dayofmonth() and see how they handle bigint, timestamp, and date types. You'll need to add string parsing logic and register the new overloads in the default library. Check for any existing string-to-date conversion utilities. Running existing tests for these functions will help verify the changes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, sql
Ambito
backend, database
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.