4paradigm / 4paradigm/OpenMLDB

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

Đang mở
#865 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
C++
Star
1.7k
Fork
331
Merge trung bình
12 ngày 12 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
cpp, sql
Lĩnh vực
backend, database
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.