4paradigm / 4paradigm/OpenMLDB

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

Offen
#865 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
C++
Sterne
1.7k
Forks
331
Ø Merge
12 T. 12 Std.
Gemergte PRs (30 T.)
1

Beschreibung

**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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, sql
Bereich
backend, database
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.