Skip to content

Conversation

@924060929
Copy link
Contributor

cherry pick from #50142

…pache#50142)

fix fold constant return wrong scale of datetime type

for example, this sql should return data type `datatime(6)`, but the
fold constant rule will direct return the first argument, so return the
wrong data type `datetime(0)`
```sql
select nvl(cast('2025-04-17 01:02:03' as datetime(0)), cast('2025-04-17 01:02:03.123456' as datetime(6)))
```

(cherry picked from commit c679c83)
@924060929 924060929 requested a review from yiguolei as a code owner May 8, 2025 12:29
@Thearas
Copy link
Contributor

Thearas commented May 8, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@924060929
Copy link
Contributor Author

run buildall

@yiguolei yiguolei merged commit 37f3c8f into apache:branch-2.1 May 9, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants