Skip to content

[fix](function) add time type in conditional-functions (#41270) - #41380

Closed
Mryange wants to merge 3 commits into
apache:branch-2.0from
Mryange:branch-2.0-pick-41270
Closed

[fix](function) add time type in conditional-functions (#41270)#41380
Mryange wants to merge 3 commits into
apache:branch-2.0from
Mryange:branch-2.0-pick-41270

Conversation

@Mryange

Copy link
Copy Markdown
Contributor

#41270
before

mysql [(none)]>select sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar)));
+---------------------------------------------------------------------------------------+
| sec_to_time(time_to_sec(cast(cast('2024-09-24 16:00:00' as VARCHAR(65533)) as TIME))) |
+---------------------------------------------------------------------------------------+
| 16:00:00 |
+---------------------------------------------------------------------------------------+
mysql [(none)]>select ifnull(sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar))), cast(300 as time));
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| ifnull(cast(sec_to_time(time_to_sec(cast(cast('2024-09-24 16:00:00' as VARCHAR(65533)) as TIME))) as DOUBLE), cast(cast(300 as TIME) as DOUBLE)) |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| 57600000000 |
+--------------------------------------------------------------------------------------------------------------------------------------------------+

now

mysql [(none)]>select ifnull(sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar))), cast(300 as time));
+------------------------------------------------------------------------------------------------------------------+
| ifnull(sec_to_time(time_to_sec(cast(cast('2024-09-24 16:00:00' as VARCHAR(65533)) as TIME))), cast(300 as TIME)) |
+------------------------------------------------------------------------------------------------------------------+
| 16:00:00 |
+------------------------------------------------------------------------------------------------------------------+

Proposed changes

Issue Number: close #xxx

before
```
mysql [(none)]>select sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar)));
+---------------------------------------------------------------------------------------+
| sec_to_time(time_to_sec(cast(cast('2024-09-24 16:00:00' as VARCHAR(65533)) as TIME))) |
+---------------------------------------------------------------------------------------+
| 16:00:00 |
+---------------------------------------------------------------------------------------+
mysql [(none)]>select ifnull(sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar))), cast(300 as time));
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| ifnull(cast(sec_to_time(time_to_sec(cast(cast('2024-09-24 16:00:00' as VARCHAR(65533)) as TIME))) as DOUBLE), cast(cast(300 as TIME) as DOUBLE)) |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| 57600000000 |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
```
now ```
mysql [(none)]>select ifnull(sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar))), cast(300 as time));
+------------------------------------------------------------------------------------------------------------------+
| ifnull(sec_to_time(time_to_sec(cast(cast('2024-09-24 16:00:00' as VARCHAR(65533)) as TIME))), cast(300 as TIME)) |
+------------------------------------------------------------------------------------------------------------------+
| 16:00:00 |
+------------------------------------------------------------------------------------------------------------------+
```
@doris-robot

Copy link
Copy Markdown

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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@Mryange

Copy link
Copy Markdown
ContributorAuthor

run buildall

@Mryange

Copy link
Copy Markdown
ContributorAuthor

run buildall

@github-actionsgithub-actionsBot added the area/planner Issues or PRs related to the query planner label Sep 27, 2024
@Mryange

Copy link
Copy Markdown
ContributorAuthor

run buildall

@Mryange

Copy link
Copy Markdown
ContributorAuthor

run external

@github-actions

Copy link
Copy Markdown
Contributor

We're closing this PR because it hasn't been updated in a while.
This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/nereidsarea/plannerIssues or PRs related to the query plannerkind/testStale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Mryange@doris-robot