risingwave icon indicating copy to clipboard operation
risingwave copied to clipboard

bug(expr): to_char consider unsupported format as plain text

Open KeXiangWang opened this issue 1 year ago • 1 comments

Describe the bug

Current, to_char works like this:

  1. find all the format item like 'YYYY(means year)'
  2. replace them with the number
  3. if the format item is unrecognized, consider it as plain text and keep it unchaged.
  4. return the string after replacemnt

The problem happens in 3. As we haven't support all the format item. An unknown format item will be kept as plain text and outputed. It does not produce any errors. This may cause user confused. Throwing an error may be better.

Error message/log

wrong output: `Day`

To Reproduce

SELECT to_char('2015-09-01T14:48:05.359000'::timestamp, 'Day');

Expected behavior

output Tuesday

How did you deploy RisingWave?

doesn't matter.

The version of RisingWave

v1.6

Additional context

No response

KeXiangWang avatar Jan 19 '24 02:01 KeXiangWang

Ping @KeXiangWang

fuyufjh avatar Mar 06 '24 09:03 fuyufjh

This issue has been open for 60 days with no activity.

If you think it is still relevant today, and needs to be done in the near future, you can comment to update the status, or just manually remove the no-issue-activity label.

You can also confidently close this issue as not planned to keep our backlog clean. Don't worry if you think the issue is still valuable to continue in the future. It's searchable and can be reopened when it's time. 😄

github-actions[bot] avatar Aug 01 '24 02:08 github-actions[bot]