4paradigm / 4paradigm/OpenMLDB

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

Ouverte
#865 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
C++
Étoiles
1.7k
Forks
331
Merge moyen
12 j 12 h
PR mergées (30 j)
1

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
cpp, sql
Domaine
backend, database
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.