opensearch-project / opensearch-project/sql

[FEATURE] Support time zone Information in timestamp literals

Open
#3,600 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ecosystem Integration enhancement PPL Priority-Low v3.1.0
Dominant language
Java
Stars
176
Forks
229
Avg merge
2d 21h
Merged PRs (30d)
43

Description

Is your feature request related to a problem?
Currently, the query engine does not support time zone information in timestamp literals. When using an ISO 8601 format with a time zone (e.g., 2025-05-15T10:30:00.000Z), the query fails with a SemanticCheckException.

POST {{baseUrl}}/_plugins/_ppl
Content-Type: application/x-ndjson

{
  "query": "source=test00001 | eval t=TIMESTAMP('2025-05-15T10:30:00.000Z')"
}

### Results
{
  "error": {
    "reason": "Invalid Query",
    "details": "timestamp:2025-05-15T10:30:00.000Z in unsupported format, please use 'yyyy-MM-dd HH:mm:ss[.SSSSSSSSS]'",
    "type": "SemanticCheckException"
  },
  "status": 400
}

What solution would you like?
The engine should support ISO 8601 timestamp literals with time zone information (e.g., Z, +08:00, etc.) and interpret them correctly.

What alternatives have you considered?
n/a

Do you have any additional context?
n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided PPL request and tracing how TIMESTAMP literals are parsed and validated in the query engine. Check the existing timestamp format handling, then add coverage for Z and offset forms such as +08:00; done means valid ISO 8601 values are accepted and interpreted correctly without breaking existing formats.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.