4paradigm / 4paradigm/OpenMLDB

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

オープン
#865 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
C++
スター
1.7k
フォーク
331
平均マージ
12日 12時間
マージ済み PR(30日)
1

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp, sql
領域
backend, database
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。