opensearch-project / opensearch-project/sql

[PPL] timewrap: support series=exact with time_format for period column naming

Open
#5,606 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement PPL
Dominant language
Java
Stars
176
Forks
229
Avg merge
2d 21h
Merged PRs (30d)
43

Description

Is your feature request related to a problem?

Follow-up from #5241.

The timewrap command supports a series option that controls how the wrapped period columns are named. Currently series=short and series=exact behave identically — both fall back to the short s<N> naming (e.g. s0, s1, ...). The series=exact mode is intended to format the period start date using the time_format option, but this is not yet implemented.

See TimewrapPivot.renameTimewrapPeriod:

return switch (mode) {
  // series=exact (+ time_format) is not yet implemented; it intentionally falls back to the
  // short "s<N>" naming. TODO: format the period start date with time_format.
  case "short", "exact" -> "s" + absolutePeriod;
  ...
};
What solution would you like?

Implement series=exact: format each wrapped period's start date with the time_format option (defaulting to a sensible format when not provided) and use that as the column name, instead of falling back to s<N>.

What alternatives have you considered?

Leaving series=exact aliased to series=short (current behavior), which is a silent no-op and surprising to users who set the option.

Additional context

The timeFormat field is already threaded through TimewrapPivot (nullable) but is currently unused for naming.

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 at TimewrapPivot.renameTimewrapPeriod and trace how the nullable timeFormat field reaches period-column naming. Verify the series=exact path formats each period start date, including the default when time_format is absent, and confirm it no longer produces short s names.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.