risingwavelabs / risingwave

Best-in-class stream processing, analytics, and management. Perform continuous analytics, or build event-driven applications, real-time ETL pipelines, and feature stores in minutes. Unified streaming and batch. PostgreSQL compatible.
https://go.risingwave.com/slack
Apache License 2.0
6.97k stars 575 forks source link

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

Open KeXiangWang opened 9 months ago

KeXiangWang commented 9 months ago

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

fuyufjh commented 7 months ago

Ping @KeXiangWang

github-actions[bot] commented 2 months ago

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