4paradigm / 4paradigm/OpenMLDB

SQL: support DATE literal and TIMESTAMP literal

Open
#866 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
1.7k
Forks
331
Avg merge
12d 12h
Merged PRs (30d)
1

Description

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

Now, we have numeric literals and string literals in OpenMLDB. Users are expecting to use DATE literal and TIMESTAMP literal as described in Standard SQL.

In this issue, we are going to support DATE literal and TIMESTAMP literals
```sql
::= DATE
::=

::= TIMESTAMP
::=

::=
::=
::=

::=

```

```sql
SELECT TIMESTAMP "2021-05-20 10:11:12+08", DATE "2021-05-20";
```

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

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

Contributor guide

Open the contributing guide

Research direction

The issue involves extending the SQL parser to recognize DATE and TIMESTAMP literals. Look at the existing literal parsing code in the OpenMLDB codebase, likely in the SQL parser module. Understand the grammar rules provided and implement support for the new literal types. Test with SQL statements like SELECT TIMESTAMP "2021-05-20 10:11:12+08", DATE "2021-05-20"; to ensure they are correctly parsed and evaluated.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.